rule ATM_Malware_XFS_DIRECT { meta: description = "Detects ATM Malware XFS_DIRECT" author = "Frank Boldewin (@r3c0nst)" reference = "https://twitter.com/r3c0nst/status/1185237040583106560" date = "2019-10-18" // Encrypted Layer Hashes (SHA256) hash1 = "3e023949fecd5d06b3dff9e86e6fcac6a9ec6c805b93118db43fb4e84fe43ee0" hash2 = "303f2a19b286ca5887df2a334f22b5690dda9f092e677786e2a8879044d8ad11" hash3 = "15d50938e51ee414124314095d3a27aa477f40413f83d6a2b2a2007efc5a623a" hash4 = "0f9cb4dc1ac2777be30145c3271c95a027758203d0de245ec390037f7325d79d" hash5 = "141ae291ddae60fd1b232f543bc9b40f3a083521cd7330c427bb8fc5cdd23966" // Fully Unpacked Hashes (SHA256) hash6 = "66eb1a8134576db05382109eec7e297149f25a021aba5171d2f99aa49c381456" hash7 = "ac20b12beefb2036595780aaf7ec29203e2e09b6237d93cd26eaa811cebd6665" hash8 = "901fc474f50eb62edc526593208a7eec4df694e342ffc5b895d1dcec953c6899" hash9 = "56548c26741b25b15c27a0de498c5e04c69b0c9250ba35e3a578bc2f05eedd07" hash10 = "c89f1d562983398ab2d6dd75e4e30cc0e95eab57cdf48c4a17619dca9ecc0748" strings: // with encryption layer $EncLayer1 = {0F B6 51 FC 30 50 FF 0F B6 11 30 10 0F B6 51 04 30 50 01 0F B6 51 08 30 50 02} $EncLayer2 = {B8 4D 5A 00 00 89 33 66 39 06 75 ?? 8b ?? 3c} // fully unpacked $String1 = "NOW ENTER MASTER KEY" ascii nocase $String2 = "Closing app, than delete myself." ascii nocase $String3 = "Number of phisical cash units is:" ascii nocase $String4 = "COULD NOT ENABLE or DISABLE connection" ascii nocase $String5 = "XFS_DIRECT" ascii nocase $String6 = "Take the money you snicky mother fucker :)" ascii nocase $String7 = "ATM IS TEMPORARILY OUT OF SERVICE!" wide nocase $Code1 = {D1 F8 89 44 24 10 DB 44 24 10 DC 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 35 2F 81 0B 00 A3} // Session Key Code $Code2 = {8B ?? ?? ?? 68 2E 01 00 00 52 C7 ?? 06 01 00 00 00} // Dispense Code condition: uint16(0) == 0x5A4D and (filesize < 1500KB and all of ($EncLayer*)) or (filesize < 300KB and 4 of ($String*) and all of ($Code*)) }