SUSP_RAR_NTFS_ADS
Description
Detects RAR archive with NTFS alternate data stream
Query · yara
strings:
// RAR file format documentation: https://www.rarlab.com/technote.htm
$rar_magic = {52 61 72 21} // RAR magic bytes (will match on any RAR version, we don't restrict on v5 for now, but on offset 0 which does not have to be the case according to the documentation)
$ads = {
03 // Header Type -> Service Header
23 // Header flags
[17-20] // Flags and extra data area
00 // Windows
03 // Length of name = STM = 3
53 54 4d // STM NTFS alternate data stream
[1-2] // variable int (vint) for size of the stream name -> 1-2 bytes should be enough to take into account
07 // Data type = Service data = Service header data array
3a // Start of the ADS name -> start with colon ":"
}
$neg = "Zone.Identifier" // This is the default Windows ADS name, we will get FPs on that, so we don't want that to be the first ADS name we find
condition:
$rar_magic at 0 and $ads and not $neg in (@ads[1]..@ads[1]+15)