|
| 1 | + |
| 2 | + |
| 3 | +rule malware_unknown_machOdownloader { |
| 4 | + meta: |
| 5 | + description = "Mach-O malware" |
| 6 | + author = "JPCERT/CC Incident Response Group" |
| 7 | + hash = "3266e99f14079b55e428193d5b23aa60862fe784ac8b767c5a1d49dfe80afeeb " |
| 8 | + |
| 9 | + strings: |
| 10 | + $str1 = "DiagPeersHelper" ascii |
| 11 | + $str2 = "DiagnosticsPeer" ascii |
| 12 | + $str3 = "ticsPeer/" ascii |
| 13 | +
|
| 14 | + /* |
| 15 | + 48 B9 3F 72 65 73 70 6F 6E 73 mov rcx, 736E6F707365723Fh |
| 16 | + */ |
| 17 | + $func0 = { 48 B9 3F 72 65 73 70 6F 6E 73 } |
| 18 | +
|
| 19 | + /* |
| 20 | + 48 B8 74 61 72 20 7A 78 76 66 mov rax, 6676787A20726174h |
| 21 | + */ |
| 22 | + $func1 = { 48 B8 74 61 72 20 7A 78 76 66 } |
| 23 | +
|
| 24 | + /* |
| 25 | + E8 60 04 00 00 call _strlen |
| 26 | + C7 84 05 20 E7 FF FF 27 20 2D 43 mov dword ptr [rbp+rax+shellcmd], 432D2027h |
| 27 | + C7 84 05 23 E7 FF FF 43 20 27 00 mov dword ptr [rbp+rax+shellcmd+3], 272043h |
| 28 | + 48 89 DF mov rdi, rbx ; __s1 |
| 29 | + 4C 89 E6 mov rsi, r12 ; __s2 |
| 30 | + E8 33 04 00 00 call _strcat |
| 31 | + 48 89 DF mov rdi, rbx ; __s |
| 32 | + E8 37 04 00 00 call _strlen |
| 33 | + */ |
| 34 | + $func2 = { E8 [4] C7 84 05 [4] 27 20 2D 43 C7 84 05 [4] 43 20 27 00 48 89 DF 4C 89 E6 E8 33 04 00 00 } |
| 35 | +
|
| 36 | + condition: |
| 37 | + (uint32(0) == 0xfeedface or /* 32 bit */ |
| 38 | + uint32(0) == 0xcefaedfe or /* NXSwapInt(MH_MAGIC */ |
| 39 | + uint32(0) == 0xfeedfacf or /* 64 bit */ |
| 40 | + uint32(0) == 0xcffaedfe or /* NXSwapInt(MH_MAGIC_64) */ |
| 41 | + uint32(0) == 0xcafebabe or /* FAT, Java */ |
| 42 | + uint32(0) == 0xbebafeca or /* NXSwapInt(FAT_MAGIC) */ |
| 43 | + uint32(0) == 0xcafebabf or /* FAT 64 bit */ |
| 44 | + uint32(0) == 0xbfbafeca ) /* NXSwapLong(FAT_MAGIC_64) */ |
| 45 | + and (filesize < 10MB) |
| 46 | + and ( ( 2 of ($str*) ) or ( 2 of ($func*) )) |
| 47 | +} |
0 commit comments