hello, I want to check the attachment in the mail whether have the double file extension,
like jpg.exe pdf.exe …
I wrote rules like below,
alert smtp any any -> any any(msg:"double file extension detected"; fileext:"aaa|2e|exe";classtype:misc-attack;sid:1; rev:1)
alert smtp any any -> any any(msg:"double file extension detected"; fileext:"bbb|2e|exe";classtype:misc-attack;sid:2; rev:1)
alert smtp any any -> any any(msg:"double file extension detected"; fileext:"ccc|2e|exe";classtype:misc-attack;sid:3; rev:1)
Obviously, it’s troublesome.
Is there a easy way to implement it?
alert smtp any any -> any any (msg:"test"; flow:to_client; file.name; content:"|2e|exe"; endswith; fast_pattern; file.name; pcre:"/(aaa|bbb)\.exe$/i"; sid: 42;)