Project

General

Profile

Feature #9487

Updated by Jeff Lucovsky about 22 hours ago

Rules that look for Windows executables today chain content, byte_jump and byte_test on file.data to find the PE header and read a field from it, for example: 

 <pre> 
 alert http any any -> any any (msg:"PE download"; flow:established,to_client; file.data; content:"MZ"; startswith; byte_jump:4,58,relative,little; content:"PE|00 00|"; distance:-64; within:4; sid:1;) 
 </pre> 

 These rules are hard to write and read, and they log nothing about the file. 

 Proposed: an exec.windows file keyword that matches valid PE files and filters on header fields (arch, subsystem, characteristics, sections, timestamp and more), the import table (DLL names, num_imports), the export directory, section names and W+X sections, the Authenticode signing certificate (cert_thumbprint, cert_serial, cert_subject, cert_issuer) and the VERSIONINFO resource (file_version, version_info). The exec. prefix leaves room for keywords for other executable formats later. The same metadata is logged as an executable object in fileinfo events and in the files array of alerts. For example: 

 <pre> 
 alert http any any -> any any (msg:"64-bit PE importing ws2_32"; flow:established,to_client; exec.windows: arch x86_64, ws2_32.dll; sid:2;) 
 </pre> 

 PR: https://github.com/OISF/suricata/pull/15133 

Back