Project

General

Profile

Actions

Feature #9487

open
JL JL

detect: exec.windows keyword to match Windows PE files and log their metadata

Feature #9487: detect: exec.windows keyword to match Windows PE files and log their metadata

Added by Jeff Lucovsky about 22 hours ago. Updated about 22 hours ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:

Description

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:

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;)

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:

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;)
Actions

Also available in: PDF Atom