// Archive Files rule _7zip_file { meta: type = "archive" strings: $a = { 37 7A BC AF 27 1C } condition: $a at 0 } rule arj_file { meta: type = "archive" condition: uint16(0) == 0xEA60 } rule cab_file { meta: type = "archive" strings: $a = { 4D 53 43 46 00 00 00 00 } condition: $a at 0 or ( uint16(0) == 0x5A4D and $a ) } rule cpio_file { meta: type = "archive" strings: $a = { 30 37 30 37 30 31 } condition: $a at 0 } rule iso_file { meta: type = "archive" strings: $a = { 43 44 30 30 31 } condition: $a at 0x8001 and $a at 0x8801 and $a at 0x9001 } rule mhtml_file { meta: type = "archive" strings: $a = "MIME-Version: 1.0" $b = "This document is a Single File Web Page, also known as a Web Archive file" condition: $a at 0 and $b } rule rar_file { meta: type = "archive" condition: uint16(0) == 0x6152 and uint8(2) == 0x72 and uint16(3) == 0x1A21 and uint8(5) == 0x07 } rule tar_file { meta: type = "archive" strings: $a = { 75 73 74 61 72 } condition: uint16(0) == 0x9D1F or uint16(0) == 0xA01F or $a at 257 } rule xar_file { meta: type = "archive" condition: uint32(0) == 0x21726178 } rule zip_file { meta: type = "archive" condition: ( uint32(0) == 0x04034B50 and not uint32(4) == 0x00060014 ) } // Audio Files rule mp3_file { meta: type = "audio" condition: uint16(0) == 0x4449 and uint8(2) == 0x33 } // Certificate Files rule pkcs7_file { meta: type = "certificate" strings: $a = "-----BEGIN PKCS7-----" condition: (uint16(0) == 0x8230 and uint16(4) == 0x0906) or uint32(0) == 0x09068030 or $a at 0 } rule x509_der_file { meta: type = "certificate" condition: uint16(0) == 0x8230 and ( uint16(4) == 0x8230 or uint16(4) == 0x8130 ) } rule x509_pem_file { meta: type = "certificate" strings: $a = "-----BEGIN CERTI" condition: $a at 0 } // Compressed Files rule bzip2_file { meta: type = "compressed" condition: uint16(0) == 0x5A42 and uint8(2) == 0x68 } rule gzip_file { meta: type = "compressed" condition: uint16(0) == 0x8B1F and uint8(2) == 0x08 } rule lzma_file { meta: type = "compressed" condition: uint16(0) == 0x005D and uint8(2) == 0x00 } rule xz_file { meta: type = "compressed" condition: uint32(0) == 0x587A37FD and uint16(4) == 0x005A } // Document Files rule doc_subheader_file { meta: type = "document" condition: uint32(0) == 0x00C1A5EC } rule mso_file { meta: type = "document" strings: $a = { 3C 3F 6D 73 6F 2D 61 70 70 6C 69 63 61 74 69 6F 6E 20 } // condition: $a at 0 or $b at 0 or $c at 0 or $d at 0 or $e at 0 or $f at 0 or $g at 0 or $h at 0 or $i at 0 or $j at 0 or $k at 0 or $l at 0 or $m at 0 or $n at 0 } rule json_file { meta: type = "text" strings: $a = { 7B [0-5] 22 } condition: $a at 0 } rule php_file { meta: type = "text" strings: $a = { 3c 3f 70 68 70 } condition: $a at 0 } rule soap_file { meta: description = "Simple Object Access Protocol" type = "text" strings: $a = { 3C 73 6F 61 70 65 6E 76 3A 45 6E 76 65 6C 6F 70 65 } // $c = { 3C 73 74 79 6C 65 53 68 65 65 74 20 78 6D 6C 6E 73 3D } //