Research

Fess

Author(s)
Joe Stewart

Latest Version
0.1

Description
Fess (File Exploit Scanning System) is a Perl script which can scan email attachments for attempted exploits, using a Snort-like rules language. Fess attempts to bridge a gap between IDS (most of which cannot accurately parse complex files) and anti-virus (which often does not have proactive signatures against file-format vulnerabilities).

Fess is intended to run in the same way a gateway anti-virus scanner would; as a command-line application which is passed individual files to scan (archive scanning is not yet implemented). Fess can be integrated with the open-source Mailscanner software, using a wrapper script. Mailscanner handles the opening of archives, so this solution is ideal at the moment.

Fess is very much alpha-quality code, and should not be used on a production server. There are only a few exploit signatures so far; contributions are welcome.

Example signatures:

alert (msg:"PE File with EntryPoint outside of code section"; content:"MZ"; depth:2; byte_jump:4,60; content:"PE"; within:2; byte_save:4,46,BaseOfData,relative; byte_test:4,>,BaseOfData,38,relative; fid:4;)

alert (msg:"SETABORTPROC Escape function in WMF (possible MS06-001 exploit)"; flowbits:isset,wmf; content:"|26|"; content:"|09 00|"; distance:1; within:2; fid:9;)

The Fess signature language is a subset of Snort's, with keywords related to network transport removed. Fess also includes two new keywords, "byte_save" and "loop", in order to allow more accurate parsing of complex file formats. Analysts with experience writing Snort signatures should be able to start writing Fess signatures right away.

The byte_save keyword allows you to snarf a variable from the data for use in a byte_test comparison later on. This allows you to make intelligent decisions about the sanity of a binary file format. For example, byte_save is used in FID 4 in order to test if the EntryPoint value is greater than the BaseofData value in the PE header of a Windows executable (indicating possible presence of an executable packer stub). In our opinion, byte_save would also make a valuable addition to the Snort IDS engine as well.

The loop keyword allows you to intelligently parse a file that is composed of logical chunks with a length header for each chunk, as many image file formats tend to have. Often we may want to look for a value at a certain offset into the chunk header, without running into false positives from the raw data that follows. The loop keyword looks for a pattern one chunk at a time, through the entire file.

License Agreement

Agree and Download Fess
Download Current Fess Ruleset

Please note that SecureWorks cannot provide support for these tools, but feedback is appreciated.

Next Steps

Start With SecureWorks Request More Information Now
Call SecureWorks Call Us Today
877-905-6661

Subscribe to the On the Radar Newsletter