import "pe" import "hash" import "math" import "cuckoo" private rule is__elf { meta: author = "@mmorenog,@yararules" strings: $header = { 7F 45 4C 46 } condition: $header at 0 } rule is__Mirai_gen7 { meta: description = "Generic detection for MiraiX version 7" reference = "http://blog.malwaremustdie.org/2016/08/mmd-0056-2016-linuxmirai-just.html" author = "unixfreaxjp" org = "MalwareMustDie" date = "2018-01-05" strings: $st01 = "/bin/busybox rm" ascii wide nocase fullword $st02 = "/bin/busybox echo" ascii wide nocase fullword $st03 = "/bin/busybox wget" ascii wide nocase fullword $st04 = "/bin/busybox tftp" ascii wide nocase fullword $st05 = "/bin/busybox cp" ascii wide nocase fullword $st06 = "/bin/busybox chmod" ascii wide nocase fullword $st07 = "/bin/busybox cat" ascii wide nocase fullword condition: 5 of them } rule LIGHTDART_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "ret.log" ascii wide $s2 = "Microsoft Internet Explorer 6.0" ascii wide $s3 = "szURL Fail" ascii wide $s4 = "szURL Successfully" ascii wide $s5 = "%s&sdate=%04ld-%02ld-%02ld" ascii wide condition: all of them } rule AURIGA_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "superhard corp." ascii wide $s2 = "microsoft corp." ascii wide $s3 = "[Insert]" ascii wide $s4 = "[Delete]" ascii wide $s5 = "[End]" ascii wide $s6 = "!(*@)(!@KEY" ascii wide $s7 = "!(*@)(!@SID=" ascii wide condition: all of them } rule AURIGA_driver_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Services\\riodrv32" ascii wide $s2 = "riodrv32.sys" ascii wide $s3 = "svchost.exe" ascii wide $s4 = "wuauserv.dll" ascii wide $s5 = "arp.exe" ascii wide $pdb = "projects\\auriga" ascii wide condition: all of ($s*) or $pdb } rule BANGAT_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "superhard corp." ascii wide $s2 = "microsoft corp." ascii wide $s3 = "[Insert]" ascii wide $s4 = "[Delete]" ascii wide $s5 = "[End]" ascii wide $s6 = "!(*@)(!@KEY" ascii wide $s7 = "!(*@)(!@SID=" ascii wide $s8 = "end binary output" ascii wide $s9 = "XriteProcessMemory" ascii wide $s10 = "IE:Password-Protected sites" ascii wide $s11 = "pstorec.dll" ascii wide condition: all of them } rule BISCUIT_GREENCAT_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "zxdosml" ascii wide $s2 = "get user name error!" ascii wide $s3 = "get computer name error!" ascii wide $s4 = "----client system info----" ascii wide $s5 = "stfile" ascii wide $s6 = "cmd success!" ascii wide condition: all of them } rule BOUNCER_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "*Qd9kdgba33*%Wkda0Qd3kvn$*&><(*&%$E#%$#1234asdgKNAg@!gy565dtfbasdg" ascii wide $s2 = "IDR_DATA%d" ascii wide $s3 = "asdfqwe123cxz" ascii wide $s4 = "Mode must be 0(encrypt) or 1(decrypt)." ascii wide condition: ($s1 and $s2) or ($s3 and $s4) } rule BOUNCER_DLL_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "new_connection_to_bounce():" ascii wide $s2 = "usage:%s IP port [proxip] [port] [key]" ascii wide condition: all of them } rule CALENDAR_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "content" ascii wide $s2 = "title" ascii wide $s3 = "entry" ascii wide $s4 = "feed" ascii wide $s5 = "DownRun success" ascii wide $s6 = "%s@gmail.com" ascii wide $s7 = "" ascii wide $b8 = "W4qKihsb+So=" ascii wide $b9 = "PoqKigY7ggH+VcnqnTcmhFCo9w==" ascii wide $b10 = "8oqKiqb5880/uJLzAsY=" ascii wide condition: all of ($s*) or all of ($b*) } rule COMBOS_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Mozilla4.0 (compatible; MSIE 7.0; Win32)" ascii wide $s2 = "Mozilla5.1 (compatible; MSIE 8.0; Win32)" ascii wide $s3 = "Delay" ascii wide $s4 = "Getfile" ascii wide $s5 = "Putfile" ascii wide $s6 = "---[ Virtual Shell]---" ascii wide $s7 = "Not Comming From Our Server %s." ascii wide condition: all of them } rule DAIRY_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Mozilla/4.0 (compatible; MSIE 7.0;)" ascii wide $s2 = "KilFail" ascii wide $s3 = "KilSucc" ascii wide $s4 = "pkkill" ascii wide $s5 = "pklist" ascii wide condition: all of them } rule GLOOXMAIL_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Kill process success!" ascii wide $s2 = "Kill process failed!" ascii wide $s3 = "Sleep success!" ascii wide $s4 = "based on gloox" ascii wide $pdb = "glooxtest.pdb" ascii wide condition: all of ($s*) or $pdb } rule GOGGLES_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Kill process success!" ascii wide $s2 = "Kill process failed!" ascii wide $s3 = "Sleep success!" ascii wide $s4 = "based on gloox" ascii wide $pdb = "glooxtest.pdb" ascii wide condition: all of ($s*) or $pdb } rule HACKSFASE1_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = { CB 39 82 49 42 BE 1F 3A } condition: all of them } rule HACKSFASE2_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Send to Server failed." ascii wide $s2 = "HandShake with the server failed. Error:" ascii wide $s3 = "Decryption Failed. Context Expired." ascii wide condition: all of them } rule KURTON_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Mozilla/4.0 (compatible; MSIE8.0; Windows NT 5.1)" ascii wide $s2 = "!(*@)(!@PORT!(*@)(!@URL" ascii wide $s3 = "MyTmpFile.Dat" ascii wide $s4 = "SvcHost.DLL.log" ascii wide condition: all of them } rule LONGRUN_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Mozilla/4.0 (compatible; Windows NT 5.1; MSIE 7.0; Trident/4.0)" ascii wide $s2 = "%s\\%c%c%c%c%c%c%c" ascii wide $s3 = "wait:" ascii wide $s4 = "Dcryption Error! Invalid Character" ascii wide condition: all of them } rule MACROMAIL_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "svcMsn.dll" ascii wide $s2 = "RundllInstall" ascii wide $s3 = "Config service %s ok." ascii wide $s4 = "svchost.exe" ascii wide condition: all of them } rule MANITSME_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Install an Service hosted by SVCHOST." ascii wide $s2 = "The Dll file that to be released." ascii wide $s3 = "SYSTEM\\CurrentControlSet\\Services\\" ascii wide $s4 = "svchost.exe" ascii wide $e1 = "Man,it's me" ascii wide $e2 = "Oh,shit" ascii wide $e3 = "Hallelujah" ascii wide $e4 = "nRet == SOCKET_ERROR" ascii wide $pdb1 = "rouji\\release\\Install.pdb" ascii wide $pdb2 = "rouji\\SvcMain.pdb" ascii wide condition: (all of ($s*)) or (all of ($e*)) or $pdb1 or $pdb2 } rule MINIASP_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "miniasp" ascii wide $s2 = "wakeup=" ascii wide $s3 = "download ok!" ascii wide $s4 = "command is null!" ascii wide $s5 = "device_input.asp?device_t=" ascii wide condition: all of them } rule NEWSREELS_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "Mozilla/4.0 (compatible; Windows NT 5.1; MSIE 7.0)" ascii wide $s2 = "name=%s&userid=%04d&other=%c%s" ascii wide $s3 = "download ok!" ascii wide $s4 = "command is null!" ascii wide $s5 = "noclient" ascii wide $s6 = "wait" ascii wide $s7 = "active" ascii wide $s8 = "hello" ascii wide condition: all of them } rule SEASALT_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98) KSMM" ascii wide $s2 = "upfileok" ascii wide $s3 = "download ok!" ascii wide $s4 = "upfileer" ascii wide $s5 = "fxftest" ascii wide condition: all of them } rule STARSYPOUND_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "*(SY)# cmd" ascii wide $s2 = "send = %d" ascii wide $s3 = "cmd.exe" ascii wide $s4 = "*(SY)#" ascii wide condition: all of them } rule SWORD_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "@***@*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@>>>" ascii wide $s2 = "sleep:" ascii wide $s3 = "down:" ascii wide $s4 = "*========== Bye Bye ! ==========*" ascii wide condition: all of them } rule thequickbrow_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "thequickbrownfxjmpsvalzydg" ascii wide condition: all of them } rule TABMSGSQL_APT1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $s1 = "letusgohtppmmv2.0.0.1" ascii wide $s2 = "Mozilla/4.0 (compatible; )" ascii wide $s3 = "filestoc" ascii wide $s4 = "filectos" ascii wide $s5 = "reshell" ascii wide condition: all of them } rule CCREWBACK1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "postvalue" ascii wide $b = "postdata" ascii wide $c = "postfile" ascii wide $d = "hostname" ascii wide $e = "clientkey" ascii wide $f = "start Cmd Failure!" ascii wide $g = "sleep:" ascii wide $h = "downloadcopy:" ascii wide $i = "download:" ascii wide $j = "geturl:" ascii wide $k = "1.234.1.68" ascii wide condition: 4 of ($a, $b, $c, $d, $e) or $f or 3 of ($g, $h, $i, $j) or $k } rule TrojanCookies_CCREW { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "sleep:" ascii wide $b = "content=" ascii wide $c = "reqpath=" ascii wide $d = "savepath=" ascii wide $e = "command=" ascii wide condition: 4 of ($a, $b, $c, $d, $e) } rule GEN_CCREW1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "W!r@o#n$g" ascii wide $b = "KerNel32.dll" ascii wide condition: any of them } rule Elise { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "SetElise.pdb" ascii wide condition: $a } rule EclipseSunCloudRAT { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "Eclipse_A" ascii wide $b = "\\PJTS\\" ascii wide $c = "Eclipse_Client_B.pdb" ascii wide $d = "XiaoME" ascii wide $e = "SunCloud-Code" ascii wide $f = "/uc_server/data/forum.asp" ascii wide condition: any of them } rule MoonProject { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "Serverfile is smaller than Clientfile" ascii wide $b = "\\M tools\\" ascii wide $c = "MoonDLL" ascii wide $d = "\\M tools\\" ascii wide condition: any of them } rule ccrewDownloader1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = { DD B5 61 F0 20 47 20 57 D6 65 9C CB 31 1B 65 42 } condition: any of them } rule ccrewDownloader2 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "3gZFQOBtY3sifNOl" ascii wide $b = "docbWUWsc2gRMv9HN7TFnvnKcrWUUFdAEem9DkqRALoD" ascii wide $c = "6QVSOZHQPCMc2A8HXdsfuNZcmUnIqWrOIjrjwOeagILnnScxadKEr1H2MZNwSnaJ" ascii wide condition: any of them } rule ccrewMiniasp { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "MiniAsp.pdb" ascii wide $b = "device_t=" ascii wide condition: any of them } rule ccrewSSLBack2 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = { 39 82 49 42 BE 1F 3A } condition: any of them } rule ccrewSSLBack3 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "SLYHKAAY" ascii wide condition: any of them } rule ccrewSSLBack1 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "!@#%$^#@!" ascii wide $b = "64.91.80.6" ascii wide condition: any of them } rule ccrewDownloader3 { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "ejlcmbv" ascii wide $b = "bhxjuisv" ascii wide $c = "yqzgrh" ascii wide $d = "uqusofrp" ascii wide $e = "Ljpltmivvdcbb" ascii wide $f = "frfogjviirr" ascii wide $g = "ximhttoskop" ascii wide condition: 4 of them } rule ccrewQAZ { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "!QAZ@WSX" ascii wide condition: $a } rule metaxcd { meta: author = "AlienVault Labs" info = "CommentCrew-threat-apt1" strings: $a = "\s*\\?"?%s\\(\w+\.\w+)?"\s*2>&1\s*"?/ $ = "IEharden" ascii wide fullword $ = "DEPOff" ascii wide fullword $ = "ShownVerifyBalloon" ascii wide fullword $ = "IEHardenIENoWarn" ascii wide fullword condition: (uint16(0) == 23117 and 5 of them) or (uint16(0) == 23117 and 3 of them and (pe.imports("advapi32.dll", "CryptDecrypt") and pe.imports("advapi32.dll", "CryptEncrypt") and pe.imports("ole32.dll", "CoCreateInstance"))) } rule malware_apt15_royaldll { meta: author = "David Cannings" description = "DLL implant, originally rights.dll and runs as a service" reference = "https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/march/apt15-is-alive-and-strong-an-analysis-of-royalcli-and-royaldns/" sha256 = "bc937f6e958b339f6925023bc2af375d669084e9551fd3753e501ef26e36b39d" strings: $opcodes_jshash = { B8 A7 C6 67 4E 83 C1 02 BA 04 00 00 00 57 90 } $opcodes_encode = { 0F B6 1C 03 8B 55 08 30 1C 17 47 3B 7D 0C } $opcodes_sleep_loop = { 68 ( 88 | B8 ) ( 13 | 0B ) 00 00 FF D6 4F 75 F6 } $ = "Nwsapagent" fullword $ = "\"%s\">>\"%s\"\\s.txt" $ = "myWObject" fullword $ = "del c:\\windows\\temp\\r.exe /f /q" $ = "del c:\\windows\\temp\\r.ini /f /q" condition: 3 of them } rule malware_apt15_royaldll_2 { meta: author = "Ahmed Zaki" sha256 = "bc937f6e958b339f6925023bc2af375d669084e9551fd3753e501ef26e36b39d" description = "DNS backdoor used by APT15" reference = "https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/march/apt15-is-alive-and-strong-an-analysis-of-royalcli-and-royaldns/" strings: $ = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Svchost" ascii wide $ = "netsvcs" ascii wide fullword $ = "%SystemRoot%\\System32\\svchost.exe -k netsvcs" ascii wide fullword $ = "SYSTEM\\CurrentControlSet\\Services\\" ascii wide $ = "myWObject" ascii wide condition: uint16(0) == 23117 and all of them and pe.exports("ServiceMain") and filesize > 51200 and filesize < 614400 } rule malware_apt15_exchange_tool { meta: author = "Ahmed Zaki" md5 = "d21a7e349e796064ce10f2f6ede31c71" description = "This is a an exchange enumeration/hijacking tool used by an APT 15" reference = "https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/march/apt15-is-alive-and-strong-an-analysis-of-royalcli-and-royaldns/" strings: $s1 = "subjectname" fullword $s2 = "sendername" fullword $s3 = "WebCredentials" fullword $s4 = "ExchangeVersion" fullword $s5 = "ExchangeCredentials" fullword $s6 = "slfilename" fullword $s7 = "EnumMail" fullword $s8 = "EnumFolder" fullword $s9 = "set_Credentials" fullword $s10 = "/de" wide $s11 = "/sn" wide $s12 = "/sbn" wide $s13 = "/list" wide $s14 = "/enum" wide $s15 = "/save" wide $s16 = "/ao" wide $s17 = "/sl" wide $s18 = "/v or /t is null" wide $s19 = "2007" wide $s20 = "2010" wide $s21 = "2010sp1" wide $s22 = "2010sp2" wide $s23 = "2013" wide $s24 = "2013sp1" wide condition: uint16(0) == 23117 and 15 of ($s*) } rule malware_apt15_generic { meta: author = "David Cannings" description = "Find generic data potentially relating to AP15 tools" reference = "https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/march/apt15-is-alive-and-strong-an-analysis-of-royalcli-and-royaldns/" strings: $str01 = "myWObject" fullword $str02 = "myRObject" fullword $opcodes01 = { 6A ( 02 | 03 ) 6A 00 6A 00 68 00 00 00 C0 50 FF 15 } condition: 2 of them } rule APT17_Sample_FXSST_DLL { meta: description = "Detects Samples related to APT17 activity - file FXSST.DLL" author = "Florian Roth" reference = "https://goo.gl/ZiJyQv" date = "2015-05-14" hash = "52f1add5ad28dc30f68afda5d41b354533d8bce3" strings: $x1 = "Microsoft? Windows? Operating System" wide fullword $x2 = "fxsst.dll" ascii fullword $y1 = "DllRegisterServer" ascii fullword $y2 = ".cSV" ascii fullword $s1 = "GetLastActivePopup" $s2 = "Sleep" $s3 = "GetModuleFileName" $s4 = "VirtualProtect" $s5 = "HeapAlloc" $s6 = "GetProcessHeap" $s7 = "GetCommandLine" condition: uint16(0) == 23117 and filesize < 819200 and (1 of ($x*) or all of ($y*)) and all of ($s*) } rule GRIZZLY_STEPPE_Malware_1 { meta: description = "Auto-generated rule - file HRDG022184_certclint.dll" author = "Florian Roth" reference = "https://goo.gl/WVflzO" date = "2016-12-29" hash1 = "9f918fb741e951a10e68ce6874b839aef5a26d60486db31e509f8dcaa13acec5" strings: $s1 = "S:\\Lidstone\\renewing\\HA\\disable\\In.pdb" ascii fullword $s2 = "Repeat last find command)Replace specific text with different text" wide fullword $s3 = "l\\Processor(0)\\% Processor Time" wide fullword $s6 = "Self Process" wide fullword $s7 = "Default Process" wide fullword $s8 = "Star Polk.exe" wide fullword condition: (uint16(0) == 23117 and filesize < 307200 and 4 of them) } rule GRIZZLY_STEPPE_Malware_2 { meta: description = "Auto-generated rule - file 9acba7e5f972cdd722541a23ff314ea81ac35d5c0c758eb708fb6e2cc4f598a0" author = "Florian Roth" reference = "https://goo.gl/WVflzO" date = "2016-12-29" hash1 = "9acba7e5f972cdd722541a23ff314ea81ac35d5c0c758eb708fb6e2cc4f598a0" hash2 = "55058d3427ce932d8efcbe54dccf97c9a8d1e85c767814e34f4b2b6a6b305641" strings: $x1 = "GoogleCrashReport.dll" ascii fullword $s1 = "CrashErrors" ascii fullword $s2 = "CrashSend" ascii fullword $s3 = "CrashAddData" ascii fullword $s4 = "CrashCleanup" ascii fullword $s5 = "CrashInit" ascii fullword condition: (uint16(0) == 23117 and filesize < 1024000 and $x1) or (all of them) } rule PAS_TOOL_PHP_WEB_KIT_mod { meta: description = "Detects PAS Tool PHP Web Kit" reference = "https://www.us-cert.gov/security-publications/GRIZZLY-STEPPE-Russian-Malicious-Cyber-Activity" author = "US CERT - modified by Florian Roth due to performance reasons" date = "2016/12/29" strings: $php = " 10240 and filesize < 30720) and #cookie == 2 and #isset == 3 and all of them } rule WebShell_PHP_Web_Kit_v3 { meta: description = "Detects PAS Tool PHP Web Kit" reference = "https://github.com/wordfence/grizzly" author = "Florian Roth" date = "2016/01/01" strings: $php = " 8192 and filesize < 102400 and all of ($s*) } rule WebShell_PHP_Web_Kit_v4 { meta: description = "Detects PAS Tool PHP Web Kit" reference = "https://github.com/wordfence/grizzly" author = "Florian Roth" date = "2016/01/01" strings: $php = " 8192 and filesize < 102400 and 2 of ($s*) } rule APT3102Code { meta: description = "3102 code features" author = "Seth Hardy" last_modified = "2014-06-25" strings: $setupthread = { B9 02 07 00 00 BE ?? ?? ?? ?? 8B F8 6A 00 F3 A5 } condition: any of them } rule APT3102Strings { meta: description = "3102 Identifying Strings" author = "Seth Hardy" last_modified = "2014-06-25" strings: $ = "rundll32_exec.dll\x00Update" condition: any of them } rule APT9002Code { meta: description = "9002 code features" author = "Seth Hardy" last_modified = "2014-06-25" strings: $ = { B9 7A 21 00 00 BE ?? ?? ?? ?? 8B F8 ?? ?? ?? F3 A5 } $ = { 8A 14 3E 8A 1C 01 32 DA 88 1C 01 8B 54 3E 04 40 3B C2 72 EC } condition: any of them } rule APT9002Strings { meta: description = "9002 Identifying Strings" author = "Seth Hardy" last_modified = "2014-06-25" strings: $ = "POST http://%ls:%d/%x HTTP/1.1" $ = "%%TEMP%%\\%s_p.ax" ascii wide $ = "%TEMP%\\uid.ax" ascii wide $ = "%%TEMP%%\\%s.ax" ascii wide $ = "sysinfo\x00sysbin01" $ = "\\FlashUpdate.exe" condition: any of them } rule APT9002 { meta: description = "9002" author = "Seth Hardy" last_modified = "2014-06-25" condition: APT9002Code or APT9002Strings } rule FE_APT_9002 { meta: Author = "FireEye Labs" Date = "2013/11/10" Description = "Strings inside" Reference = "Useful link" strings: $mz = { 4D 5A } $a = "rat_UnInstall" ascii wide condition: ($mz at 0) and $a } rule apt_backspace { meta: description = "Detects APT backspace" author = "Bit Byte Bitten" date = "2015-05-14" hash = "6cbfeb7526de65eb2e3c848acac05da1e885636d17c1c45c62ad37e44cd84f99" strings: $s1 = "!! Use Splice Socket !!" $s2 = "User-Agent: SJZJ (compatible; MSIE 6.0; Win32)" $s3 = "g_nAV=%d,hWnd:0x%X,className:%s,Title:%s,(%d,%d,%d,%d),BOOL=%d" condition: uint16(0) == 23117 and all of them } rule APT_bestia { meta: author = "Adam Ziaja http://adamziaja.com" date = "2014-03-19" description = "Bestia.3.02.012.07 malware used in APT attacks on Polish government" references = "http://zaufanatrzeciastrona.pl/post/ukierunkowany-atak-na-pracownikow-polskich-samorzadow/" hash0 = "9bb03bb5af40d1202378f95a6485fba8" hash1 = "7d9a806e0da0b869b10870dd6c7692c5" maltype = "apt" filetype = "exe" strings: $string0 = "u4(UeK" $string1 = "nMiq/'p" $string2 = "_9pJMf" $string3 = "ICMP.DLL" $string4 = "EG}QAp" $string5 = "tsjWj:U" $string6 = "FileVersion" wide $string7 = "O2nQpp" $string8 = "2}W8we" $string9 = "ILqkC:l" $string10 = "f1yzMk" $string11 = "AutoIt v3 Script: 3, 3, 8, 1" wide $string12 = "wj<1uH" $string13 = "6fL-uD" $string14 = "B9Iavo<" $string15 = "rUS)sO" $string16 = "FJH{_/f" $string17 = "3e 03V" condition: 17 of them } rule BlackEnergy_BE_2 { meta: description = "Detects BlackEnergy 2 Malware" author = "Florian Roth" reference = "http://goo.gl/DThzLz" date = "2015/02/19" hash = "983cfcf3aaaeff1ad82eb70f77088ad6ccedee77" strings: $s0 = " Windows system utility service " ascii fullword $s1 = "WindowsSysUtility - Unicode" wide fullword $s2 = "msiexec.exe" wide fullword $s3 = "WinHelpW" ascii fullword $s4 = "ReadProcessMemory" ascii fullword condition: uint16(0) == 23117 and filesize < 256000 and all of ($s*) } rule BlackEnergy_VBS_Agent { meta: description = "Detects VBS Agent from BlackEnergy Report - file Dropbearrun.vbs" author = "Florian Roth" reference = "http://feedproxy.google.com/~r/eset/blog/~3/BXJbnGSvEFc/" date = "2016-01-03" hash = "b90f268b5e7f70af1687d9825c09df15908ad3a6978b328dc88f96143a64af0f" strings: $s0 = "WshShell.Run \"dropbear.exe -r rsa -d dss -a -p 6789\", 0, false" ascii fullword $s1 = "WshShell.CurrentDirectory = \"C:\\WINDOWS\\TEMP\\Dropbear\\\"" ascii fullword $s2 = "Set WshShell = CreateObject(\"WScript.Shell\")" ascii fullword condition: filesize < 1024 and 2 of them } rule DropBear_SSH_Server { meta: description = "Detects DropBear SSH Server (not a threat but used to maintain access)" author = "Florian Roth" reference = "http://feedproxy.google.com/~r/eset/blog/~3/BXJbnGSvEFc/" date = "2016-01-03" score = 50 hash = "0969daac4adc84ab7b50d4f9ffb16c4e1a07c6dbfc968bd6649497c794a161cd" strings: $s1 = "Dropbear server v%s https://matt.ucc.asn.au/dropbear/dropbear.html" ascii fullword $s2 = "Badly formatted command= authorized_keys option" ascii fullword $s3 = "This Dropbear program does not support '%s' %s algorithm" ascii fullword $s4 = "/etc/dropbear/dropbear_dss_host_key" ascii fullword $s5 = "/etc/dropbear/dropbear_rsa_host_key" ascii fullword condition: uint16(0) == 23117 and filesize < 1024000 and 2 of them } rule BlackEnergy_BackdoorPass_DropBear_SSH { meta: description = "Detects the password of the backdoored DropBear SSH Server - BlackEnergy" author = "Florian Roth" reference = "http://feedproxy.google.com/~r/eset/blog/~3/BXJbnGSvEFc/" date = "2016-01-03" hash = "0969daac4adc84ab7b50d4f9ffb16c4e1a07c6dbfc968bd6649497c794a161cd" strings: $s1 = "passDs5Bu9Te7" ascii fullword condition: uint16(0) == 23117 and $s1 } rule BlackEnergy_KillDisk_1 { meta: description = "Detects KillDisk malware from BlackEnergy" author = "Florian Roth" reference = "http://feedproxy.google.com/~r/eset/blog/~3/BXJbnGSvEFc/" date = "2016-01-03" score = 80 super_rule = 1 hash1 = "11b7b8a7965b52ebb213b023b6772dd2c76c66893fc96a18a9a33c8cf125af80" hash2 = "5d2b1abc7c35de73375dd54a4ec5f0b060ca80a1831dac46ad411b4fe4eac4c6" hash3 = "c7536ab90621311b526aefd56003ef8e1166168f038307ae960346ce8f75203d" hash4 = "f52869474834be5a6b5df7f8f0c46cbc7e9b22fa5cb30bee0f363ec6eb056b95" strings: $s0 = "system32\\cmd.exe" ascii fullword $s1 = "system32\\icacls.exe" wide fullword $s2 = "/c del /F /S /Q %c:\\*.*" ascii fullword $s3 = "shutdown /r /t %d" ascii fullword $s4 = "/C /Q /grant " wide fullword $s5 = "%08X.tmp" ascii fullword $s6 = "/c format %c: /Y /X /FS:NTFS" ascii fullword $s7 = "/c format %c: /Y /Q" ascii fullword $s8 = "taskhost.exe" wide fullword $s9 = "shutdown.exe" wide fullword condition: uint16(0) == 23117 and filesize < 512000 and 8 of them } rule BlackEnergy_KillDisk_2 { meta: description = "Detects KillDisk malware from BlackEnergy" author = "Florian Roth" reference = "http://feedproxy.google.com/~r/eset/blog/~3/BXJbnGSvEFc/" date = "2016-01-03" score = 80 super_rule = 1 hash1 = "11b7b8a7965b52ebb213b023b6772dd2c76c66893fc96a18a9a33c8cf125af80" hash2 = "5d2b1abc7c35de73375dd54a4ec5f0b060ca80a1831dac46ad411b4fe4eac4c6" hash3 = "f52869474834be5a6b5df7f8f0c46cbc7e9b22fa5cb30bee0f363ec6eb056b95" strings: $s0 = "%c:\\~tmp%08X.tmp" ascii fullword $s1 = "%s%08X.tmp" ascii fullword $s2 = ".exe.sys.drv.doc.docx.xls.xlsx.mdb.ppt.pptx.xml.jpg.jpeg.ini.inf.ttf" wide fullword $s3 = "%ls_%ls_%ls_%d.~tmp" wide fullword condition: uint16(0) == 23117 and filesize < 512000 and 3 of them } rule BlackEnergy_Driver_USBMDM { meta: description = "Auto-generated rule - from files 7874a10e551377d50264da5906dc07ec31b173dee18867f88ea556ad70d8f094, b73777469f939c331cbc1c9ad703f973d55851f3ad09282ab5b3546befa5b54a, edb16d3ccd50fc8f0f77d0875bf50a629fa38e5ba1b8eeefd54468df97eba281" author = "Florian Roth" reference = "http://www.welivesecurity.com/2016/01/03/blackenergy-sshbeardoor-details-2015-attacks-ukrainian-news-media-electric-industry/" date = "2016-01-04" super_rule = 1 hash1 = "7874a10e551377d50264da5906dc07ec31b173dee18867f88ea556ad70d8f094" hash2 = "b73777469f939c331cbc1c9ad703f973d55851f3ad09282ab5b3546befa5b54a" hash3 = "edb16d3ccd50fc8f0f77d0875bf50a629fa38e5ba1b8eeefd54468df97eba281" hash4 = "ac13b819379855af80ea3499e7fb645f1c96a4a6709792613917df4276c583fc" hash5 = "7a393b3eadfc8938cbecf84ca630e56e37d8b3d23e084a12ea5a7955642db291" hash6 = "405013e66b6f137f915738e5623228f36c74e362873310c5f2634ca2fda6fbc5" hash7 = "244dd8018177ea5a92c70a7be94334fa457c1aab8a1c1ea51580d7da500c3ad5" hash8 = "edcd1722fdc2c924382903b7e4580f9b77603110e497393c9947d45d311234bf" strings: $s1 = "USB MDM Driver" wide fullword $s2 = "KdDebuggerNotPresent" ascii fullword $s3 = "KdDebuggerEnabled" ascii fullword condition: uint16(0) == 23117 and filesize < 184320 and all of them } rule BlackEnergy_Driver_AMDIDE { meta: description = "Auto-generated rule - from files 32d3121135a835c3347b553b70f3c4c68eef711af02c161f007a9fbaffe7e614, 3432db9cb1fb9daa2f2ac554a0a006be96040d2a7776a072a8db051d064a8be2, 90ba78b6710462c2d97815e8745679942b3b296135490f0095bdc0cd97a34d9c, 97be6b2cec90f655ef11ed9feef5b9ef057fd8db7dd11712ddb3702ed7c7bda1" author = "Florian Roth" reference = "http://www.welivesecurity.com/2016/01/03/blackenergy-sshbeardoor-details-2015-attacks-ukrainian-news-media-electric-industry/" date = "2016-01-04" super_rule = 1 hash1 = "32d3121135a835c3347b553b70f3c4c68eef711af02c161f007a9fbaffe7e614" hash2 = "3432db9cb1fb9daa2f2ac554a0a006be96040d2a7776a072a8db051d064a8be2" hash3 = "90ba78b6710462c2d97815e8745679942b3b296135490f0095bdc0cd97a34d9c" hash4 = "97be6b2cec90f655ef11ed9feef5b9ef057fd8db7dd11712ddb3702ed7c7bda1" hash5 = "5111de45210751c8e40441f16760bf59856ba798ba99e3c9532a104752bf7bcc" hash6 = "cbc4b0aaa30b967a6e29df452c5d7c2a16577cede54d6d705ca1f095bd6d4988" hash7 = "1ce0dfe1a6663756a32c69f7494ad082d293d32fe656d7908fb445283ab5fa68" strings: $s1 = " AMD IDE driver" wide fullword $s2 = "SessionEnv" wide fullword $s3 = "\\DosDevices\\{C9059FFF-1C49-4445-83E8-" wide $s4 = "\\Device\\{C9059FFF-1C49-4445-83E8-" wide condition: uint16(0) == 23117 and filesize < 153600 and all of them } rule Emdivi_SFX { meta: description = "Detects Emdivi malware in SFX Archive" author = "Florian Roth @Cyber0ps" reference = "https://securelist.com/blog/research/71876/new-activity-of-the-blue-termite-apt/" date = "2015-08-20" score = 70 hash1 = "7a3c81b2b3c14b9cd913692347019887b607c54152b348d6d3ccd3ecfd406196" hash2 = "8c3df4e4549db3ce57fc1f7b1b2dfeedb7ba079f654861ca0b608cbfa1df0f6b" strings: $x1 = "Setup=unsecess.exe" ascii fullword $x2 = "Setup=leassnp.exe" ascii fullword $s1 = "&Enter password for the encrypted file:" wide fullword $s2 = ";The comment below contains SFX script commands" ascii fullword $s3 = "Path=%temp%" ascii fullword condition: uint16(0) == 23117 and filesize < 757760 and (1 of ($x*) and all of ($s*)) } rule Emdivi_Gen1 { meta: description = "Detects Emdivi Malware" author = "Florian Roth @Cyber0ps" reference = "https://securelist.com/blog/research/71876/new-activity-of-the-blue-termite-apt/" date = "2015-08-20" score = 80 super_rule = 1 hash1 = "17e646ca2558a65ffe7aa185ba75d5c3a573c041b897355c2721e9a8ca5fee24" hash2 = "3553c136b4eba70eec5d80abe44bd7c7c33ab1b65de617dbb7be5025c9cf01f1" hash3 = "6a331c4e654dd8ddaa2c69d260aa5f4f76f243df8b5019d62d4db5ae5c965662" hash4 = "90d07ea2bb80ed52b007f57d0d9a79430cd50174825c43d5746a16ee4f94ea86" strings: $x1 = "wmic nteventlog where filename=\"SecEvent\" call cleareventlog" wide fullword $s0 = "del %Temp%\\*.exe %Temp%\\*.dll %Temp%\\*.bat %Temp%\\*.ps1 %Temp%\\*.cmd /f /q" wide fullword $x3 = "userControl-v80.exe" ascii fullword $s1 = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727.42)" wide fullword $s2 = "http://www.msftncsi.com" wide fullword $s3 = "net use | find /i \"c$\"" wide fullword $s4 = " /del /y & " wide fullword $s5 = "\\auto.cfg" wide fullword $s6 = "/ncsi.txt" wide fullword $s7 = "Dcmd /c" wide fullword $s8 = "/PROXY" wide fullword condition: uint16(0) == 23117 and filesize < 819200 and all of them } rule Emdivi_Gen2 { meta: description = "Detects Emdivi Malware" author = "Florian Roth @Cyber0ps" reference = "https://securelist.com/blog/research/71876/new-activity-of-the-blue-termite-apt/" date = "2015-08-20" super_rule = 1 score = 80 hash1 = "9a351885bf5f6fec466f30021088504d96e9db10309622ed198184294717add1" hash2 = "a5be7cb1f37030c9f9211c71e0fbe01dae19ff0e6560c5aab393621f18a7d012" hash3 = "9183abb9b639699cd2ad28d375febe1f34c14679b7638d1a79edb49d920524a4" strings: $s1 = "%TEMP%\\IELogs\\" ascii fullword $s2 = "MSPUB.EXE" ascii fullword $s3 = "%temp%\\" ascii fullword $s4 = "\\NOTEPAD.EXE" ascii fullword $s5 = "%4d-%02d-%02d %02d:%02d:%02d " ascii fullword $s6 = "INTERNET_OPEN_TYPE_PRECONFIG" ascii fullword $s7 = "%4d%02d%02d%02d%02d%02d" ascii fullword condition: uint16(0) == 23117 and filesize < 1331200 and 6 of them } rule Emdivi_Gen3 { meta: description = "Detects Emdivi Malware" author = "Florian Roth @Cyber0ps" reference = "https://securelist.com/blog/research/71876/new-activity-of-the-blue-termite-apt/" date = "2015-08-20" super_rule = 1 score = 80 hash1 = "008f4f14cf64dc9d323b6cb5942da4a99979c4c7d750ec1228d8c8285883771e" hash2 = "a94bf485cebeda8e4b74bbe2c0a0567903a13c36b9bf60fab484a9b55207fe0d" strings: $x1 = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727.42)" ascii fullword $s2 = "\\Mozilla\\Firefox\\Profiles\\" ascii fullword $s4 = "\\auto.cfg" ascii fullword $s5 = "/ncsi.txt" ascii fullword $s6 = "/en-us/default.aspx" ascii fullword $s7 = "cmd /c" ascii fullword $s9 = "APPDATA" ascii fullword condition: uint16(0) == 23117 and filesize < 870400 and (($x1 and 1 of ($s*)) or (4 of ($s*))) } rule Emdivi_Gen4 { meta: description = "Detects Emdivi Malware" author = "Florian Roth @Cyber0ps" reference = "https://securelist.com/blog/research/71876/new-activity-of-the-blue-termite-apt/" date = "2015-08-20" super_rule = 1 score = 80 hash1 = "008f4f14cf64dc9d323b6cb5942da4a99979c4c7d750ec1228d8c8285883771e" hash2 = "17e646ca2558a65ffe7aa185ba75d5c3a573c041b897355c2721e9a8ca5fee24" hash3 = "3553c136b4eba70eec5d80abe44bd7c7c33ab1b65de617dbb7be5025c9cf01f1" hash4 = "6a331c4e654dd8ddaa2c69d260aa5f4f76f243df8b5019d62d4db5ae5c965662" hash5 = "90d07ea2bb80ed52b007f57d0d9a79430cd50174825c43d5746a16ee4f94ea86" hash6 = "a94bf485cebeda8e4b74bbe2c0a0567903a13c36b9bf60fab484a9b55207fe0d" strings: $s1 = ".http_port\", " wide fullword $s2 = "UserAgent: " ascii fullword $s3 = "AUTH FAILED" ascii fullword $s4 = "INVALID FILE PATH" ascii fullword $s5 = ".autoconfig_url\", \"" wide fullword $s6 = "FAILED TO WRITE FILE" ascii fullword $s7 = ".proxy" wide fullword $s8 = "AuthType: " ascii fullword $s9 = ".no_proxies_on\", \"" wide fullword condition: uint16(0) == 23117 and filesize < 873472 and all of them } rule apt_c16_win_memory_pcclient { meta: author = "@dragonthreatlab" md5 = "ec532bbe9d0882d403473102e9724557" description = "File matching the md5 above tends to only live in memory, hence the lack of MZ header check." date = "2015/01/11" reference = "http://blog.dragonthreatlabs.com/2015/01/dtl-12012015-01-hong-kong-swc-attack.html" strings: $str1 = "Kill You" ascii $str2 = "%4d-%02d-%02d %02d:%02d:%02d" ascii $str3 = "%4.2f KB" ascii $encodefunc = { 8A 08 32 CA 02 CA 88 08 40 4E 75 F4 } condition: all of them } rule apt_c16_win_disk_pcclient { meta: author = "@dragonthreatlab" md5 = "55f84d88d84c221437cd23cdbc541d2e" description = "Encoded version of pcclient found on disk" date = "2015/01/11" reference = "http://blog.dragonthreatlabs.com/2015/01/dtl-12012015-01-hong-kong-swc-attack.html" strings: $header = { 51 5C 96 06 03 06 06 06 0A 06 06 06 FF FF 06 06 BE 06 06 06 06 06 06 06 46 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 EE 06 06 06 10 1F BC 10 06 BA 0D D1 25 BE 05 52 D1 25 5A 6E 6D 73 26 76 74 6F 67 74 65 71 26 63 65 70 70 6F 7A 26 64 69 26 74 79 70 26 6D 70 26 4A 4F 53 26 71 6F 6A 69 30 11 11 0C 2A 06 06 06 06 06 06 06 73 43 96 1B 37 24 00 4E 37 24 00 4E 37 24 00 4E BA 40 F6 4E 39 24 00 4E 5E 41 FA 4E 33 24 00 4E 5E 41 FC 4E 39 24 00 4E 37 24 FF 4E 0D 24 00 4E FA 31 A3 4E 40 24 00 4E DF 41 F9 4E 36 24 00 4E F6 2A FE 4E 38 24 00 4E DF 41 FC 4E 38 24 00 4E 54 6D 63 6E 37 24 00 4E 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 56 49 06 06 52 05 09 06 5D 87 8C 5A 06 06 06 06 06 06 06 06 E6 06 10 25 0B 05 08 06 06 1C 06 06 06 1A 06 06 06 06 06 06 E5 27 06 06 06 16 06 06 06 36 06 06 06 06 06 16 06 16 06 06 06 04 06 06 0A 06 06 06 06 06 06 06 0A 06 06 06 06 06 06 06 06 76 06 06 06 0A 06 06 06 06 06 06 04 06 06 06 06 06 16 06 06 16 06 06 } condition: $header at 0 } rule apt_c16_win32_dropper { meta: author = "@dragonthreatlab" md5 = "ad17eff26994df824be36db246c8fb6a" description = "APT malware used to drop PcClient RAT" date = "2015/01/11" reference = "http://blog.dragonthreatlabs.com/2015/01/dtl-12012015-01-hong-kong-swc-attack.html" strings: $mz = { 4D 5A } $str1 = "clbcaiq.dll" ascii $str2 = "profapi_104" ascii $str3 = "/ShowWU" ascii $str4 = "Software\\Microsoft\\Windows\\CurrentVersion\\" ascii $str5 = { 8A 08 2A CA 32 CA 88 08 40 4E 75 F4 5E } condition: $mz at 0 and all of ($str*) } rule apt_c16_win_swisyn { meta: author = "@dragonthreatlab" md5 = "a6a18c846e5179259eba9de238f67e41" description = "File matching the md5 above tends to only live in memory, hence the lack of MZ header check." date = "2015/01/11" reference = "http://blog.dragonthreatlabs.com/2015/01/dtl-12012015-01-hong-kong-swc-attack.html" strings: $mz = { 4D 5A } $str1 = "/ShowWU" ascii $str2 = "IsWow64Process" $str3 = "regsvr32 " $str4 = { 8A 11 2A 55 FC 8B 45 08 88 10 8B 4D 08 8A 11 32 55 FC 8B 45 08 88 10 } condition: $mz at 0 and all of ($str*) } rule apt_c16_win_wateringhole { meta: author = "@dragonthreatlab" description = "Detects code from APT wateringhole" date = "2015/01/11" reference = "http://blog.dragonthreatlabs.com/2015/01/dtl-12012015-01-hong-kong-swc-attack.html" strings: $str1 = "function runmumaa()" $str2 = "Invoke-Expression $(New-Object IO.StreamReader ($(New-Object IO.Compression.DeflateStream ($(New-Object IO.MemoryStream (,$([Convert]::FromBase64String(" $str3 = "function MoSaklgEs7(k)" condition: any of ($str*) } rule apt_c16_win64_dropper { meta: author = "@dragonthreatlab" date = "2015/01/11" description = "APT malware used to drop PcClient RAT" reference = "http://blog.dragonthreatlabs.com/2015/01/dtl-12012015-01-hong-kong-swc-attack.html" strings: $mz = { 4D 5A } $str1 = "clbcaiq.dll" ascii $str2 = "profapi_104" ascii $str3 = "\\Microsoft\\wuauclt\\wuauclt.dat" ascii $str4 = { 0F B6 0A 48 FF C2 80 E9 03 80 F1 03 49 FF C8 88 4A FF 75 EC } condition: $mz at 0 and all of ($str*) } rule Carbanak_0915_1 { meta: description = "Carbanak Malware" author = "Florian Roth" reference = "https://www.csis.dk/en/csis/blog/4710/" date = "2015-09-03" score = 70 strings: $s1 = "evict1.pdb" ascii fullword $s2 = "http://testing.corp 0" ascii fullword condition: uint16(0) == 23117 and filesize < 102400 and 1 of them } rule Carbanak_0915_2 { meta: description = "Carbanak Malware" author = "Florian Roth" reference = "https://www.csis.dk/en/csis/blog/4710/" date = "2015-09-03" score = 70 strings: $x1 = "8Rkzy.exe" wide fullword $s1 = "Export Template" wide fullword $s2 = "Session folder with name '%s' already exists." ascii fullword $s3 = "Show Unconnected Endpoints (Ctrl+U)" ascii fullword $s4 = "Close All Documents" wide fullword $s5 = "Add &Resource" ascii fullword $s6 = "PROCEXPLORER" wide fullword $s7 = "AssocQueryKeyA" ascii fullword condition: uint16(0) == 23117 and filesize < 512000 and ($x1 or all of ($s*)) } rule Carbanak_0915_3 { meta: description = "Carbanak Malware" author = "Florian Roth" reference = "https://www.csis.dk/en/csis/blog/4710/" date = "2015-09-03" score = 70 strings: $s1 = "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww" ascii fullword $s2 = "SHInvokePrinterCommandA" ascii fullword $s3 = "Ycwxnkaj" ascii fullword condition: uint16(0) == 23117 and filesize < 716800 and all of them } rule Careto_SGH { meta: author = "AlienVault (Alberto Ortega)" description = "TheMask / Careto SGH component signature" reference = "www.securelist.com/en/downloads/vlpdfs/unveilingthemask_v1.0.pdf" date = "2014/02/11" strings: $m1 = "PGPsdkDriver" ascii wide fullword $m2 = "jpeg1x32" ascii wide fullword $m3 = "SkypeIE6Plugin" ascii wide fullword $m4 = "CDllUninstall" ascii wide fullword condition: 2 of them } rule Careto_OSX_SBD { meta: author = "AlienVault (Alberto Ortega)" description = "TheMask / Careto OSX component signature" reference = "www.securelist.com/en/downloads/vlpdfs/unveilingthemask_v1.0.pdf" date = "2014/02/11" strings: $1 = { FF 16 64 0A 7E 1A 63 4D 21 4D 3E 1E 60 0F 7C 1A 65 0F 74 0B 3E 1C 7F 12 } condition: all of them } rule Careto_CnC { meta: author = "AlienVault (Alberto Ortega)" description = "TheMask / Careto CnC communication signature" reference = "www.securelist.com/en/downloads/vlpdfs/unveilingthemask_v1.0.pdf" date = "2014/02/11" strings: $1 = "cgi-bin/commcgi.cgi" ascii wide $2 = "Group" ascii wide $3 = "Install" ascii wide $4 = "Bn" ascii wide condition: all of them } rule Careto_CnC_domains { meta: author = "AlienVault (Alberto Ortega)" description = "TheMask / Careto known command and control domains" reference = "www.securelist.com/en/downloads/vlpdfs/unveilingthemask_v1.0.pdf" date = "2014/02/11" strings: $1 = "linkconf.net" ascii wide nocase $2 = "redirserver.net" ascii wide nocase $3 = "swupdt.com" ascii wide nocase condition: any of them } rule Casper_Backdoor_x86 { meta: description = "Casper French Espionage Malware - Win32/ProxyBot.B - x86 Payload http://goo.gl/VRJNLo" author = "Florian Roth" reference = "http://goo.gl/VRJNLo" date = "2015/03/05" hash = "f4c39eddef1c7d99283c7303c1835e99d8e498b0" score = 80 strings: $s1 = "\"svchost.exe\"" wide fullword $s2 = "firefox.exe" ascii fullword $s3 = "\"Host Process for Windows Services\"" wide fullword $x1 = "\\Users\\*" ascii fullword $x2 = "\\Roaming\\Mozilla\\Firefox\\Profiles\\*" ascii fullword $x3 = "\\Mozilla\\Firefox\\Profiles\\*" ascii fullword $x4 = "\\Documents and Settings\\*" ascii fullword $y1 = "%s; %S=%S" wide fullword $y2 = "%s; %s=%s" ascii fullword $y3 = "Cookie: %s=%s" ascii fullword $y4 = "http://%S:%d" wide fullword $z1 = "http://google.com/" ascii fullword $z2 = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; MALC)" ascii fullword $z3 = "Operating System\"" wide fullword condition: (all of ($s*)) or (3 of ($x*) and 2 of ($y*) and 2 of ($z*)) } rule Casper_EXE_Dropper { meta: description = "Casper French Espionage Malware - Win32/ProxyBot.B - Dropper http://goo.gl/VRJNLo" author = "Florian Roth" reference = "http://goo.gl/VRJNLo" date = "2015/03/05" hash = "e4cc35792a48123e71a2c7b6aa904006343a157a" score = 80 strings: $s0 = "" ascii fullword $s1 = "" ascii fullword $s2 = "\" /d \"" ascii fullword $s4 = "'%s' %s" ascii fullword $s5 = "nKERNEL32.DLL" wide fullword $s6 = "@ReturnValue" wide fullword $s7 = "ID: 0x%x" ascii fullword $s8 = "Name: %S" ascii fullword condition: 7 of them } rule Casper_Included_Strings { meta: description = "Casper French Espionage Malware - String Match in File - http://goo.gl/VRJNLo" author = "Florian Roth" reference = "http://goo.gl/VRJNLo" date = "2015/03/06" score = 50 strings: $a0 = "cmd.exe /C FOR /L %%i IN (1,1,%d) DO IF EXIST" $a1 = "& SYSTEMINFO) ELSE EXIT" $mz = { 4D 5A } $c1 = "domcommon.exe" wide fullword $c2 = "jpic.gov.sy" fullword $c3 = "aiomgr.exe" wide fullword $c4 = "perfaudio.dat" fullword $c5 = "Casper_DLL.dll" fullword $c6 = { 7B 4B 59 DE 37 4A 42 26 59 98 63 C6 2D 0F 57 40 } $c7 = "{4216567A-4512-9825-7745F856}" fullword condition: all of ($a*) or ($mz at 0) and (1 of ($c*)) } rule Casper_SystemInformation_Output { meta: description = "Casper French Espionage Malware - System Info Output - http://goo.gl/VRJNLo" author = "Florian Roth" reference = "http://goo.gl/VRJNLo" date = "2015/03/06" score = 70 strings: $a0 = "***** SYSTEM INFORMATION ******" $a1 = "***** SECURITY INFORMATION ******" $a2 = "Antivirus: " $a3 = "Firewall: " $a4 = "***** EXECUTION CONTEXT ******" $a5 = "Identity: " $a6 = "" ascii fullword condition: uint16(0) == 23117 and filesize < 921600 and 1 of ($x*) and 2 of ($s*) } rule Codoso_PlugX_1 { meta: description = "Detects Codoso APT PlugX Malware" author = "Florian Roth" reference = "https://www.proofpoint.com/us/exploring-bergard-old-malware-new-tricks" date = "2016-01-30" super_rule = 1 hash1 = "0b8cbc9b4761ab35acce2aa12ba2c0a283afd596b565705514fd802c8b1e144b" hash2 = "448711bd3f689ceebb736d25253233ac244d48cb766834b8f974c2e9d4b462e8" hash3 = "fd22547497ce52049083092429eeff0599d0b11fe61186e91c91e1f76b518fe2" strings: $s1 = "GETPASSWORD1" ascii fullword $s2 = "NvSmartMax.dll" ascii fullword $s3 = "LICENSEDLG" ascii fullword condition: uint16(0) == 23117 and filesize < 819200 and all of them } rule Codoso_PGV_PVID_3 { meta: description = "Detects Codoso APT PGV PVID Malware" author = "Florian Roth" reference = "https://www.proofpoint.com/us/exploring-bergard-old-malware-new-tricks" date = "2016-01-30" super_rule = 1 hash1 = "126fbdcfed1dfb31865d4b18db2fb963f49df838bf66922fea0c37e06666aee1" hash2 = "13bce64b3b5bdfd24dc6f786b5bee08082ea736be6536ef54f9c908fd1d00f75" hash3 = "8a56b476d792983aea0199ee3226f0d04792b70a1c1f05f399cb6e4ce8a38761" hash4 = "b2950f2e09f5356e985c38b284ea52175d21feee12e582d674c0da2233b1feb1" hash5 = "b631553421aa17171cc47248adc110ca2e79eff44b5e5b0234d69b30cab104e3" hash6 = "bc0b885cddf80755c67072c8b5961f7f0adcaeb67a1a5c6b3475614fd51696fe" strings: $x1 = "Copyright (C) Microsoft Corporation. All rights reserved.(C) 2012" wide fullword condition: $x1 } rule Codoso_PGV_PVID_2 { meta: description = "Detects Codoso APT PGV PVID Malware" author = "Florian Roth" reference = "https://www.proofpoint.com/us/exploring-bergard-old-malware-new-tricks" date = "2016-01-30" super_rule = 1 hash1 = "13bce64b3b5bdfd24dc6f786b5bee08082ea736be6536ef54f9c908fd1d00f75" hash2 = "b631553421aa17171cc47248adc110ca2e79eff44b5e5b0234d69b30cab104e3" hash3 = "bc0b885cddf80755c67072c8b5961f7f0adcaeb67a1a5c6b3475614fd51696fe" strings: $s0 = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SvcHost" ascii fullword $s1 = "regsvr32.exe /s \"%s\"" ascii fullword $s2 = "Help and Support" ascii fullword $s3 = "netsvcs" ascii fullword $s9 = "%SystemRoot%\\System32\\svchost.exe -k netsvcs" ascii fullword $s10 = "winlogon" ascii fullword $s11 = "System\\CurrentControlSet\\Services" ascii fullword condition: uint16(0) == 23117 and filesize < 928768 and all of them } rule Codoso_PGV_PVID_1 { meta: description = "Detects Codoso APT PGV PVID Malware" author = "Florian Roth" reference = "https://www.proofpoint.com/us/exploring-bergard-old-malware-new-tricks" date = "2016-01-30" super_rule = 1 hash1 = "41a936b0d1fd90dffb2f6d0bcaf4ad0536f93ca7591f7b75b0cd1af8804d0824" hash2 = "58334eb7fed37e3104d8235d918aa5b7856f33ea52a74cf90a5ef5542a404ac3" hash3 = "934b87ddceabb2063b5e5bc4f964628fe0c63b63bb2346b105ece19915384fc7" hash4 = "ce91ea20aa2e6af79508dd0a40ab0981f463b4d2714de55e66d228c579578266" hash5 = "e770a298ae819bba1c70d0c9a2e02e4680d3cdba22d558d21caaa74e3970adf1" strings: $x1 = "Cookie: pgv_pvid=" ascii $x2 = "DRIVERS\\ipinip.sys" wide fullword $s1 = "TsWorkSpaces.dll" ascii fullword $s2 = "%SystemRoot%\\System32\\wiaservc.dll" wide fullword $s3 = "/selfservice/microsites/search.php?%016I64d" ascii fullword $s4 = "/solutions/company-size/smb/index.htm?%016I64d" ascii fullword $s5 = "Microsoft Chart ActiveX Control" wide fullword $s6 = "MSChartCtrl.ocx" wide fullword $s7 = "{%08X-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}" ascii fullword $s8 = "WUServiceMain" ascii fullword condition: (uint16(0) == 23117 and (1 of ($x*) or 3 of them)) or 5 of them } rule dragos_crashoverride_exporting_dlls { meta: description = "CRASHOVERRIDE v1 Suspicious Export" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" condition: pe.exports("Crash") & pe.characteristics } rule dragos_crashoverride_suspcious { meta: description = "CRASHOVERRIDE v1 Wiper" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" strings: $s0 = "SYS_BASCON.COM" wide nocase fullword $s1 = ".pcmp" wide nocase fullword $s2 = ".pcmi" wide nocase fullword $s3 = ".pcmt" wide nocase fullword $s4 = ".cin" wide nocase fullword condition: pe.exports("Crash") and any of ($s*) } rule dragos_crashoverride_name_search { meta: description = "CRASHOVERRIDE v1 Suspicious Strings and Export" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" strings: $s0 = "101.dll" wide nocase fullword $s1 = "Crash101.dll" wide nocase fullword $s2 = "104.dll" wide nocase fullword $s3 = "Crash104.dll" wide nocase fullword $s4 = "61850.dll" wide nocase fullword $s5 = "Crash61850.dll" wide nocase fullword $s6 = "OPCClientDemo.dll" wide nocase fullword $s7 = "OPC" wide nocase fullword $s8 = "CrashOPCClientDemo.dll" wide nocase fullword $s9 = "D2MultiCommService.exe" wide nocase fullword $s10 = "CrashD2MultiCommService.exe" wide nocase fullword $s11 = "61850.exe" wide nocase fullword $s12 = "OPC.exe" wide nocase fullword $s13 = "haslo.exe" wide nocase fullword $s14 = "haslo.dat" wide nocase fullword condition: any of ($s*) and pe.exports("Crash") } rule dragos_crashoverride_hashes { meta: description = "CRASHOVERRIDE Malware Hashes" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" condition: filesize < 1048576 and hash.sha1(0, filesize) == "f6c21f8189ced6ae150f9ef2e82a3a57843b587d" or hash.sha1(0, filesize) == "cccce62996d578b984984426a024d9b250237533" or hash.sha1(0, filesize) == "8e39eca1e48240c01ee570631ae8f0c9a9637187" or hash.sha1(0, filesize) == "2cb8230281b86fa944d3043ae906016c8b5984d9" or hash.sha1(0, filesize) == "79ca89711cdaedb16b0ccccfdcfbd6aa7e57120a" or hash.sha1(0, filesize) == "94488f214b165512d2fc0438a581f5c9e3bd4d4c" or hash.sha1(0, filesize) == "5a5fafbc3fec8d36fd57b075ebf34119ba3bff04" or hash.sha1(0, filesize) == "b92149f046f00bb69de329b8457d32c24726ee00" or hash.sha1(0, filesize) == "b335163e6eb854df5e08e85026b2c3518891eda8" } rule dragos_crashoverride_moduleStrings { meta: description = "IEC-104 Interaction Module Program Strings" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" strings: $s1 = "IEC-104 client: ip=%s; port=%s; ASDU=%u" ascii wide nocase $s2 = " MSTR ->> SLV" ascii wide nocase $s3 = " MSTR <<- SLV" ascii wide nocase $s4 = "Unknown APDU format !!!" ascii wide nocase $s5 = "iec104.log" ascii wide nocase condition: any of ($s*) } rule dragos_crashoverride_configReader { meta: description = "CRASHOVERRIDE v1 Config File Parsing" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" strings: $s0 = { 68 E8 ?? ?? ?? 6A 00 E8 A3 ?? ?? ?? 8B F8 83 C4 ?8 } $s1 = { 8A 10 3A 11 75 ?? 84 D2 74 12 } $s2 = { 33 C0 EB ?? 1B C0 83 C8 ?? } $s3 = { 85 C0 75 ?? 8D 95 ?? ?? ?? ?? 8B CF ?? ?? } condition: all of them } rule dragos_crashoverride_weirdMutex { meta: description = "Blank mutex creation assoicated with CRASHOVERRIDE" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" strings: $s1 = { 81 EC 08 02 00 00 57 33 FF 57 57 57 FF 15 ?? ?? 40 00 A3 ?? ?? ?? 00 85 C0 } $s2 = { 8D 85 ?? ?? ?? FF 50 57 57 6A 2E 57 FF 15 ?? ?? ?? 00 68 ?? ?? 40 00 } condition: all of them } rule dragos_crashoverride_serviceStomper { meta: description = "Identify service hollowing and persistence setting" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" strings: $s0 = { 33 C9 51 51 51 51 51 51 ?? ?? ?? } $s1 = { 6A FF 6A FF 6A FF 50 FF 15 24 ?? 40 00 FF ?? ?? FF 15 20 ?? 40 00 } condition: all of them } rule dragos_crashoverride_wiperModuleRegistry { meta: description = "Registry Wiper functionality assoicated with CRASHOVERRIDE" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" strings: $s0 = { 8D 85 A0 ?? ?? ?? 46 50 8D 85 A0 ?? ?? ?? 68 68 0D ?? ?? 50 } $s1 = { 6A 02 68 78 0B ?? ?? 6A 02 50 68 B4 0D ?? ?? FF B5 98 ?? ?? ?? FF 15 04 ?? ?? ?? } $s2 = { 68 00 02 00 00 8D 85 A0 ?? ?? ?? 50 56 FF B5 9C ?? ?? ?? FF 15 00 ?? ?? ?? 85 C0 } condition: all of them } rule dragos_crashoverride_wiperFileManipulation { meta: description = "File manipulation actions associated with CRASHOVERRIDE wiper" author = "Dragos Inc" reference = "https://dragos.com/blog/crashoverride/CrashOverride-01.pdf" strings: $s0 = { 6A 00 68 80 00 00 00 6A 03 6A 00 6A 02 8B F9 68 00 00 00 40 57 FF 15 1C ?? ?? ?? 8B D8 } $s2 = { 6A 00 50 57 56 53 FF 15 4C ?? ?? ?? 56 } condition: all of them } rule ROKRAT_loader : TAU DPRK APT { meta: author = "CarbonBlack Threat Research" date = "2018-Jan-11" description = "Designed to catch loader observed used with ROKRAT malware" reference = "https://www.carbonblack.com/2018/02/27/threat-analysis-rokrat-malware/" rule_version = 1 yara_version = "3.7.0" TLP = "White" exemplar_hashes = "e1546323dc746ed2f7a5c973dcecc79b014b68bdd8a6230239283b4f775f4bbd" strings: $n1 = "wscript.exe" $n2 = "cmd.exe" $s1 = "CreateProcess" $s2 = "VirtualAlloc" $s3 = "WriteProcessMemory" $s4 = "CreateRemoteThread" $s5 = "LoadResource" $s6 = "FindResource" $b1 = { 33 C9 33 C0 E8 00 00 00 00 5E } $b2 = /\xB9.{3}\x00\x81\xE9?.{3}\x00/ $b3 = { 03 F1 83 C6 02 } $b4 = { 3E 8A 06 34 90 46 } $b5 = { 3E 30 06 46 49 83 F9 00 75 F6 } $hpt_1 = { 68 EC 97 03 0C } $hpt_2 = { 68 54 CA AF 91 } $hpt_3 = { 68 8E 4E 0E EC } $hpt_4 = { 68 AA FC 0D 7C } $hpt_5 = { 68 1B C6 46 79 } $hpt_6 = { 68 F6 22 B9 7C } $henc_1 = { 7B FF 84 10 1F } $henc_2 = { 7B 47 D9 BC 82 } $henc_3 = { 7B 9D 5D 1D EC } $henc_4 = { 7B B9 EF 1E 6F } $henc_5 = { 7B 08 D5 55 6A } $henc_6 = { 7B E5 31 AA 6F } condition: (1 of ($n*) and 4 of ($s*) and 4 of ($b*)) or all of ($hpt*) or all of ($henc*) } rule ROKRAT_payload : TAU DPRK APT { meta: author = "CarbonBlack Threat Research" date = "2018-Jan-11" description = "Designed to catch loader observed used with ROKRAT malware" reference = "https://www.carbonblack.com/2018/02/27/threat-analysis-rokrat-malware/" rule_version = 1 yara_version = "3.7.0" TLP = "White" exemplar_hashes = "e200517ab9482e787a59e60accc8552bd0c844687cd0cf8ec4238ed2fc2fa573" strings: $s1 = "api.box.com/oauth2/token" wide $s2 = "upload.box.com/api/2.0/files/content" wide $s3 = "api.pcloud.com/uploadfile?path=%s&filename=%s&nopartial=1" wide $s4 = "cloud-api.yandex.net/v1/disk/resources/download?path=%s" wide $s5 = "SbieDll.dll" $s6 = "dbghelp.dll" $s7 = "api_log.dll" $s8 = "dir_watch.dll" $s9 = "def_%s.jpg" wide $s10 = "pho_%s_%d.jpg" wide $s11 = "login=%s&password=%s&login_submit=Authorizing" wide $s12 = "gdiplus.dll" $s13 = "Set-Cookie:\\b*{.+?}\\n" wide $s14 = "charset={[A-Za-z0-9\\-_]+}" wide condition: 12 of ($s*) } rule Anthem_DeepPanda_sl_txt_packed { meta: description = "Anthem Hack Deep Panda - ScanLine sl-txt-packed" author = "Florian Roth" date = "2015/02/08" hash = "ffb1d8ea3039d3d5eb7196d27f5450cac0ea4f34" strings: $s0 = "Command line port scanner" wide fullword $s1 = "sl.exe" wide fullword $s2 = "CPports.txt" ascii fullword $s3 = ",GET / HTTP/.}" ascii fullword $s4 = "Foundstone Inc." wide fullword $s9 = " 2002 Foundstone Inc." wide fullword $s15 = ", Inc. 2002" ascii fullword $s20 = "ICMP Time" ascii fullword condition: all of them } rule Anthem_DeepPanda_lot1 { meta: description = "Anthem Hack Deep Panda - lot1.tmp-pwdump" author = "Florian Roth" date = "2015/02/08" hash = "5d201a0fb0f4a96cefc5f73effb61acff9c818e1" strings: $s0 = "Unable to open target process: %d, pid %d" ascii fullword $s1 = "Couldn't delete target executable from remote machine: %d" ascii fullword $s2 = "Target: Failed to load SAM functions." ascii fullword $s5 = "Error writing the test file %s, skipping this share" ascii fullword $s6 = "Failed to create service (%s/%s), error %d" ascii fullword $s8 = "Service start failed: %d (%s/%s)" ascii fullword $s12 = "PwDump.exe" ascii fullword $s13 = "GetAvailableWriteableShare returned an error of %ld" ascii fullword $s14 = ":\\\\.\\pipe\\%s" ascii fullword $s15 = "Couldn't copy %s to destination %s. (Error %d)" ascii fullword $s16 = "dump logon session" ascii fullword $s17 = "Timed out waiting to get our pipe back" ascii fullword $s19 = "SetNamedPipeHandleState failed, error %d" ascii fullword $s20 = "%s\\%s.exe" ascii fullword condition: 10 of them } rule Anthem_DeepPanda_htran_exe { meta: description = "Anthem Hack Deep Panda - htran-exe" author = "Florian Roth" date = "2015/02/08" hash = "38e21f0b87b3052b536408fdf59185f8b3d210b9" strings: $s0 = "%s -