ExeFilter is an open-source tool and python framework to filter file formats in e-mails, web pages or files. It detects many common file formats and can remove active content (scripts, macros, etc) according to a configurable policy.
Many networks are not really protected against active content which may enter up to the user workstation via e-mail, web or removable devices. Most of the common file formats such as Office documents, PDF, HTML or XML include native features which may be used to hide malicious active content or trigger XSRF and XSS attacks (see my articles about file formats security). A significant proportion of current attacks also take advantage of recent vulnerabilities discovered in various file formats to launch malicious code. The ever-increasing diversity and complexity of file formats make it hard to provide a comprehensive protection when using traditional methods such as antivirus engines and black-list filtering based on file extensions.
ExeFilter is an open-source tool and framework to improve protection against malicious active content in files. It has been designed to be either included in gateways (e-mail, web, web services, ...) or on user workstations to filter removable devices. Its unique white-list algorithm combined to a significant list of supported formats make it very effective to control which file formats are allowed to enter a secure network. It is also able to remove active content in order to receive only innocuous data.
PDF documents containing a new zero-day exploit for Adobe Reader 9.2 were captured in the wild in December 2009, and the corresponding vulnerability (CVE-2009-4324) was announced by Adobe on the 14th December. DEP seems to mitigate public exploits, but some claim to bypass it. A patch (Adobe Reader 9.3) was only published on the 12th January 2010... Which left a one month window, when the only solution was to disable PDF JavaScript on all computers, or to deploy everywhere the new "JavaScript Blacklist Framework" provided by Adobe. Fortunately, antivirus engines were catching up quickly and signatures were being provided, sometimes after a few days. But it is also known that these signatures may sometimes be evaded using variants of an exploit. Detecting generic exploits in PDF is far more complex than looking for static malware signatures.
Since this vulnerability is exploited using JavaScript in PDF, tests have shown that malicious PDF documents cleaned by ExeFilter become innocuous. This was also the case with previous vulnerabilities such as CVE-2009-0927. Therefore, disabling JavaScript in all incoming PDF documents with such a tool on gateways is an effective solution against this type of zero-days. You may test it easily by yourself by following these steps:
Cecill: open-source, GPL compatible.
ExeFilter is provided with a few sample files located in the demo_files folder.
How to analyze one file and create a sanitized version:
| On Windows: |
ExeFilter.py <source file> -o <destination file> |
| On Unix: |
python ExeFilter.py <source file> -o <destination file> |
Notes:
How to analyze all files from a directory according to the default policy, clean active content and copy sanitized files to a destination directory:
| On Windows: |
ExeFilter.py <source path> -d <destination path> |
| On Unix: |
python ExeFilter.py <source path> -d <destination path> |
Notes:
For example, in order to analyze all files from a CDROM or a USB stick on drive D: (on Windows) and copy a sanitized version in the directory C:\import, use the following command:
ExeFilter.py D:\ -d C:\import |
How to create a policy file with default options, and a HTML files describing each option:
ExeFilter.py -n policy.ini ExeFilter.py -e default_policy.html |
Then the policy.ini file may be edited using any text editor in order to modify options and filtering policy.
How to filter files using a custom policy:
ExeFilter.py <source path> -d <destination path> -p policy.ini |
For more information, see the current documentation.
Send an e-mail to decalage(at)laposte.net if you would like to contribute to the project, send patches, bug reports, develop new filters or simply tell us you have tested the tool on a specific platform.
| Attachment | Size |
|---|---|
| CanSecWest08_Lagadec_ExeFilter.pdf | 222.21 KB |