diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6475b15 --- /dev/null +++ b/LICENSE @@ -0,0 +1,17 @@ +# Detection Rule License (DRL) 1.1 + +Permission is hereby granted, free of charge, to any person obtaining a copy of this rule set and associated documentation files (the "Rules"), to deal in the Rules without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Rules, and to permit persons to whom the Rules are furnished to do so, subject to the following conditions: + +If you share the Rules (including in modified form), you must retain the following if it is supplied within the Rules: + +1. identification of the authors(s) ("author" field) of the Rule and any others designated to receive attribution, in any reasonable manner requested by the Rule author (including by pseudonym if designated). + +2. a URI or hyperlink to the Rule set or explicit Rule to the extent reasonably practicable + +3. indicate the Rules are licensed under this Detection Rule License, and include the text of, or the URI or hyperlink to, this Detection Rule License to the extent reasonably practicable + +If you use the Rules (including in modified form) on data, messages based on matches with the Rules must retain the following if it is supplied within the Rules: + +1. identification of the authors(s) ("author" field) of the Rule and any others designated to receive attribution, in any reasonable manner requested by the Rule author (including by pseudonym if designated). + +THE RULES ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE RULES OR THE USE OR OTHER DEALINGS IN THE RULES. \ No newline at end of file diff --git a/yara_rules/apt37_rokrat_macho.yar b/yara_rules/apt37_rokrat_macho.yar new file mode 100644 index 0000000..71f591e --- /dev/null +++ b/yara_rules/apt37_rokrat_macho.yar @@ -0,0 +1,22 @@ +rule apt37_rokrat_macho { + meta: + id = "c54fb9ae-85fa-4c36-bab9-6c6d989262ba" + version = "1.0" + description = "Detects Public key of Macho samples of RokRAT" + author = "Sekoia.io" + creation_date = "2022-09-29" + classification = "TLP:CLEAR" + + strings: + $s1 = { 4D 49 49 42 49 6A 41 4E 42 67 6B 71 68 6B 69 47 39 77 30 42 41 51 45 46 41 41 4F 43 41 51 38 41 4D 49 49 42 43 67 4B 43 41 51 45 41 73 47 52 59 53 45 56 76 77 6D 66 42 46 4E 42 6A 4F 7A 2B 51} + $s2 = {70 61 78 35 72 7A 57 66 2F 4C 54 2F 79 46 55 51 41 31 7A 72 41 31 6E 6A 6A 79 49 48 72 7A 70 68 67 63 39 74 67 47 48 73 2F 37 74 73 57 70 38 65 35 64 4C 6B 41 59 73 56 47 68 57 41 50 73 6A 79} + $s3 = {31 67 78 30 64 72 62 64 4D 6A 6C 54 62 42 59 54 79 45 67 35 50 67 79 2F 35 4D 73 45 4E 44 64 6E 73 43 52 57 72 32 33 5A 61 4F 45 4C 76 48 48 56 56 38 43 4D 43 38 46 75 34 57 62 61 7A 38 30 4C} + $s4 = {47 68 67 38 69 73 56 50 45 48 43 38 48 2F 79 47 74 6A 48 50 59 46 56 65 36 6C 77 56 72 2F 4D 58 6F 4B 63 70 78 31 33 53 31 4B 38 6E 6D 44 51 4E 41 68 4D 70 54 31 61 4C 61 47 2F 36 51 69 6A 68} + $s5 = {57 34 50 2F 52 46 51 71 2B 46 64 69 61 33 66 46 65 68 50 67 35 44 74 59 44 39 30 72 53 33 73 64 46 4B 6D 6A 39 4E 36 4D 4F 30 2F 57 41 56 64 5A 7A 47 75 45 58 44 35 33 4C 48 7A 39 65 5A 77 52} + $s6 = {39 59 38 37 38 36 6E 56 44 72 6C 6D 61 35 59 43 4B 70 71 55 5A 35 63 34 36 77 57 33 67 59 57 69 33 73 59 2B 56 53 33 62 32 46 64 41 4B 43 4A 68 54 66 43 79 38 32 41 55 47 71 50 53 56 66 4C 61} + $s7 = {6D 51 49 44 41 51 41 42} + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_37_chinotto.yar b/yara_rules/apt_37_chinotto.yar new file mode 100644 index 0000000..33ff211 --- /dev/null +++ b/yara_rules/apt_37_chinotto.yar @@ -0,0 +1,51 @@ +rule apt_37_chinotto { + meta: + id = "eff8fd11-dc7a-4011-b083-181d0cca8790" + version = "1.0" + description = "Detects obfuscation and string of APT37 stealer" + author = "Sekoia.io" + creation_date = "2023-02-27" + classification = "TLP:CLEAR" + hash1 = "feab7940559392bbf38f29267509340569160e0a3b257fd86e5c65ae087ea014" + hash2 = "c9d2c8b6011a53e68e4a6c6e51142cef3348951d0b379e49b1a65a1891538df5" + hash3 = "2f5be3773e7e3a2f6806cdef154adfabc454c0e57a49e437c5889ce09b739302" + hash4 = "5bf170c95ca0e2079653d694f783b5bcd38f274ea875f67f0b60db4ac552a66c" + hash5 = "6fad04c836bc923f12ebaec8d8fb0c7091b044bf6f5c97e36d7bf46b8494f978" + hash6 = "64fe964f342acca6d85d247c4f67503e4222a58dfc5c644dedc2006a4b356d39" + hash7 = "6e216b265ea391f71f2a609df995f36b9ba8b17c8859f6d8e4ce4a076d351efd" + hash8 = "70dcc03cde3dd5c5ec6a6a240190cfb51667aaba9c867e20281e8dfc43afa891" + hash9 = "5053390bde150b771f8efe344b692c6c5718ba9203a4b23f5323af1ee9060ff2" + hash10 = "089e4dfd8b25afe596eff05baae86156a4e3243c84faa15416cff31a5120e107" + hash11 = "37e096338a78cb06d6236cb5a04cf125f191871ded3c9421f08a37890a095eb8" + hash12 = "b90a2b0249407b271a5d849fe82cbf4e9a31c2c6259caf515c9be3897e327414" + hash13 = "8f4751ed22619b04009c4b85ec45c8140b570835ca4c638c9e6019e7b7eb66c7" + + strings: + $chunk_1 = { + C7 85 ?? ?? ?? ?? ?? ?? ?? 00 + C7 85 ?? ?? ?? ?? ?? ?? ?? 00 + 33 C0 + EB 03 + 8D 49 00 + 8B 8C 85 ?? ?? ?? ?? + 3B 8C 85 ?? ?? ?? ?? + } + + $chunk_2 = { + C7 84 24 ?? ?? ?? ?? ?? ?? 0? 00 + C7 84 24 ?? ?? ?? ?? ?? ?? 0? 00 + 33 C0 + EB 0D + 8D A4 24 00 00 00 00 + 8D 9B 00 00 00 00 + 8B 8C 84 ?? ?? ?? ?? + 3B 8C 84 ?? ?? ?? ?? + } + + $movs_zip_dir_start = { C7 45 ?? 5A 69 70 20 C7 45 ?? 44 69 72 20 C7 45 ?? 53 74 61 72 C7 45 ?? 74 20 2D 20} + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 1MB and ($chunk_1 or $chunk_2) and $movs_zip_dir_start +} + \ No newline at end of file diff --git a/yara_rules/apt_3cx_payload_stealer.yar b/yara_rules/apt_3cx_payload_stealer.yar new file mode 100644 index 0000000..f76fa94 --- /dev/null +++ b/yara_rules/apt_3cx_payload_stealer.yar @@ -0,0 +1,21 @@ +rule apt_3cx_payload_stealer { + meta: + id = "1ca0605d-101f-4d1d-a476-9dfd93e74b4c" + version = "1.0" + description = "Detects stealer used in 3CX campaign" + author = "Sekoia.io" + creation_date = "2023-03-31" + classification = "TLP:CLEAR" + + strings: + $s1 = "******************************** %s ******************************" wide + $s2 = "\\3CXDesktopApp\\config.json" wide + $s3 = "{\"HostName\": \"%s\", \"DomainName\": \"%s\", \"OsVersion\":" wide + $s4 = "%s.old" wide + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 8MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_agent_racoon_strings.yar b/yara_rules/apt_agent_racoon_strings.yar new file mode 100644 index 0000000..157c479 --- /dev/null +++ b/yara_rules/apt_agent_racoon_strings.yar @@ -0,0 +1,25 @@ +rule apt_agent_racoon_strings { + meta: + id = "ec89f1db-0ba8-48c8-8c1a-c38c410f3e39" + version = "1.0" + description = "Detects Agent Racoon used by CL-STA-0002" + author = "Sekoia.io" + creation_date = "2023-12-05" + classification = "TLP:CLEAR" + + strings: + $ = "Command failed:" wide + $ = "Not uploaded:" wide + $ = "Not downloaded:" wide + $ = "xn--cc" wide + $ = "xn--ac" wide + $ = "xn--bc" wide + $ = "cmd.exe" wide + $ = ".xn--" wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_andariel_dorarat_strings.yar b/yara_rules/apt_andariel_dorarat_strings.yar new file mode 100644 index 0000000..18c1156 --- /dev/null +++ b/yara_rules/apt_andariel_dorarat_strings.yar @@ -0,0 +1,20 @@ +rule apt_andariel_dorarat_strings { + meta: + id = "30388291-a287-489f-a060-c90a16cda217" + version = "1.0" + description = "Detects Dora RAT based on strings" + author = "Sekoia.io" + creation_date = "2024-06-17" + classification = "TLP:CLEAR" + + strings: + $x1 = "/encryption.go" ascii fullword + $x2 = "/handshake.go" ascii fullword + $x3 = "/trans_module.go" ascii fullword + $enc_rsc = { 14 02 72 14 D3 4C 4A 49 55 36 14 DF 8D 6F 2D CF } + + condition: + uint16be(0) == 0x4d5a and + (all of ($x*) or $enc_rsc) +} + \ No newline at end of file diff --git a/yara_rules/apt_andariel_keylogger_strings.yar b/yara_rules/apt_andariel_keylogger_strings.yar new file mode 100644 index 0000000..52c58ea --- /dev/null +++ b/yara_rules/apt_andariel_keylogger_strings.yar @@ -0,0 +1,20 @@ +rule apt_andariel_keylogger_strings { + meta: + id = "59e94bee-9bd4-4f72-9358-858956bb4787" + version = "1.0" + description = "Detects one of the Andariel keylogger" + author = "Sekoia.io" + creation_date = "2024-06-17" + classification = "TLP:CLEAR" + + strings: + $ = "Username:%s [%d/%02d/%02d %02d:%02d]" ascii fullword + $ = "-------[%d/%02d/%02d %02d:%02d]" + $ = "{Insert}" + + condition: + uint16be(0) == 0x4d5a and + filesize < 300KB and + 2 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_andariel_nestdoor_variants_strings.yar b/yara_rules/apt_andariel_nestdoor_variants_strings.yar new file mode 100644 index 0000000..b2ee30a --- /dev/null +++ b/yara_rules/apt_andariel_nestdoor_variants_strings.yar @@ -0,0 +1,22 @@ +rule apt_andariel_nestdoor_variants_strings { + meta: + id = "dcfc48ad-f17b-4224-912b-b01740080fea" + version = "1.0" + description = "Detects Nestdoor based on (weak) strings" + author = "Sekoia.io" + creation_date = "2024-06-17" + classification = "TLP:CLEAR" + + strings: + $v_11 = "Error occurs while reading" wide + $v_12 = "{DECIMAL}" wide + $v_13 = "lnk_" wide + $v_21 = "Cannot connect with your ip and your operating system." wide + $v_22 = "del /q /f %1" ascii + $v_23 = "/f /tn %2" ascii + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + (all of ($v_1*) or all of ($v_2*)) +} + \ No newline at end of file diff --git a/yara_rules/apt_andariel_siennablue.yar b/yara_rules/apt_andariel_siennablue.yar new file mode 100644 index 0000000..fd516ed --- /dev/null +++ b/yara_rules/apt_andariel_siennablue.yar @@ -0,0 +1,21 @@ +rule apt_andariel_siennablue { + meta: + id = "ab3f8b49-0851-47a8-ac77-98d4e26f448e" + version = "1.0" + description = "Detects SiennaBlue based routine names" + author = "Sekoia.io" + creation_date = "2023-11-16" + classification = "TLP:CLEAR" + + strings: + $ = "main_cryptAVPass" + $ = "main_DecryptString" + $ = "main_DisableNetworkDevice" + $ = "main_DeleteSchTask" + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize > 4MB and filesize < 15MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_apt10_hui_loader.yar b/yara_rules/apt_apt10_hui_loader.yar new file mode 100644 index 0000000..6dce310 --- /dev/null +++ b/yara_rules/apt_apt10_hui_loader.yar @@ -0,0 +1,18 @@ +rule apt_apt10_hui_loader { + meta: + id = "97d17052-80d0-4f8e-8b3a-2e0d622522a9" + version = "1.0" + description = "Specific string for HUI Loader" + author = "Sekoia.io" + creation_date = "2022-07-04" + classification = "TLP:CLEAR" + + strings: + $s1 = "HUIHWASDIHWEIUDHDSFSFEFWEFEWFDSGEFERWGWEEFWFWEWD" wide fullword + + condition: + (uint16be(0) == 0x4d5a) + and filesize > 30KB and filesize < 100KB + and 1 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_apt28_document_phishing_webpage.yar b/yara_rules/apt_apt28_document_phishing_webpage.yar new file mode 100644 index 0000000..38bb88f --- /dev/null +++ b/yara_rules/apt_apt28_document_phishing_webpage.yar @@ -0,0 +1,23 @@ +rule apt_apt28_document_phishing_webpage { + meta: + id = "585a8e23-c302-41d3-938f-eda60c82ef28" + version = "1.0" + description = "Detects APT28 document phishing webpage" + author = "Sekoia.io" + creation_date = "2024-04-08" + classification = "TLP:CLEAR" + + strings: + $ = "webhook.site" + $ = "document.createElement('img')" + $ = "brightness(15%) blur(7.0px)" + $ = "This document is not available from mobile devices." + $ = "Capture2.PNG" + $ = ">CLICK TO VIEW DOCUMENT<" + $ = "window.location.href = 's" + $ = ".oast." + + condition: + 4 of them and filesize < 20KB +} + \ No newline at end of file diff --git a/yara_rules/apt_apt28_htmlsmuggling.yar b/yara_rules/apt_apt28_htmlsmuggling.yar new file mode 100644 index 0000000..409ce05 --- /dev/null +++ b/yara_rules/apt_apt28_htmlsmuggling.yar @@ -0,0 +1,18 @@ +rule apt_apt28_htmlsmuggling { + meta: + id = "2e20c992-d971-4c0f-99b3-a7d528c7055a" + version = "1.0" + reference = "https://www.zscaler.com/blogs/security-research/steal-it-campaign" + description = "Detects some kind of HTMLSmuggling used by APT28" + author = "Sekoia.io" + creation_date = "2023-09-11" + classification = "TLP:CLEAR" + + strings: + $s1 = "click();" ascii + $s2 = "window.location.replace(" + + condition: + $s1 in (@s2..@s2-100) +} + \ No newline at end of file diff --git a/yara_rules/apt_apt28_htmlsmuggling_disclosing_ip.yar b/yara_rules/apt_apt28_htmlsmuggling_disclosing_ip.yar new file mode 100644 index 0000000..3cebc88 --- /dev/null +++ b/yara_rules/apt_apt28_htmlsmuggling_disclosing_ip.yar @@ -0,0 +1,19 @@ +rule apt_apt28_htmlsmuggling_disclosing_ip { + meta: + id = "57adc227-2b72-457e-a786-97ca1a7300d8" + version = "1.0" + reference = "https://www.zscaler.com/blogs/security-research/steal-it-campaign" + description = "Detects some kind of HTMLSmuggling used by APT28" + author = "Sekoia.io" + creation_date = "2023-09-11" + classification = "TLP:CLEAR" + + strings: + $s1 = "ipapi.co/json" + $s2 = "a.download(" + $s3 = "a.click(" + + condition: + $s1 and $s2 and $s3 and filesize < 5000 +} + \ No newline at end of file diff --git a/yara_rules/apt_apt28_powershell_ntlm_stealer.yar b/yara_rules/apt_apt28_powershell_ntlm_stealer.yar new file mode 100644 index 0000000..d03fa36 --- /dev/null +++ b/yara_rules/apt_apt28_powershell_ntlm_stealer.yar @@ -0,0 +1,20 @@ +rule apt_apt28_powershell_ntlm_stealer { + meta: + id = "3fb5c472-6b1c-490e-b38f-4d4f1c472f43" + version = "1.0" + description = "Detects the NTLM Stealer used by APT28 against UA energy sector" + author = "Sekoia.io" + creation_date = "2023-09-07" + classification = "TLP:CLEAR" + + strings: + $ = "'NTLM ' = [Convert]::ToBase64String" + $ = ".Prefixes.Add('http://localhost:8080/')" + $ = ".AddHeader('WWW-Authenticate', 'NTLM')" + $ = "GetValues('Authorization');" + $ = "[0] -split '\\s+';" + + condition: + 3 of them and filesize < 4000 +} + \ No newline at end of file diff --git a/yara_rules/apt_apt28_susp_graphite_downloader.yar b/yara_rules/apt_apt28_susp_graphite_downloader.yar new file mode 100644 index 0000000..5952013 --- /dev/null +++ b/yara_rules/apt_apt28_susp_graphite_downloader.yar @@ -0,0 +1,27 @@ +import "pe" + +rule apt_apt28_susp_graphite_downloader { + meta: + id = "9c9da5fe-ffd6-4c45-8ce1-9a6cf4fa2fda" + version = "1.0" + description = "Matches the routine which decrypts the RSA key blob in the Graphite downloader" + author = "Sekoia.io" + creation_date = "2022-01-26" + classification = "TLP:CLEAR" + + strings: + $gen = { 33 D2 + 8B C1 + 6A ?? + 5E + F7 F6 + 8A 82 ?? ?? ?? ?? + 30 81 ?? ?? ?? ?? + 41 + 81 F9 94 04 00 00 + 72 E2 } + + condition: + uint16be(0) == 0x4d5a and $gen and pe.number_of_exports == 1 +} + \ No newline at end of file diff --git a/yara_rules/apt_apt28_ukrnet_phishing_page.yar b/yara_rules/apt_apt28_ukrnet_phishing_page.yar new file mode 100644 index 0000000..84dc547 --- /dev/null +++ b/yara_rules/apt_apt28_ukrnet_phishing_page.yar @@ -0,0 +1,25 @@ +rule apt_apt28_ukrnet_phishing_page { + meta: + id = "053158d8-aac0-486f-8432-834a06f41ed2" + version = "1.0" + description = "Detects APT28 Phishing page" + author = "Sekoia.io" + creation_date = "2024-09-02" + classification = "TLP:CLEAR" + hash = "20dc3a5beb8e3a7801e010b4113efef1" + hash = "5f1462144d7704101cd71c679ea0322b" + + strings: + $ = "baseurl+\"/captcha\"" + $ = "(\"sessionID\", sessionID" + $ = ".responseJSON['origin" + $ = "var baseurl=" + $ = "(req.responseText.includes(" + $ = "else if (req.responseText=='FAIL')" + $ = "|| document.getElementById('confpwd" + $ = "/master/dist/text-security-disc.woff" + + condition: + 4 of them and filesize < 500KB +} + \ No newline at end of file diff --git a/yara_rules/apt_apt28_wayzgoose_exploit_string.yar b/yara_rules/apt_apt28_wayzgoose_exploit_string.yar new file mode 100644 index 0000000..65d9598 --- /dev/null +++ b/yara_rules/apt_apt28_wayzgoose_exploit_string.yar @@ -0,0 +1,21 @@ +rule apt_apt28_wayzgoose_exploit_string { + meta: + id = "23d9e09e-202c-47f5-abf7-6b5085e44400" + version = "1.0" + description = "Detects APT28's Wayzgoose exploit strings" + author = "Sekoia.io" + creation_date = "2024-04-29" + classification = "TLP:CLEAR" + + strings: + $ = "wayzgoose.dll" + $ = "wayzgoose_get_version" + $ = "NtSetInformationFile" + $ = "ZwDuplicateObject" + $ = "ZwClose" + + condition: + uint16be(0) == 0x4d5a and 4 of them + and filesize < 500KB +} + \ No newline at end of file diff --git a/yara_rules/apt_apt29_malicious_rdp_file.yar b/yara_rules/apt_apt29_malicious_rdp_file.yar new file mode 100644 index 0000000..f8723b3 --- /dev/null +++ b/yara_rules/apt_apt29_malicious_rdp_file.yar @@ -0,0 +1,27 @@ +rule apt_apt29_malicious_rdp_file { + meta: + id = "a7b092b5-53a1-4638-a6c1-733d3f063139" + version = "1.0" + description = "Detects malicious RDP files" + author = "Sekoia.io" + creation_date = "2024-10-25" + classification = "TLP:CLEAR" + hash = "db326d934e386059cc56c4e61695128e" + hash = "b38e7e8bba44bc5619b2689024ad9fca" + hash = "f58cf55b944f5942f1d120d95140b800" + hash = "40f957b756096fa6b80f95334ba92034" + + strings: + $ = "RedirectPrinters" wide + $ = "RedirectCOMPorts" wide + $ = "RedirectSmartCards" wide + $ = "RedirectPOSDevices" wide + $ = "RedirectClipboard" wide + $ = "DrivesToRedirect" wide + $ = "full address:s:" wide + + condition: + uint16be(0) == 0xFFFE and + all of them and filesize < 20KB +} + \ No newline at end of file diff --git a/yara_rules/apt_apt29_quarterrig.yar b/yara_rules/apt_apt29_quarterrig.yar new file mode 100644 index 0000000..4636e50 --- /dev/null +++ b/yara_rules/apt_apt29_quarterrig.yar @@ -0,0 +1,19 @@ +rule apt_apt29_quarterrig { + meta: + id = "e370ed7e-5e12-4add-95f3-3773ea8e2d03" + version = "1.0" + description = "Detects QUARTERRIG" + author = "Sekoia.io" + creation_date = "2023-04-19" + classification = "TLP:CLEAR" + + strings: + $str_dll_name = "hijacker.dll" + $str_import_name = "VCRUNTIME140.dll" + $op_resolve_and_call_openthread = { 48 [6] 48 [6] 8B D8 E8 [4] [3] 33 D2 B9 FF FF 1F 00 FF D0 } + $op_resolve_and_call_suspendthread = { E8 [4] 48 8B CB FF D0 83 F8 FF } + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_apt29_wineloader_malicious_hta.yar b/yara_rules/apt_apt29_wineloader_malicious_hta.yar new file mode 100644 index 0000000..233861e --- /dev/null +++ b/yara_rules/apt_apt29_wineloader_malicious_hta.yar @@ -0,0 +1,19 @@ +rule apt_apt29_wineloader_malicious_hta { + meta: + id = "5a17d854-0564-4830-a0e5-7867b99716c2" + version = "1.0" + description = "Detects malicious HTA used by APT29 to drop Wineloader" + author = "Sekoia.io" + creation_date = "2024-03-25" + classification = "TLP:CLEAR" + hash = "efafcd00b9157b4146506bd381326f39" + + strings: + $ = " 400KB and + 4 of ($s*) +} + \ No newline at end of file diff --git a/yara_rules/apt_apt31_rekoobe.yar b/yara_rules/apt_apt31_rekoobe.yar new file mode 100644 index 0000000..1088161 --- /dev/null +++ b/yara_rules/apt_apt31_rekoobe.yar @@ -0,0 +1,16 @@ +import "elf" + +rule apt_apt31_rekoobe { + meta: + id = "b1461a72-76ce-4cc5-ac84-3cc87454d288" + version = "1.0" + description = "Find Rekoobe sample via Trend Elf Hash (telfhash)" + author = "Sekoia.io" + creation_date = "2023-07-10" + classification = "TLP:CLEAR" + + condition: + uint32be(0) == 0x7f454c46 and + filesize < 100KB and elf.telfhash() == "t18fc080c7c6b56a34a7f32538ac7c407982035e1581561b207f50c955d93b408404c5ef" +} + \ No newline at end of file diff --git a/yara_rules/apt_apt33_falsefont.yar b/yara_rules/apt_apt33_falsefont.yar new file mode 100644 index 0000000..1572b58 --- /dev/null +++ b/yara_rules/apt_apt33_falsefont.yar @@ -0,0 +1,39 @@ +rule apt_apt33_falsefont { + meta: + id = "d77c1f5b-9898-456f-954a-ac1f0907a2ba" + version = "1.0" + description = "FalseFont backdoor" + author = "Sekoia.io" + creation_date = "2024-03-25" + classification = "TLP:CLEAR" + + strings: + $s0 = "Agent.Core.WPF" + $s1 = "data2.txt" wide fullword + $s2 = "data.txt" wide fullword + $s3 = "Loginvault.db" wide fullword + $command1 = "ExecUseShell" ascii + $command2 = "ExecAndKeepAlive" ascii + $command3 = "CMD" ascii + $command4 = "PowerShell" ascii + $command5 = "KillByName" ascii + $command6 = "KillById" ascii + $command7 = "Download" ascii + $command8 = "Upload" ascii + $command9 = "Delete" ascii + $command10 = "GetDirectories" ascii + $command11 = "ChangeTime" ascii + $command12 = "SendAllDirectory" ascii + $command13 = "UpadateApplication" ascii + $command14 = "Restart" ascii + $command15 = "GetProcess" ascii + $command16 = "SendAllDirectoryWithStartPath" ascii + $command17 = "GetDir" ascii + $command18 = "GetHard" ascii + $command19 = "GetScreen" ascii + $command20 = "StopSendScreen" ascii + + condition: + uint16be(0) == 0x4d5a and 15 of ($command*) and 3 of ($s*) +} + \ No newline at end of file diff --git a/yara_rules/apt_apt33_tickler.yar b/yara_rules/apt_apt33_tickler.yar new file mode 100644 index 0000000..c35f73b --- /dev/null +++ b/yara_rules/apt_apt33_tickler.yar @@ -0,0 +1,20 @@ +import "hash" +import "pe" + +rule apt_apt33_tickler { + meta: + id = "e9ecf678-350c-47d2-ab4c-522974c70a45" + version = "1.0" + description = "Detects APT33 Tickler malware" + author = "Sekoia.io" + creation_date = "2024-08-29" + classification = "TLP:CLEAR" + hash = "8bd712b0a49f4fecd39d30ebd121832c" + hash = "3f29429fce0168748d7cc75e1478aedc" + + condition: + uint16be(0) == 0x4d5a and + (hash.md5(pe.rich_signature.clear_data) == "2fe65623e6b22577516a4cd051ec3baa" + or pe.imphash() == "a5accd1a0d3eaf2c131bc662dd7ff8ea") +} + \ No newline at end of file diff --git a/yara_rules/apt_apt35_iisraid_strings.yar b/yara_rules/apt_apt35_iisraid_strings.yar new file mode 100644 index 0000000..8305337 --- /dev/null +++ b/yara_rules/apt_apt35_iisraid_strings.yar @@ -0,0 +1,20 @@ +rule apt_apt35_iisraid_strings { + meta: + id = "ee42f406-0c7e-4385-9098-409611dbe0a5" + version = "1.0" + description = "Detects APT35s ISSRaid implant" + author = "Sekoia.io" + creation_date = "2023-05-11" + classification = "TLP:CLEAR" + + strings: + $ = "CHttpModule::" + $ = "X-Forward-Verify" + $ = "X-Beserver-Verify" + + condition: + uint16be(0) == 0x4d5a and + filesize < 500KB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_apt37_chinotto_powershell_variant.yar b/yara_rules/apt_apt37_chinotto_powershell_variant.yar new file mode 100644 index 0000000..bff6e39 --- /dev/null +++ b/yara_rules/apt_apt37_chinotto_powershell_variant.yar @@ -0,0 +1,21 @@ +rule apt_apt37_chinotto_powershell_variant { + meta: + id = "fa42b225-58fe-4e00-b84b-df37491d8fdd" + version = "1.0" + description = "Detects APT37 Chinotto Powershell Variant" + author = "Sekoia.io" + creation_date = "2023-03-06" + classification = "TLP:CLEAR" + + strings: + $ = "$env:COMPUTERNAME + '-' + $env:USERNAME;" ascii wide + $ = "while($true -eq $true)" ascii wide + $ = "Start-Sleep -Seconds" ascii wide + $ = " -ne 'null' -and $" ascii wide + $ = "= 'R=' + [System.Convert]::" ascii wide + $ = "[string]$([char]0x0D) + [string]$([char]0x0A);" ascii wide + + condition: + 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_apt37_malicious_hta_file.yar b/yara_rules/apt_apt37_malicious_hta_file.yar new file mode 100644 index 0000000..920bd21 --- /dev/null +++ b/yara_rules/apt_apt37_malicious_hta_file.yar @@ -0,0 +1,21 @@ +rule apt_apt37_malicious_hta_file { + meta: + id = "22a98c27-8ff4-4760-b505-f8eacf4dabda" + version = "1.0" + description = "Detects malicious APT37 files" + author = "Sekoia.io" + creation_date = "2023-03-06" + classification = "TLP:CLEAR" + + strings: + $s1 = "" nocase + $s2 = " UwB0AGEAcgB0AC0AUwBs" ascii + $s3 = "= new ActiveXObject(" ascii + $s4 = "\", \"\", \"open\", 0);" ascii + $s5 = ".moveTo(" ascii + $s6 = "self.close();" + + condition: + $s1 at 0 and all of them and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/apt_apt41_javascript_dropper.yar b/yara_rules/apt_apt41_javascript_dropper.yar new file mode 100644 index 0000000..255572a --- /dev/null +++ b/yara_rules/apt_apt41_javascript_dropper.yar @@ -0,0 +1,22 @@ +rule apt_apt41_javascript_dropper { + meta: + id = "fde70806-af50-4706-9daf-d39ad0564fc7" + version = "1.0" + description = "Detects Earth Lusca JS dropper" + author = "Sekoia.io" + creation_date = "2024-02-26" + classification = "TLP:CLEAR" + + strings: + $s1 = "eval(function(p, a, c, k, e, r) {" + $s2 = "|4d53" + $s3 = "ActiveXObject" + $x1 = " -F:* %1%" + $x2 = "&I /r c:\\" + $x3 = "ActiveXObject" + + condition: + filesize < 2MB and + (all of ($s*) or all of ($x*)) +} + \ No newline at end of file diff --git a/yara_rules/apt_apt41_keyplug_dropper.yar b/yara_rules/apt_apt41_keyplug_dropper.yar new file mode 100644 index 0000000..b3a31da --- /dev/null +++ b/yara_rules/apt_apt41_keyplug_dropper.yar @@ -0,0 +1,21 @@ +rule apt_apt41_keyplug_dropper { + meta: + id = "b6740371-c4c3-437e-8235-0bd4f7b9c3f5" + version = "1.0" + description = "Detects a dropper used by keyplug" + author = "Sekoia.io" + creation_date = "2024-06-12" + classification = "TLP:CLEAR" + + strings: + $ = "C:\\ProgramData\\pfm.ico" wide + $ = "C:\\\\ProgramData\\\\pfm.ico" wide + $ = "67f8de349abc5ghi" wide + $ = "3abc64597f8diegh" wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 2MB and + any of them +} + \ No newline at end of file diff --git a/yara_rules/apt_apt41_powershell_collection_script.yar b/yara_rules/apt_apt41_powershell_collection_script.yar new file mode 100644 index 0000000..774f783 --- /dev/null +++ b/yara_rules/apt_apt41_powershell_collection_script.yar @@ -0,0 +1,20 @@ +rule apt_apt41_powershell_collection_script { + meta: + id = "55b6cc3e-24b2-4faa-a7fb-b4203a8e6d83" + version = "1.0" + description = "Detects PowerShell collection script" + author = "Sekoia.io" + creation_date = "2023-11-15" + classification = "TLP:CLEAR" + + strings: + $ = "$yestoday.ToString(" ascii wide nocase + $ = "$m.LastAccessTime -" ascii wide nocase + $ = "$fmat=" ascii wide nocase + $ = "$computername" ascii wide nocase + $ = "Rar.exe" ascii wide nocase + + condition: + filesize < 10KB and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_apt41_powershell_exfiltration_script.yar b/yara_rules/apt_apt41_powershell_exfiltration_script.yar new file mode 100644 index 0000000..00f1adc --- /dev/null +++ b/yara_rules/apt_apt41_powershell_exfiltration_script.yar @@ -0,0 +1,19 @@ +rule apt_apt41_powershell_exfiltration_script { + meta: + id = "9a15f845-c0af-4f1c-a033-b4f40232dc0d" + version = "1.0" + description = "Detects PowerShell exfiltration script" + author = "Sekoia.io" + creation_date = "2023-11-15" + classification = "TLP:CLEAR" + + strings: + $ = "$UPLOAD_PASSPORT" ascii wide nocase + $ = "$fileName=$singleFile.Name" ascii wide nocase + $ = "Upload-Passport" ascii wide nocase + $ = "$singleFile in $files" ascii wide nocase + + condition: + filesize < 10KB and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_apt_k_47_orpcbackdoor.yar b/yara_rules/apt_apt_k_47_orpcbackdoor.yar new file mode 100644 index 0000000..46acd46 --- /dev/null +++ b/yara_rules/apt_apt_k_47_orpcbackdoor.yar @@ -0,0 +1,21 @@ +rule apt_apt_k_47_orpcbackdoor { + meta: + id = "9768371d-763f-45df-b727-ccda97501aaa" + version = "1.0" + description = "Detects ORPCBackdoor used by APT-K-47" + author = "Sekoia.io" + creation_date = "2024-02-14" + classification = "TLP:CLEAR" + + strings: + $s1 = "RegisteredOrganization:\t\t\t" ascii wide + $s2 = "To Be Filled By O.E.M" ascii wide + $s3 = ">> " + $s4 = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\%u" wide + $s5 = "Error! GetSystemDirectory failed." + $s6 = "Domain:\t\t\t\t" + + condition: + all of them and filesize < 300KB and uint16be(0) == 0x4d5a +} + \ No newline at end of file diff --git a/yara_rules/apt_apt_k_47_walkershell.yar b/yara_rules/apt_apt_k_47_walkershell.yar new file mode 100644 index 0000000..464128e --- /dev/null +++ b/yara_rules/apt_apt_k_47_walkershell.yar @@ -0,0 +1,21 @@ +rule apt_apt_k_47_walkershell { + meta: + id = "201f8415-32d4-4af1-ba80-734554ced728" + version = "1.0" + description = "Detects WalkerShell used by APT-K-47" + author = "Sekoia.io" + creation_date = "2024-02-14" + classification = "TLP:CLEAR" + + strings: + $s1 = "\\n kuskure" ascii wide + $s2 = "col.log.txt" ascii wide + $s3 = "polor" ascii wide + $s4 = "emit" ascii wide + $s5 = "delta" ascii wide + $s6 = "under process" ascii wide + + condition: + uint16be(0) == 0x4d5a and filesize < 4MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_aptc36_vbs_maldoc.yar b/yara_rules/apt_aptc36_vbs_maldoc.yar new file mode 100644 index 0000000..531c278 --- /dev/null +++ b/yara_rules/apt_aptc36_vbs_maldoc.yar @@ -0,0 +1,24 @@ +rule apt_aptc36_vbs_maldoc { + meta: + id = "f0ca061f-e94b-4f70-bbd1-8a15193652d3" + version = "1.0" + description = "Find VBS file used by the threat actor APT-C-36" + author = "Sekoia.io" + creation_date = "2022-02-16" + classification = "TLP:CLEAR" + + strings: + $dim = "dim " wide ascii + $hea = "::::::::::::::::::::::::::::::::::::::::::::::::" wide ascii + $str0 = "update" wide ascii nocase + $str1 = "On Error Resume Next" wide ascii + $str2 = "CreateObject" wide ascii + $str3 = "WScript" wide ascii + + condition: + #dim > 5 and + #hea > 10 and + 2 of ($str*) and + filesize > 10KB and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/apt_aptc60_downloader_strings.yar b/yara_rules/apt_aptc60_downloader_strings.yar new file mode 100644 index 0000000..aac34ef --- /dev/null +++ b/yara_rules/apt_aptc60_downloader_strings.yar @@ -0,0 +1,21 @@ +rule apt_aptc60_downloader_strings { + meta: + id = "02fd6d5b-7211-46cc-bcff-ab5d78e459c0" + version = "1.0" + description = "Detects a simple downloader abusing wlrmdr.exe and used by APT-C-60" + author = "Sekoia.io" + creation_date = "2024-09-05" + classification = "TLP:CLEAR" + hash = "b14ef85a60ac71c669cc960bdf580144" + + strings: + $ = "mydllmain" fullword + $ = "-s 3600 -f 0 -t _ -m _ -a 11 -u" wide + $ = "WlrMakeService" wide + $ = "Trigger1" wide + + condition: + uint16be(0) == 0x4d5a and all of them + and filesize < 500KB +} + \ No newline at end of file diff --git a/yara_rules/apt_aptk47_asyncshell.yar b/yara_rules/apt_aptk47_asyncshell.yar new file mode 100644 index 0000000..d182e8d --- /dev/null +++ b/yara_rules/apt_aptk47_asyncshell.yar @@ -0,0 +1,25 @@ +rule apt_aptk47_asyncshell { + meta: + id = "2d009cf4-e30e-406d-8860-03b37a396ffa" + version = "1.0" + description = "Detects APT-K-47's Asyncshell" + author = "Sekoia.io" + creation_date = "2024-11-22" + classification = "TLP:CLEAR" + hash = "ce6a589d5e3604112e5595a1f8d53e1e" + hash = "751f427da8e11d8ab394574260735220" + + strings: + $ = "Error executing command:" wide + $ = "Error occurred:" wide + $ = "Attempting to reconnect in {0} seconds..." wide + $ = "Exiting the application." wide + $ = "Server disconnected." wide + $ = "_CorExeMain" + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_aptk47_maliciouslnk.yar b/yara_rules/apt_aptk47_maliciouslnk.yar new file mode 100644 index 0000000..c80af01 --- /dev/null +++ b/yara_rules/apt_aptk47_maliciouslnk.yar @@ -0,0 +1,19 @@ +rule apt_aptk47_maliciouslnk { + meta: + id = "2ccc8777-26fe-4018-9646-4ea91394fe78" + version = "1.0" + description = "Detects APT-K-47 malicious LNK" + author = "Sekoia.io" + creation_date = "2024-11-22" + classification = "TLP:CLEAR" + hash = "6a405d4e88b4acb9706e19a83aad9cf6" + + strings: + $ = "[/c for /f" wide + $ = "2^>nul') do copy" wide + $ = "%F in ('where /r %Temp%" wide + + condition: + uint32be(0) == 0x4c000000 and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_aridviper_rustsysjoker.yar b/yara_rules/apt_aridviper_rustsysjoker.yar new file mode 100644 index 0000000..5372ec5 --- /dev/null +++ b/yara_rules/apt_aridviper_rustsysjoker.yar @@ -0,0 +1,19 @@ +rule apt_aridviper_rustsysjoker { + meta: + id = "14ff3f76-0371-4b45-9864-bf69c74e60aa" + version = "1.0" + description = "Detects Rust Sysjoker variant via PDB path or key and Rust string" + author = "Sekoia.io" + creation_date = "2023-11-27" + classification = "TLP:CLEAR" + + strings: + + $Rust = "called `Option::unwrap()` on a `None` value" + $Key = "QQL8VJUJMABL8H5YNRC9QNEOHA" + $PDB = "C:\\Code\\Rust\\RustDown-Belal\\target\\release\\deps\\RustDown.pdb" + + condition: + uint16be(0) == 0x4d5a and filesize < 1MB and ($PDB or ($Rust and $Key)) +} + \ No newline at end of file diff --git a/yara_rules/apt_backdoordiplomaty_custommerlinagent_strings.yar b/yara_rules/apt_backdoordiplomaty_custommerlinagent_strings.yar new file mode 100644 index 0000000..b893912 --- /dev/null +++ b/yara_rules/apt_backdoordiplomaty_custommerlinagent_strings.yar @@ -0,0 +1,21 @@ +rule apt_backdoordiplomaty_custommerlinagent_strings { + meta: + id = "965693ba-93b8-4c52-9292-957884411968" + version = "1.0" + description = "Detects custom variant of Merlin agent used by BackdoorDiplomaty" + author = "Sekoia.io" + creation_date = "2024-06-06" + classification = "TLP:CLEAR" + + strings: + $ = "agent.GetSpecificID" + $ = "agent.ExecuteCommand" + $ = "agent.getClient" + $ = "agent.SignalListen" + + condition: + uint16be(0) == 0x4d5a and + filesize < 10MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_backdoordiplomaty_phantomnet.yar b/yara_rules/apt_backdoordiplomaty_phantomnet.yar new file mode 100644 index 0000000..77aa001 --- /dev/null +++ b/yara_rules/apt_backdoordiplomaty_phantomnet.yar @@ -0,0 +1,20 @@ +rule apt_backdoordiplomaty_phantomnet { + meta: + id = "bbcc0664-ef2b-47db-a546-b5e0aa2a1e9a" + version = "1.0" + description = "Detects PhantomNet based on strings" + author = "Sekoia.io" + creation_date = "2024-06-06" + classification = "TLP:CLEAR" + + strings: + $ = "memory load plugin failed!" wide + $ = "Event eee!!!" ascii + $ = "LoadWin32_x64.pdb" ascii + + condition: + uint16be(0) == 0x4d5a and + filesize < 2MB and + 2 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_commonmagic_generic_1.yar b/yara_rules/apt_badmagic_commonmagic_generic_1.yar new file mode 100644 index 0000000..d1b57f6 --- /dev/null +++ b/yara_rules/apt_badmagic_commonmagic_generic_1.yar @@ -0,0 +1,21 @@ +rule apt_badmagic_commonmagic_generic_1 { + meta: + id = "0b328771-f674-4606-bb30-d20d07c67832" + version = "1.0" + description = "Detects CommonMagic related implants" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "\\CommonCommand\\Clean\\" + $ = "\\CommonCommand\\Overall\\" + $ = "\\CommonCommand\\Other\\" + $ = "\\CommonCommand\\Other\\*" + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_commonmagic_generic_2.yar b/yara_rules/apt_badmagic_commonmagic_generic_2.yar new file mode 100644 index 0000000..e6ab00d --- /dev/null +++ b/yara_rules/apt_badmagic_commonmagic_generic_2.yar @@ -0,0 +1,21 @@ +rule apt_badmagic_commonmagic_generic_2 { + meta: + id = "c6a16ecc-e00a-4756-b603-f6c85e4f4220" + version = "1.0" + description = "Detects CommonMagic related implants" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "\\CommonCommand\\" ascii wide + $ = "\\\\.\\pipe\\PipeMd" ascii wide fullword + $ = "\\\\.\\pipe\\PipeDtMd" ascii wide fullword + $ = "\\\\.\\pipe\\PipeCrDtMd" ascii wide fullword + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + 2 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_commonmagic_main.yar b/yara_rules/apt_badmagic_commonmagic_main.yar new file mode 100644 index 0000000..a1d2377 --- /dev/null +++ b/yara_rules/apt_badmagic_commonmagic_main.yar @@ -0,0 +1,20 @@ +rule apt_badmagic_commonmagic_main { + meta: + id = "99983df5-89d6-4fac-81e6-16e5ab20bde3" + version = "1.0" + description = "Detects CommonMagic related implants" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "graph.microsoft.com" ascii wide + $ = "children?select=name,size" ascii wide fullword + $ = "\\\\.\\pipe\\PipeCrDtMd" ascii wide fullword + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_commonmagic_screenshot_module.yar b/yara_rules/apt_badmagic_commonmagic_screenshot_module.yar new file mode 100644 index 0000000..e1ed06a --- /dev/null +++ b/yara_rules/apt_badmagic_commonmagic_screenshot_module.yar @@ -0,0 +1,20 @@ +rule apt_badmagic_commonmagic_screenshot_module { + meta: + id = "d1ef0bd1-37dc-405f-b82b-288b1798455c" + version = "1.0" + description = "Detects CommonMagic related implants" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "%s_%02d.%02d.%04d_%02d.%02d.%02d.%03d.%s" wide + $ = "Screenshot" wide + $ = "\\\\.\\pipe\\PipeDtMd" wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_commonmagic_usbstealer.yar b/yara_rules/apt_badmagic_commonmagic_usbstealer.yar new file mode 100644 index 0000000..5791a0a --- /dev/null +++ b/yara_rules/apt_badmagic_commonmagic_usbstealer.yar @@ -0,0 +1,21 @@ +rule apt_badmagic_commonmagic_usbstealer { + meta: + id = "37d5becc-f1c3-4400-bc10-cd6036d4dbb1" + version = "1.0" + description = "Detects CommonMagic related implants" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "\\\\.\\pipe\\PipeDtMd" ascii wide fullword + $ = "State USB" ascii wide + $ = "DefaultNameDevice" ascii wide + $ = "SerialNumber" ascii wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_generic_pshscript.yar b/yara_rules/apt_badmagic_generic_pshscript.yar new file mode 100644 index 0000000..73537cb --- /dev/null +++ b/yara_rules/apt_badmagic_generic_pshscript.yar @@ -0,0 +1,17 @@ +rule apt_badmagic_generic_pshscript { + meta: + id = "82cda554-3c2b-4c04-b9f9-b5ba50c53271" + version = "1.0" + description = "Detects BadMagic generic powershell script (Possible FPs)" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "$ExecutablePath" + $ = "Start-Sleep -Second 2" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_installpzz_pshscript.yar b/yara_rules/apt_badmagic_installpzz_pshscript.yar new file mode 100644 index 0000000..e5485ce --- /dev/null +++ b/yara_rules/apt_badmagic_installpzz_pshscript.yar @@ -0,0 +1,19 @@ +rule apt_badmagic_installpzz_pshscript { + meta: + id = "d01bc217-9e14-498b-a92a-17f6aedec269" + version = "1.0" + description = "Detects BadMagic InstallPZZ powershell script" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "start-job -ScriptBlock $script;" + $ = "Start-Sleep -Second 1;" + $ = "Write-Output \"$url$j" + $ = "Start-Sleep -Second 2;" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_ld_dll_loader_pshscript.yar b/yara_rules/apt_badmagic_ld_dll_loader_pshscript.yar new file mode 100644 index 0000000..bdd798c --- /dev/null +++ b/yara_rules/apt_badmagic_ld_dll_loader_pshscript.yar @@ -0,0 +1,19 @@ +rule apt_badmagic_ld_dll_loader_pshscript { + meta: + id = "d4a23afc-693f-4fab-b2c4-15eecba047f7" + version = "1.0" + description = "Detects BadMagic DLL Loader powershell script" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "$ModulePath = \"$folder_path\\$name" + $ = "$ModuleExport =" + $ = "start-job -ScriptBlock $ScriptBlock" + $ = "Invoke-WebRequest -Uri" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_listfiles_pshscript.yar b/yara_rules/apt_badmagic_listfiles_pshscript.yar new file mode 100644 index 0000000..ac61297 --- /dev/null +++ b/yara_rules/apt_badmagic_listfiles_pshscript.yar @@ -0,0 +1,17 @@ +rule apt_badmagic_listfiles_pshscript { + meta: + id = "55f1c409-234e-4feb-91a3-9bf5c41ec2b8" + version = "1.0" + description = "Detects BadMagic ListFiles powershell script" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "$env:USERPROFILE" + $ = "-Include *.jpg, *.odt, *.doc, *.docx" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_malicious_lnk.yar b/yara_rules/apt_badmagic_malicious_lnk.yar new file mode 100644 index 0000000..c49ee0d --- /dev/null +++ b/yara_rules/apt_badmagic_malicious_lnk.yar @@ -0,0 +1,20 @@ +rule apt_badmagic_malicious_lnk { + meta: + id = "731bd51d-c4e4-4efb-9fa8-f981a8555ed3" + version = "1.0" + description = "Detect LNK used by BadMagic to execute MSI payloads." + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "/i http" wide + $ = ".msi /quiet" wide + $ = "%WINDIR%\\System32\\msiexec.exe" + + condition: + uint32be(0) == 0x4c000000 and + filesize < 1KB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_modules.yar b/yara_rules/apt_badmagic_modules.yar new file mode 100644 index 0000000..eab30a6 --- /dev/null +++ b/yara_rules/apt_badmagic_modules.yar @@ -0,0 +1,21 @@ +import "pe" + +rule apt_badmagic_modules { + meta: + id = "e4f1f706-4a46-4a09-b598-e4e8d80f2c4b" + version = "1.0" + description = "Detect the modules used by the CloudWizard framework" + author = "Sekoia.io" + creation_date = "2023-05-25" + classification = "TLP:CLEAR" + hash = "no hash has been found on 2023-05-25 to test the rule" + + condition: + pe.DLL and + pe.exports("Start") and + pe.exports("Stop") and + pe.exports("Whoami") and + pe.exports("GetResult") and + pe.exports("GetSettings") +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_reco_pshscript.yar b/yara_rules/apt_badmagic_reco_pshscript.yar new file mode 100644 index 0000000..5c03fa8 --- /dev/null +++ b/yara_rules/apt_badmagic_reco_pshscript.yar @@ -0,0 +1,19 @@ +rule apt_badmagic_reco_pshscript { + meta: + id = "7a1b2d31-03b7-4a43-8f4e-ed38ba8e118e" + version = "1.0" + description = "Detects BadMagic Reco powershell script" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "$headers = @{};" + $ = "==ARP Cache==" + $ = "ipconfig.me" + $ = "-ComputerName $env:computername;" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_startngrok_pshscript.yar b/yara_rules/apt_badmagic_startngrok_pshscript.yar new file mode 100644 index 0000000..dcd36ea --- /dev/null +++ b/yara_rules/apt_badmagic_startngrok_pshscript.yar @@ -0,0 +1,20 @@ +rule apt_badmagic_startngrok_pshscript { + meta: + id = "94d64482-3033-4531-8530-58546364ac06" + version = "1.0" + description = "Detects BadMagic StartNgrok powershell script" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "$ExecutablePath http \"\"file:///$Disk" + $ = "write \"$ExecutablePath not found" + $ = "$ng_proxy_string =" + $ = "$ng_auth_token =" + $ = "$env:ALLUSERSPROFILE\\$NGrokFolderName" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_badmagic_startrevsocks_pshscript.yar b/yara_rules/apt_badmagic_startrevsocks_pshscript.yar new file mode 100644 index 0000000..206472a --- /dev/null +++ b/yara_rules/apt_badmagic_startrevsocks_pshscript.yar @@ -0,0 +1,18 @@ +rule apt_badmagic_startrevsocks_pshscript { + meta: + id = "a6c96aee-9e78-47d2-afe3-f3c5246a9370" + version = "1.0" + description = "Detects BadMagic DLL Loader powershell script" + author = "Sekoia.io" + creation_date = "2023-05-15" + classification = "TLP:CLEAR" + + strings: + $ = "$ExecutablePath" + $ = "Start-Sleep -Second 2" + $ = "recn -15 -rect 15" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_blackwood_nspx30_plugin.yar b/yara_rules/apt_blackwood_nspx30_plugin.yar new file mode 100644 index 0000000..7cbd429 --- /dev/null +++ b/yara_rules/apt_blackwood_nspx30_plugin.yar @@ -0,0 +1,18 @@ +rule apt_blackwood_nspx30_plugin { + meta: + id = "ef8e0d51-c78c-426b-8008-910e27546f23" + version = "1.0" + description = "Detects plugins of NSPX30 backdoor based on RTTI and rundll32 string" + author = "Sekoia.io" + creation_date = "2024-01-29" + classification = "TLP:CLEAR" + + strings: + $s1 = {2E 3F 41 56 43 43 61 62 69 6E 65 74 40 40} + $s2 = {2E 3F 41 56 43 45 6E 63 6F 64 65 72 40 40} + $s3 = "rundll32.exe \"%hs\",#1" wide + + condition: + uint16be(0) == 0x4d5a and filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_boldmove_strings.yar b/yara_rules/apt_boldmove_strings.yar new file mode 100644 index 0000000..a22d1ff --- /dev/null +++ b/yara_rules/apt_boldmove_strings.yar @@ -0,0 +1,21 @@ +rule apt_boldmove_strings { + meta: + id = "0458e282-f92f-4600-964a-de6b66b4a82d" + version = "1.0" + description = "Detects BOLDMOVE via strings" + author = "Sekoia.io" + creation_date = "2023-01-16" + classification = "TLP:CLEAR" + + strings: + $s1 = "cwd=%s" ascii wide + $s2 = "executable=%s" ascii wide + $s3 = "curl/6.12.34" ascii wide + $s4 = "www.example.com" ascii wide + $s5 = "GET /ws HTTP/1.1" ascii wide + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 4MB and 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_buhtrap_maldocx.yar b/yara_rules/apt_buhtrap_maldocx.yar new file mode 100644 index 0000000..c879321 --- /dev/null +++ b/yara_rules/apt_buhtrap_maldocx.yar @@ -0,0 +1,26 @@ +rule apt_buhtrap_maldocx { + meta: + id = "4aaba2f1-fafd-4e3f-8b18-7beda11464d1" + version = "1.0" + description = "Detect the malicious DOCX used by Buhtrap" + author = "Sekoia.io" + creation_date = "2022-02-25" + classification = "TLP:CLEAR" + + strings: + $ = " 50KB and + 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_gamaredon_gammaload_maliciouslnk.yar b/yara_rules/apt_gamaredon_gammaload_maliciouslnk.yar new file mode 100644 index 0000000..26eb660 --- /dev/null +++ b/yara_rules/apt_gamaredon_gammaload_maliciouslnk.yar @@ -0,0 +1,19 @@ +rule apt_gamaredon_gammaload_maliciouslnk { + meta: + id = "2612e6c6-0bda-4bfa-a840-aa0a0b4c945b" + version = "1.0" + description = "Detects Gamaredon's GammaLoad LNK" + author = "Sekoia.io" + creation_date = "2022-08-01" + classification = "TLP:CLEAR" + + strings: + $mshta = "System32\\mshta.exe" + $trait = { 0D 0A ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 0D 0A } + + condition: + uint32be(0) == 0x4c000000 and + #trait > 100 and $mshta and + filesize > 100KB and filesize < 300KB +} + \ No newline at end of file diff --git a/yara_rules/apt_gamaredon_getlogicaldrive_hunting.yar b/yara_rules/apt_gamaredon_getlogicaldrive_hunting.yar new file mode 100644 index 0000000..632a1d2 --- /dev/null +++ b/yara_rules/apt_gamaredon_getlogicaldrive_hunting.yar @@ -0,0 +1,21 @@ +rule apt_gamaredon_getlogicaldrive_hunting { + meta: + id = "18958ee8-7eb8-43b5-8ad2-be93bb39aa80" + version = "1.0" + description = "Detects gamaredon powershell stuff" + author = "Sekoia.io" + creation_date = "2023-02-08" + classification = "TLP:CLEAR" + + strings: + $ = "VolumeSerialNumber" ascii wide nocase + $ = "Get-WmiObject" ascii wide nocase + $ = "]::ToUInt32(" ascii wide nocase + $ = "DeviceID" ascii wide nocase + $ = "UploadValues" ascii wide nocase + $ = "UploadString" ascii wide nocase + + condition: + 5 of them and filesize < 500KB +} + \ No newline at end of file diff --git a/yara_rules/apt_gamaredon_htmlsmuggling_2024.yar b/yara_rules/apt_gamaredon_htmlsmuggling_2024.yar new file mode 100644 index 0000000..4a32446 --- /dev/null +++ b/yara_rules/apt_gamaredon_htmlsmuggling_2024.yar @@ -0,0 +1,24 @@ +rule apt_gamaredon_htmlsmuggling_2024 { + meta: + id = "8fa1f80b-2261-4d63-92d8-7c360be73fe2" + version = "1.0" + description = "Detects HTML Smuggling webpages of Gamaredon used in 2024" + author = "Sekoia.io" + creation_date = "2024-09-09" + classification = "TLP:CLEAR" + hash = "ab2807824e68d5efb4c896e1af82e693" + hash = "926b7e65d0d61cd6ba9e085193ae8b1d" + + strings: + $ = "').innerHTML;window['" ascii fullword + $ = "='at'+'ob';" + $ = "]('*','');" + $ = "display:none" + $ = "0px;\" onerror=\"" + $ = "'ev'+'" + $ = "\";" + + condition: + all of them and filesize < 3000 +} + \ No newline at end of file diff --git a/yara_rules/apt_gamaredon_stealer_obfuscation_1.yar b/yara_rules/apt_gamaredon_stealer_obfuscation_1.yar new file mode 100644 index 0000000..3d583ca --- /dev/null +++ b/yara_rules/apt_gamaredon_stealer_obfuscation_1.yar @@ -0,0 +1,19 @@ +rule apt_gamaredon_stealer_obfuscation_1 { + meta: + id = "a6197d16-8ed1-410b-8814-d7eff9a8096c" + version = "1.0" + description = "Matches the Gamaredon Stealer obfuscation" + author = "Sekoia.io" + creation_date = "2022-02-04" + classification = "TLP:CLEAR" + + strings: + $s1 = { 76 61 72 20 [5-30] 3d 20 6e 65 77 20 6f 62 6a 65 63 74 5b 5d 20 7b 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 20 7d 3b } + $s2 = { 66 6f 72 28 69 6e 74 20 [5-30] 20 3d 20 30 3b 20 [5-30] 20 3c 20 31 30 3b 20 [5-30] 2b 2b 29 } + + condition: + uint16be(0) == 0x4d5a and + filesize > 100MB and + (#s1 > 100 or #s2 > 100) +} + \ No newline at end of file diff --git a/yara_rules/apt_gamaredon_stealer_obfuscation_2.yar b/yara_rules/apt_gamaredon_stealer_obfuscation_2.yar new file mode 100644 index 0000000..1130a92 --- /dev/null +++ b/yara_rules/apt_gamaredon_stealer_obfuscation_2.yar @@ -0,0 +1,18 @@ +rule apt_gamaredon_stealer_obfuscation_2 { + meta: + id = "fd278a90-537b-4c67-9421-01c9f2416b60" + version = "1.0" + description = "Matches the Gamaredon Stealer obfuscation" + author = "Sekoia.io" + creation_date = "2022-02-04" + classification = "TLP:CLEAR" + + strings: + $s1 = { 3d 20 6e 65 77 20 73 74 72 69 6e 67 5b 5d 20 7b 20 [50-200] 20 7d 3b } + + condition: + uint16be(0) == 0x4d5a and + filesize > 100MB and + #s1 > 40 +} + \ No newline at end of file diff --git a/yara_rules/apt_gamaredon_subtle_paws.yar b/yara_rules/apt_gamaredon_subtle_paws.yar new file mode 100644 index 0000000..1bc16f0 --- /dev/null +++ b/yara_rules/apt_gamaredon_subtle_paws.yar @@ -0,0 +1,19 @@ +rule apt_gamaredon_subtle_paws { + meta: + id = "1950f886-97d2-4aa1-8f13-2947eba706e4" + version = "1.0" + description = "SUBTLE-PAWS powershell backdoor used by Gamaredon" + author = "Sekoia.io" + creation_date = "2024-02-09" + classification = "TLP:CLEAR" + + strings: + $s1 = "$splitter" ascii wide + $s2 = "[System.Convert]::FromBase64String" ascii wide + $s3 = "$_;$var2 =\"var1\";$var3" ascii wide + $s4 = "foreach-object{$_|powershell -noprofile -}" ascii wide + + condition: + $s1 and $s2 and ($s3 or $s4) and filesize < 100KB +} + \ No newline at end of file diff --git a/yara_rules/apt_gamaredon_vbs_downloader.yar b/yara_rules/apt_gamaredon_vbs_downloader.yar new file mode 100644 index 0000000..d2658a3 --- /dev/null +++ b/yara_rules/apt_gamaredon_vbs_downloader.yar @@ -0,0 +1,24 @@ +rule apt_gamaredon_vbs_downloader { + meta: + id = "13b63570-2f18-4b35-8087-9ab15c58a0d1" + version = "1.0" + description = "Detects small VBS loader" + author = "Sekoia.io" + creation_date = "2023-02-08" + classification = "TLP:CLEAR" + + strings: + $s1 = "on error resume next" nocase ascii wide + $s2 = "String('http" nocase ascii wide + $s3 = "send()" nocase ascii wide + $s4 = ")|Invoke-Expression" nocase ascii wide + $s5 = "'); Invoke-Expression $" nocase ascii wide + $s6 = "');Invoke-Expression $" nocase ascii wide + + condition: + $s1 and + ($s2 or $s3) and + ($s4 or $s5 or $s6) and + filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_gelsemium_firewood_backdoor.yar b/yara_rules/apt_gelsemium_firewood_backdoor.yar new file mode 100644 index 0000000..09b967a --- /dev/null +++ b/yara_rules/apt_gelsemium_firewood_backdoor.yar @@ -0,0 +1,22 @@ +rule apt_gelsemium_firewood_backdoor { + meta: + id = "93670c07-9edd-4ea2-b8ed-6fee625491f4" + version = "1.0" + description = "Detects Gelsemium's FireWood backdoor" + author = "Sekoia.io" + creation_date = "2024-11-22" + classification = "TLP:CLEAR" + hash = "2251bc7910fe46fd0baf8bc05599bdcf" + + strings: + $ = "root dir:%s" + $ = "df -h|grep 'dev' |grep -v none|awk '/dev/{print $6}'" + $ = "rm -rf ../lib/%s" + $ = "Total Disk space:%luG, Free Disk spae:%luG" + + condition: + uint32be(0) == 0x7f454c46 and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_gelsemium_wolfsbane_backdoor.yar b/yara_rules/apt_gelsemium_wolfsbane_backdoor.yar new file mode 100644 index 0000000..44b6515 --- /dev/null +++ b/yara_rules/apt_gelsemium_wolfsbane_backdoor.yar @@ -0,0 +1,25 @@ +rule apt_gelsemium_wolfsbane_backdoor { + meta: + id = "db2ad5a4-b592-4646-a385-c668bb2ea090" + version = "1.0" + description = "Detects Gelsemium's WolfsBane backdoor" + author = "Sekoia.io" + creation_date = "2024-11-22" + classification = "TLP:CLEAR" + hash = "1418fe9a743226b9661a2b6decb19db0" + + strings: + $ = "udp_session" + $ = "session_interface" + $ = "plugin_persist" + $ = "Udp.cpp" + $ = "ikcp.c" + $ = "' %s 2>/dev/null" + + condition: + uint32be(0) == 0x7f454c46 and + filesize > 3MB and + filesize < 4MB and + 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_gelsemium_wolfsbane_launcher.yar b/yara_rules/apt_gelsemium_wolfsbane_launcher.yar new file mode 100644 index 0000000..8930faf --- /dev/null +++ b/yara_rules/apt_gelsemium_wolfsbane_launcher.yar @@ -0,0 +1,22 @@ +rule apt_gelsemium_wolfsbane_launcher { + meta: + id = "26fbf4df-aa08-47b6-a73c-e8f80a408454" + version = "1.0" + description = "Detects Gelsemium's WolfsBane launcher" + author = "Sekoia.io" + creation_date = "2024-11-22" + classification = "TLP:CLEAR" + hash = "87e437cf74ce4b1330b8af9ff71edae2" + + strings: + $ = "rm -f /dev/shm/sem*%s" + $ = "/etc/ld.so.preload" + $ = "kill -9 %d 2>/dev/null" + $ = "/,1d' %s 2>/dev/null" + + condition: + uint32be(0) == 0x7F454C46 and + filesize < 500KB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_gelsemium_wolfsbane_rootkit.yar b/yara_rules/apt_gelsemium_wolfsbane_rootkit.yar new file mode 100644 index 0000000..816a3cb --- /dev/null +++ b/yara_rules/apt_gelsemium_wolfsbane_rootkit.yar @@ -0,0 +1,25 @@ +rule apt_gelsemium_wolfsbane_rootkit { + meta: + id = "e93f4515-62f5-4057-a464-aae11cbe0639" + version = "1.0" + description = "Detects Gelsemium's WolfsBane rootkit" + author = "Sekoia.io" + creation_date = "2024-11-22" + classification = "TLP:CLEAR" + hash = "ba08e63ad65a9bdcdb1655f25d32c808" + + strings: + $ = "__non_hooked_symbols" + $ = "__hidden_literals" + $ = "extract_type_2_socket_inode2" + $ = "/proc/%s/fd" + $ = "pluginkey" wide + $ = "mainpath" wide + $ = "hiderpath" wide + + condition: + uint32be(0) == 0x7f454c46 and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_globalshadow.yar b/yara_rules/apt_globalshadow.yar new file mode 100644 index 0000000..ac51fd6 --- /dev/null +++ b/yara_rules/apt_globalshadow.yar @@ -0,0 +1,29 @@ +rule apt_globalshadow { + meta: + id = "2fef6192-25a6-4d6a-8e19-53ad51617d90" + version = "1.0" + description = "Detects the GLOBALSHADOW malware" + author = "Sekoia.io" + creation_date = "2024-09-04" + classification = "TLP:CLEAR" + hash = "68c16b6f178c88c12c9555169887c321" + + strings: + $command1 = "time to rest" wide + $command2 = "pw" wide + $command3 = "pr" wide + $command4 = "dnld" wide + $step1 = "step1-" wide + $step2 = "step2-" wide + $step3 = "step3-" wide + $step4 = "step4-" wide + $step5 = "step5-" wide + $step6 = "step6-" wide + $delim = "]#@#[" wide + + condition: + uint16be(0) == 0x4d5a and + 2 of ($command*) and 3 of ($step*) and $delim and + true +} + \ No newline at end of file diff --git a/yara_rules/apt_gobrat_2.yar b/yara_rules/apt_gobrat_2.yar new file mode 100644 index 0000000..a1c294f --- /dev/null +++ b/yara_rules/apt_gobrat_2.yar @@ -0,0 +1,17 @@ +rule apt_gobrat_2 { + meta: + id = "6b7e38f5-00bc-49c8-b34d-3e878bf426d8" + version = "1.0" + description = "Detects GobRat related files" + author = "Sekoia.io" + creation_date = "2024-09-10" + classification = "TLP:CLEAR" + + strings: + $ = "thisisweird" ascii + $ = "ZzZzZzZzZzZz" + + condition: + all of them and uint32be(0) == 0x7f454c46 +} + \ No newline at end of file diff --git a/yara_rules/apt_granitetyphoon_pingpulllinux_strings.yar b/yara_rules/apt_granitetyphoon_pingpulllinux_strings.yar new file mode 100644 index 0000000..6ee6b6b --- /dev/null +++ b/yara_rules/apt_granitetyphoon_pingpulllinux_strings.yar @@ -0,0 +1,26 @@ +rule apt_granitetyphoon_pingpulllinux_strings { + meta: + id = "ee213206-d9ad-47fa-bea1-61a9d2cfba58" + version = "1.0" + description = "Detects PingPull Linux variant" + author = "Sekoia.io" + creation_date = "2023-05-25" + classification = "TLP:CLEAR" + + strings: + $ = "chkconfig --add %s" + $ = "chkconfig %s on" + $ = "update-rc.d %s enable" + $ = "service %s start" + $ = "respawn limit 10 10" + $ = "POST /%s HTTP/1.1" + $ = "PROJECT_%s_%s_%08X" + $ = "Description=The HTTP(S) Client" + $ = "exec %s -f" + + condition: + uint32be(0) == 0x7f454c46 and + filesize < 11MB and + 7 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_granitetyphoon_sword2023_strings.yar b/yara_rules/apt_granitetyphoon_sword2023_strings.yar new file mode 100644 index 0000000..ee613d4 --- /dev/null +++ b/yara_rules/apt_granitetyphoon_sword2023_strings.yar @@ -0,0 +1,22 @@ +rule apt_granitetyphoon_sword2023_strings { + meta: + id = "417b355f-9eb8-40ae-bc3b-f7f23b5ca63e" + version = "1.0" + description = "Detects Sword2023 malware based on strings" + author = "Sekoia.io" + creation_date = "2023-05-25" + classification = "TLP:CLEAR" + + strings: + $ = "TERM=linux" + $ = ";echo" + $ = "sh:time out" + $ = "sh:read stdout error" + $ = "/proc/sys/kernel/random/uuid" + + condition: + (uint32be(0) == 0x7f454c46) and + filesize < 100KB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_icepeony_icecache.yar b/yara_rules/apt_icepeony_icecache.yar new file mode 100644 index 0000000..65b3f3f --- /dev/null +++ b/yara_rules/apt_icepeony_icecache.yar @@ -0,0 +1,47 @@ +rule apt_icepeony_icecache { + meta: + id = "3135c70e-c925-4d26-beed-09424fc0c153" + version = "1.0" + description = "Detects IceCache backdoor" + author = "Sekoia.io" + creation_date = "2024-10-21" + classification = "TLP:CLEAR" + hash = "38708c33dafb5625ddde1030a7efa7db" + hash = "1e102c8909b2bf71c626b81f7526ee01" + hash = "34bc3c586a48f836b00aff59fe891b30" + hash = "cd906f4cef84dddeb644b06777474b2e" + hash = "add23fedfbf238f51173796f3feb12af" + hash = "25b8daaa5e9c5f8820261d7ebf79f3cd" + hash = "7fd45cc1de1230c916d5f547a9fc725c" + hash = "e6e4060e838d7af5f13ad64258d5db0c" + hash = "87dfc911885420380bea0cf74c8160d3" + hash = "bd15103b300cad635191972330913d17" + hash = "a8119b7803a6e0b8aed6bc74d9062b7f" + hash = "e1bc3efc33b57c9e1e6d37e5011228f2" + hash = "e1233a5f613aafec2c28133e810f536d" + hash = "fe88a5b91841b25b4bafa08d42faab22" + + strings: + $ = "Source Response Empty!" + $ = "Source Response Len:" + $ = "GetFromSource:" + $ = "Failed add header!" + $ = "Failed receive response:" + $ = "Error: Status Code :" + $ = "WinHttpAddRequestHeaders" + $ = "X-FORWARDED-HOST:" + $ = "PROXY_DEL_CONTENT" + $ = "PROXY_CLEAR_CONTENT" + $ = "PROXY_SET_JS" + $ = "PROXY_GET_JS" + $ = "PROXY_ALLOW_PC" + $ = "Parse IP failed :" + $ = "Clear Proxy Contents Success!" + $ = "FILE_UPLOAD" + $ = "FILE_DOWNLOAD" + + condition: + uint16be(0) == 0x4d5a and filesize < 1MB and + 6 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_icepeony_iceevent.yar b/yara_rules/apt_icepeony_iceevent.yar new file mode 100644 index 0000000..995cded --- /dev/null +++ b/yara_rules/apt_icepeony_iceevent.yar @@ -0,0 +1,25 @@ +rule apt_icepeony_iceevent { + meta: + id = "7d1f8b90-fde4-4d5c-a8a3-375db8aa88a1" + version = "1.0" + description = "Detects IceEvent Backdoor" + author = "Sekoia.io" + creation_date = "2024-10-21" + classification = "TLP:CLEAR" + hash = "07c291c9cea4430676c303128bbbb8e3" + hash = "489b573b37ab8bc74cca3704e723b895" + hash = "265f6cf778d26e62903fb295f89507e3" + hash = "f5eb28dd29c91cc84818b74d7f138ff6" + + strings: + $ = "Created a process" ascii fullword + $ = "CreateProcess failed: %d" + $ = "bind error:" + $ = "Error creating pip: %d" + $ = "listen error:" + + condition: + uint16be(0) == 0x4d5a and + 4 of them and filesize < 500KB +} + \ No newline at end of file diff --git a/yara_rules/apt_implant_xdealer_linux_variant_strings.yar b/yara_rules/apt_implant_xdealer_linux_variant_strings.yar new file mode 100644 index 0000000..ada9c8b --- /dev/null +++ b/yara_rules/apt_implant_xdealer_linux_variant_strings.yar @@ -0,0 +1,22 @@ +rule apt_implant_xdealer_linux_variant_strings { + meta: + id = "42690513-753f-4296-b641-4d3b59a5e5e1" + version = "1.0" + description = "Detects XDealer linux variant" + author = "Sekoia.io" + creation_date = "2024-03-22" + classification = "TLP:CLEAR" + + strings: + $ = "ls -l /proc/%s/exe" + $ = "Linux_%s_%s_%u" + $ = "chkconfig --add" + $ = "cmd over return [%s]" + $ = "touch -d" + $ = "%s can't be opened/n" + $ = "/proc/%s/status" + + condition: + uint32be(0) == 0x7f454c46 and 3 of them and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/apt_implant_xdealer_stealer_strings.yar b/yara_rules/apt_implant_xdealer_stealer_strings.yar new file mode 100644 index 0000000..bfd4fa9 --- /dev/null +++ b/yara_rules/apt_implant_xdealer_stealer_strings.yar @@ -0,0 +1,21 @@ +rule apt_implant_xdealer_stealer_strings { + meta: + id = "6314cf6c-2c3b-4e9a-87a1-b56ee148474c" + version = "1.0" + description = "Detects stealer module of XDealer" + author = "Sekoia.io" + creation_date = "2024-03-22" + classification = "TLP:CLEAR" + + strings: + $ = "%sbmp.tmp" + $ = "%sjgp.tmp" + $ = "%sma_%s_%05u_%u." + $ = "%s%s_%05u_%u." + + condition: + uint16be(0) == 0x4d5a and + filesize < 500KB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_implant_xdealer_strings.yar b/yara_rules/apt_implant_xdealer_strings.yar new file mode 100644 index 0000000..d9fabf0 --- /dev/null +++ b/yara_rules/apt_implant_xdealer_strings.yar @@ -0,0 +1,21 @@ +rule apt_implant_xdealer_strings { + meta: + id = "06ef72ca-b4e3-493b-8e01-d34b98259c6d" + version = "1.0" + description = "Detects XDealer based on strings" + author = "Sekoia.io" + creation_date = "2024-03-22" + classification = "TLP:CLEAR" + + strings: + $ = "unknow_PC" + $ = "rdp-tcp#" + $ = "Din_%s_%s_%u_" + $ = "nslookup %s %s" + $ = "XFByb2dyYW1EYXRhXA==" + + condition: + uint16be(0) == 0x4d5a and + 3 of them and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/apt_implant_xdealer_vbs_launcher_strings.yar b/yara_rules/apt_implant_xdealer_vbs_launcher_strings.yar new file mode 100644 index 0000000..aaa7663 --- /dev/null +++ b/yara_rules/apt_implant_xdealer_vbs_launcher_strings.yar @@ -0,0 +1,18 @@ +rule apt_implant_xdealer_vbs_launcher_strings { + meta: + id = "ebfc8a33-70dc-44d5-bc4a-07afc56f8254" + version = "1.0" + description = "Detects XDealer VBS Launcher" + author = "Sekoia.io" + creation_date = "2024-03-22" + classification = "TLP:CLEAR" + + strings: + $s1 = "Dim objws" + $s2 = "Set objws=" + $s3 = "objws.Run \"\"\"C:\\ProgramData\\" + + condition: + $s1 at 0 and all of them and filesize < 200 +} + \ No newline at end of file diff --git a/yara_rules/apt_ir_sugarush_implant.yar b/yara_rules/apt_ir_sugarush_implant.yar new file mode 100644 index 0000000..aeea587 --- /dev/null +++ b/yara_rules/apt_ir_sugarush_implant.yar @@ -0,0 +1,22 @@ +rule apt_ir_sugarush_implant { + meta: + id = "bcf057cc-272c-4cb6-bb76-928788675282" + version = "1.0" + description = "Detects the SUGARUSH implant" + author = "Sekoia.io" + creation_date = "2022-08-23" + classification = "TLP:CLEAR" + + strings: + $ = "You are offline at " wide + $ = "\\Logs\\ServiceLog_" wide + $ = "Service is recall at" wide + $ = "add_OutputDataReceived" ascii + $ = "get_CurrentDomain" ascii + + condition: + uint16be(0) == 0x4d5a and + filesize < 100KB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_ivanti_krustyloader.yar b/yara_rules/apt_ivanti_krustyloader.yar new file mode 100644 index 0000000..d03e5b3 --- /dev/null +++ b/yara_rules/apt_ivanti_krustyloader.yar @@ -0,0 +1,29 @@ +rule apt_ivanti_krustyloader { + meta: + id = "617fdd5f-7555-49e8-b0ec-2199f017dc40" + version = "1.0" + description = "Detects KrustyLoader used in the Ivanti campaign" + author = "Sekoia.io" + creation_date = "2024-01-29" + classification = "TLP:CLEAR" + + strings: + $s1 = "/proc/self/exe" ascii fullword + $s2 = "||||||||||||||" + $s3 = "/tmp/" + $xor = {40 80 f5} + $chunk_1 = { + 66 0F EF D0 + 66 0F 6F C3 + 66 0F 73 F8 0C + 66 0F EF C1 + 66 0F EF C2 + 66 0F EF C3 + } // used for crypto but not specific to Krustyloader + + condition: + uint32be(0) == 0x7f454c46 and filesize < 2MB and all of them + and #xor > 2 and #chunk_1 > 6 + and @s3 < @s2 and @s2 < @s3+300 //$s2 is less than 300 bytes after $s3 +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_fpspy.yar b/yara_rules/apt_kimsuky_fpspy.yar new file mode 100644 index 0000000..ed7ef11 --- /dev/null +++ b/yara_rules/apt_kimsuky_fpspy.yar @@ -0,0 +1,23 @@ +rule apt_kimsuky_fpspy { + meta: + id = "75d41851-a7a6-4068-8ea5-6a3e6e62a965" + version = "1.0" + description = "Detects FPSpy, a backdoor used by Kimsuky" + author = "Sekoia.io" + creation_date = "2024-09-27" + classification = "TLP:CLEAR" + hash = "6d6c1b175e435f5564341cc1f2c33ddf" + hash = "54c58b72f98cb63c44e7694add551e9d" + + strings: + $ = "Chrome/31.0." wide + $ = "%srundll32.exe %s, %s %%1" wide + $ = "MazeFunc" wide + $ = "sys.dll" wide + $ = "KLog" wide + + condition: + uint16be(0) == 0x4d5a and + 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_klogexe.yar b/yara_rules/apt_kimsuky_klogexe.yar new file mode 100644 index 0000000..fe7d750 --- /dev/null +++ b/yara_rules/apt_kimsuky_klogexe.yar @@ -0,0 +1,33 @@ +rule apt_kimsuky_klogexe { + meta: + id = "f6e3b1a5-43b6-4dac-83c2-a365c41de38d" + version = "1.0" + description = "Detects KLogExe, a keylogger used by Kimsuky" + author = "Sekoia.io" + creation_date = "2024-09-27" + classification = "TLP:CLEAR" + hash = "e1d683ee1746c08c5fff1c4c2b3b02f0" + hash = "90946c6358eacd119fe1eb36ec7a0a18" + hash = "9760f489a390665b5e7854429b550c83" + + strings: + //$ = "GetAsyncKeyState" ascii wide + //$ = "desktops.ini" ascii wide + $event = "Norton_BreakHelper" ascii wide + $log = "------ %d/%d/%d : %d/%d ------" ascii wide + + $keylog_1 = "[RM+]" + $keylog_2 = "[Tab+]" + $keylog_3 = "[Home+]" + $keylog_4 = "[End+]" + $keylog_5 = "[clip_s]: %s " + $keylog_6 = "%s[Too many clip_tail]" + $keylog_7 = "%s[F%d]" + + $user_agent = "Chrome/31.0." wide + + condition: + uint16be(0) == 0x4d5a and filesize < 600KB and + 8 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_malicious_gotopwsh_lnk.yar b/yara_rules/apt_kimsuky_malicious_gotopwsh_lnk.yar new file mode 100644 index 0000000..87444fe --- /dev/null +++ b/yara_rules/apt_kimsuky_malicious_gotopwsh_lnk.yar @@ -0,0 +1,16 @@ +rule apt_kimsuky_malicious_gotopwsh_lnk { + meta: + id = "cfe9adf5-2c06-4d04-8006-c4eea0dab549" + version = "1.0" + description = "Detects malicious LNK used by Kimsuky" + author = "Sekoia.io" + creation_date = "2023-09-11" + classification = "TLP:CLEAR" + + strings: + $ = {67 00 6f 00 74 00 6f 00 26 00 70 00 5e 00 6f 00 77 00 5e 00 65 00 5e 00 72 00 73 00 5e 00 68 00 65 00 5e 00 6c 00 5e 00 6c} + + condition: + uint32be(0) == 0x4c000000 and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_malicious_vba.yar b/yara_rules/apt_kimsuky_malicious_vba.yar new file mode 100644 index 0000000..185ea53 --- /dev/null +++ b/yara_rules/apt_kimsuky_malicious_vba.yar @@ -0,0 +1,19 @@ +rule apt_kimsuky_malicious_vba { + meta: + id = "2dbe2431-3592-4395-8164-49abae4a5a3d" + version = "1.0" + description = "Detects malicious VBA used by Kimsuky" + author = "Sekoia.io" + creation_date = "2022-08-30" + classification = "TLP:CLEAR" + + strings: + $ = "Certutil -decode %TMP%" + $ = "%LOCALAPPDATA%\\Microsoft\\Office" + + condition: + uint32be(0) == 0xD0CF11E0 and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_powershell.yar b/yara_rules/apt_kimsuky_powershell.yar new file mode 100644 index 0000000..8f2b470 --- /dev/null +++ b/yara_rules/apt_kimsuky_powershell.yar @@ -0,0 +1,22 @@ +rule apt_kimsuky_powershell { + meta: + id = "b7f812e0-d08b-40fe-908a-dc5765d6bc66" + version = "1.0" + description = "Powershell scripts used by Kimsuky. If size < 3KB ok. If between 3 and 15, a check is needed" + author = "Sekoia.io" + creation_date = "2024-09-23" + classification = "TLP:CLEAR" + hash = "6babb53d881448dc58dd7c32fcd4208a" + hash = "29ec7a4495ea512d44d33c9847893200" + hash = "fde68771cebd7ecd81721b0dff5b7869" + hash = "0c3fd7f45688d5ddb9f0107877ce2fbd" + hash = "1a1723be720c1d9cd57cf4a6a112df79" + + strings: + $ = ".ToCharArray();[array]::Reverse(" ascii + $ = ");$res = -join ($bytes -as [char[]]);Invoke-Expression $res;" ascii + + condition: + all of them and filesize < 15KB +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_powershell_dropper_strings.yar b/yara_rules/apt_kimsuky_powershell_dropper_strings.yar new file mode 100644 index 0000000..f6d01e3 --- /dev/null +++ b/yara_rules/apt_kimsuky_powershell_dropper_strings.yar @@ -0,0 +1,22 @@ +rule apt_kimsuky_powershell_dropper_strings { + meta: + id = "8b346e05-215b-46c0-82bf-fce3a65440f3" + version = "1.0" + description = "Detects a PowerShell dropper used by Kimsuky" + author = "Sekoia.io" + creation_date = "2024-06-11" + classification = "TLP:CLEAR" + + strings: + $s1 = "try { " ascii wide + $s2 = "); } catch(e){} } if (" + $s3 = "WScript.Sleep(" + $s4 = " } catch(e) { }" + + condition: + filesize > 500KB and + $s1 at 0 and $s2 in (filesize-1000..filesize) + and $s3 in (filesize-1000..filesize) + and $s4 in (filesize-1000..filesize) +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_sharpext_compromised_securepreferences.yar b/yara_rules/apt_kimsuky_sharpext_compromised_securepreferences.yar new file mode 100644 index 0000000..0c4ef56 --- /dev/null +++ b/yara_rules/apt_kimsuky_sharpext_compromised_securepreferences.yar @@ -0,0 +1,18 @@ +rule apt_kimsuky_sharpext_compromised_securepreferences { + meta: + id = "aeda5d15-82e1-4ffc-8252-1eb4fc78d024" + version = "1.0" + description = "Detects compromised Chrome SecurePreferences file" + author = "Sekoia.io" + creation_date = "2022-07-29" + classification = "TLP:CLEAR" + + strings: + $ = "\"devtools\", \"tabs\", \"webNavigation\", \"webRequest\", \"webRequestBlocking\"" + $ = "AppData\\\\Roaming" + $ = "https://*/*" + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_sharpext_devps1_strings.yar b/yara_rules/apt_kimsuky_sharpext_devps1_strings.yar new file mode 100644 index 0000000..060b2b2 --- /dev/null +++ b/yara_rules/apt_kimsuky_sharpext_devps1_strings.yar @@ -0,0 +1,19 @@ +rule apt_kimsuky_sharpext_devps1_strings { + meta: + id = "f2ad32a4-bfca-40b2-964e-b8562538a6f2" + version = "1.0" + description = "Detects strings of Dev.ps1" + author = "Sekoia.io" + creation_date = "2022-07-29" + classification = "TLP:CLEAR" + + strings: + $s1 = "keybd_Event(" ascii fullword + $s2 = "Sleep" ascii fullword + $s3 = "CreateDev" ascii fullword + + condition: + filesize < 10KB and + #s1 == 6 and #s2 == 6 and $s3 +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_sharpext_devtoolmodule_strings.yar b/yara_rules/apt_kimsuky_sharpext_devtoolmodule_strings.yar new file mode 100644 index 0000000..093ebfa --- /dev/null +++ b/yara_rules/apt_kimsuky_sharpext_devtoolmodule_strings.yar @@ -0,0 +1,18 @@ +rule apt_kimsuky_sharpext_devtoolmodule_strings { + meta: + id = "6f589a9c-344a-4ddc-929e-f123a2c3c187" + version = "1.0" + description = "Detects the DevTool module used by SharpExt" + author = "Sekoia.io" + creation_date = "2022-07-29" + classification = "TLP:CLEAR" + + strings: + $ = "packetProc = function" ascii fullword + $ = "var url = request.request.url" ascii fullword + $ = "https://mail" ascii fullword + + condition: + all of them and filesize < 50KB +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_sharpext_jsexfil_strings.yar b/yara_rules/apt_kimsuky_sharpext_jsexfil_strings.yar new file mode 100644 index 0000000..e63c3df --- /dev/null +++ b/yara_rules/apt_kimsuky_sharpext_jsexfil_strings.yar @@ -0,0 +1,19 @@ +rule apt_kimsuky_sharpext_jsexfil_strings { + meta: + id = "c9ebd123-6450-4424-93d1-60322bd97bf6" + version = "1.0" + description = "Detects the exfiltration JS code of SharpExt" + author = "Sekoia.io" + creation_date = "2022-07-29" + classification = "TLP:CLEAR" + + strings: + $ = "var req_url" ascii fullword + $ = "var newReqId" ascii fullword + $ = "chrome.tabs.query" ascii fullword + $ = "payload.message.flags = new Object();" ascii fullword + + condition: + all of them and filesize < 50KB +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_sharptongue_c2_source.yar b/yara_rules/apt_kimsuky_sharptongue_c2_source.yar new file mode 100644 index 0000000..649a449 --- /dev/null +++ b/yara_rules/apt_kimsuky_sharptongue_c2_source.yar @@ -0,0 +1,19 @@ +rule apt_kimsuky_sharptongue_c2_source { + meta: + id = "a2ccf773-511c-4088-8bcf-b923291d024b" + version = "1.0" + description = "Detects the PHP code of the SharpTongue C2" + author = "Sekoia.io" + creation_date = "2022-07-29" + classification = "TLP:CLEAR" + + strings: + $ = " $value)" + $ = "$chk=$value" + $ = "base64_encode($ip)" + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_sharptongue_strings.yar b/yara_rules/apt_kimsuky_sharptongue_strings.yar new file mode 100644 index 0000000..56e48ab --- /dev/null +++ b/yara_rules/apt_kimsuky_sharptongue_strings.yar @@ -0,0 +1,19 @@ +rule apt_kimsuky_sharptongue_strings { + meta: + id = "56027edb-4e6e-40ec-a1b9-36c52b0dd3ec" + version = "1.0" + description = "Detects SharpTongue variants." + author = "Sekoia.io" + creation_date = "2022-07-29" + classification = "TLP:CLEAR" + + strings: + $s1 = "Post0.Open" ascii wide + $s2 = ".php?op=" ascii wide + $s3 = "s=s&Mid(c,ix*d+jx+1,1)" ascii wide + $s4 = "curl -o " ascii wide + + condition: + $s2 in (@s1..@s1+200) or $s2 in (@s4..@s4+200) or $s3 and filesize < 500KB +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_sharptongue_vbslauncher_strings.yar b/yara_rules/apt_kimsuky_sharptongue_vbslauncher_strings.yar new file mode 100644 index 0000000..c0ce8e2 --- /dev/null +++ b/yara_rules/apt_kimsuky_sharptongue_vbslauncher_strings.yar @@ -0,0 +1,18 @@ +rule apt_kimsuky_sharptongue_vbslauncher_strings { + meta: + id = "82bd648c-2961-4945-950e-8fb1e4650338" + version = "1.0" + description = "Detects VBS Launchers used by SharpTongue" + author = "Sekoia.io" + creation_date = "2022-07-29" + classification = "TLP:CLEAR" + + strings: + $ = "powershell" ascii wide + $ = "On Error Resume Next" ascii wide + $ = "oShell.run(tmp0,0" ascii wide + + condition: + all of them and filesize < 10KB +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_toddlershark_obfuscated.yar b/yara_rules/apt_kimsuky_toddlershark_obfuscated.yar new file mode 100644 index 0000000..71b12b5 --- /dev/null +++ b/yara_rules/apt_kimsuky_toddlershark_obfuscated.yar @@ -0,0 +1,19 @@ +rule apt_kimsuky_toddlershark_obfuscated { + meta: + id = "9ab82466-4f38-4597-b75b-13252e180c70" + version = "1.0" + description = "Detects obfuscated version of Kimsuky TODDLERSHARK vbs malware" + author = "Sekoia.io" + creation_date = "2024-03-06" + classification = "TLP:CLEAR" + + strings: + $s1 = { 3a 20 [3-10] 20 3d 20 22 [3-30] 22 3a } + $s2 = { 45 78 65 63 75 74 65 28 [3-15] 28 22 } + $s3 = { 50 72 69 76 61 74 65 20 46 75 6e 63 74 69 6f 6e 20 [3-15] 28 42 79 56 61 6c 20 [3-15] 29 3a } + $s4 = "& Chr(\"&H\" & Mid(" + + condition: + #s4 == 1 and #s3 == 1 and #s2 == 1 and #s1 > 20 and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_toddlershark_strings.yar b/yara_rules/apt_kimsuky_toddlershark_strings.yar new file mode 100644 index 0000000..00e9d68 --- /dev/null +++ b/yara_rules/apt_kimsuky_toddlershark_strings.yar @@ -0,0 +1,21 @@ +rule apt_kimsuky_toddlershark_strings { + meta: + id = "2db1a424-9e83-4168-8ebf-d3b415b6a576" + version = "1.0" + description = "Detects Kimsuky TODDLERSHARK vbs malware" + author = "Sekoia.io" + creation_date = "2024-03-06" + classification = "TLP:CLEAR" + + strings: + $ = "On Error Resume Next" + $ = ".open \"POST\", \"http" + $ = ".setRequestHeader" + $ = ".send" + $ = "Execute(" + $ = ".responseText)" + + condition: + all of them and filesize < 450 +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_validator_strings.yar b/yara_rules/apt_kimsuky_validator_strings.yar new file mode 100644 index 0000000..38f6653 --- /dev/null +++ b/yara_rules/apt_kimsuky_validator_strings.yar @@ -0,0 +1,18 @@ +rule apt_kimsuky_validator_strings { + meta: + id = "e055f2d4-8318-4342-812e-0f621d7886b4" + version = "1.0" + description = "Detects Kimsuky validator" + author = "Sekoia.io" + creation_date = "2024-06-11" + classification = "TLP:CLEAR" + + strings: + $ = "%s%sc %s >%s 2>&1" wide + $ = "%s%sc %s 2>%s" wide + + condition: + uint16be(0) == 0x4d5a and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_vbs.yar b/yara_rules/apt_kimsuky_vbs.yar new file mode 100644 index 0000000..3ecefef --- /dev/null +++ b/yara_rules/apt_kimsuky_vbs.yar @@ -0,0 +1,24 @@ +rule apt_kimsuky_vbs { + meta: + id = "3f92dbda-2ddb-4fa3-a587-743f65ced9e4" + version = "1.0" + description = "VBS files used by Kimsuky" + author = "Sekoia.io" + creation_date = "2024-09-23" + classification = "TLP:CLEAR" + hash = "12386be22ca82fce98a83a5a19e632bc" + hash = "7b5783d42240651af78ebf7e01b31fe8" + hash = "ff7d68e5fb253664ce64c85457b28041" + hash = "622358469e5e24114dd0eb03da815576" + hash = "edbb2aa40408e2a7936067ace38b445b" + hash = "73ed9b012785dc3b3ee33aa52700cfe4" + + strings: + $ = ")):Next:Execute " ascii + $ = "=\"\":" ascii + $ = "\":for " + + condition: + all of them and filesize < 10KB +} + \ No newline at end of file diff --git a/yara_rules/apt_kimsuky_vbs_powershell_downloader.yar b/yara_rules/apt_kimsuky_vbs_powershell_downloader.yar new file mode 100644 index 0000000..b4137f0 --- /dev/null +++ b/yara_rules/apt_kimsuky_vbs_powershell_downloader.yar @@ -0,0 +1,19 @@ +rule apt_kimsuky_vbs_powershell_downloader { + meta: + id = "4c9af11f-802b-4ffe-9783-90fc2ee53809" + version = "1.0" + description = "Detects VBS/Powershell Downloader used by Kimsuky" + author = "Sekoia.io" + creation_date = "2022-08-30" + classification = "TLP:CLEAR" + + strings: + $ = "& WScript.ScriptFullName &" ascii fullword + $ = "/c schtasks /create /sc minute /mo 5 /tn" + $ = "pOwErsHeLl -ep bypass -encodedCommand" + + condition: + filesize < 200KB and + 2 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_konni.yar b/yara_rules/apt_konni.yar new file mode 100644 index 0000000..96f0079 --- /dev/null +++ b/yara_rules/apt_konni.yar @@ -0,0 +1,26 @@ +rule apt_konni { + meta: + id = "6a20c492-e932-41bd-ac4a-01d35bfb0c49" + version = "1.0" + description = "Rule based on structure offsets and file extension" + author = "Sekoia.io" + creation_date = "2022-09-12" + classification = "TLP:CLEAR" + + strings: + $ext_1 = ".zip" wide ascii fullword + $ext_2 = ".cab" wide ascii fullword + $ext_3 = ".rar" wide ascii fullword + $ext_4 = ".ini" wide ascii fullword + $ext_5 = ".dat" wide ascii fullword + + + $offset_structure_1 = { 8d ?? 08 02 00 00 } //offset 0x208 + $offset_structure_2 = { 8d ?? 10 04 00 00 } //offset 0x410 + $offset_structure_3 = { 8d ?? 18 06 00 00 } //offset 0x618 + $url = "%s/dn.php?name=%s&prefix=%s" wide + + condition: + uint16be(0) == 0x4d5a and filesize < 3MB and 3 of ($ext_*) and all of ($offset_structure_*) and $url +} + \ No newline at end of file diff --git a/yara_rules/apt_konni_check_bat.yar b/yara_rules/apt_konni_check_bat.yar new file mode 100644 index 0000000..5aecdff --- /dev/null +++ b/yara_rules/apt_konni_check_bat.yar @@ -0,0 +1,24 @@ +rule apt_konni_check_bat { + meta: + id = "f05e6ba2-c128-4c17-8f74-f7640103c859" + version = "1.0" + description = "Script used to performs check before executing Konni" + author = "Sekoia.io" + creation_date = "2023-11-27" + classification = "TLP:CLEAR" + + strings: + $ = ":64BIT" + $ = ":32BIT" + $ = ":INSTALL" + $ = ":EXIT" + $ = "netpp.dll" + $ = "wpns.dll" + $ = "netpp64.dll" + $ = "wpns64.dll" + $ = "rundll32" + + condition: + filesize < 1MB and 7 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_konni_dropper.yar b/yara_rules/apt_konni_dropper.yar new file mode 100644 index 0000000..bd194dc --- /dev/null +++ b/yara_rules/apt_konni_dropper.yar @@ -0,0 +1,20 @@ +rule apt_konni_dropper { + meta: + id = "0783a55e-1d1e-40ca-a661-2c5dec6d78d6" + version = "1.0" + description = "Detects Konni dropper used when distributed via malicious document" + author = "Sekoia.io" + creation_date = "2023-11-27" + classification = "TLP:CLEAR" + + strings: + $ = "UnzipAFile" + $ = "check.bat" + $ = "FOF_SILENT" + $ = "fLieObj" + + condition: + + filesize < 1MB and 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_backdoored_jslib.yar b/yara_rules/apt_lazarus_backdoored_jslib.yar new file mode 100644 index 0000000..4888000 --- /dev/null +++ b/yara_rules/apt_lazarus_backdoored_jslib.yar @@ -0,0 +1,18 @@ +rule apt_lazarus_backdoored_jslib { + meta: + id = "73ffd449-93c8-494e-9c14-2e933b21a200" + version = "1.0" + description = "Detects InvisibleFerret based on common ressource." + author = "Sekoia.io" + creation_date = "2024-10-28" + classification = "TLP:CLEAR" + hash = "52e92be527690f4e63608cbc699e2f70" + + strings: + $obf = "(function(_0x" ascii + $exp = "module.exports =" ascii + + condition: + $exp in (filesize-500..filesize) and #obf == 1 +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_blindingcan_rtti.yar b/yara_rules/apt_lazarus_blindingcan_rtti.yar new file mode 100644 index 0000000..f74cf33 --- /dev/null +++ b/yara_rules/apt_lazarus_blindingcan_rtti.yar @@ -0,0 +1,17 @@ +rule apt_lazarus_blindingcan_rtti { + meta: + id = "9a16c189-ffc1-4aa6-8582-298abaecd0ef" + version = "1.0" + description = "Detects BLINDINGCAN with RTTI" + author = "Sekoia.io" + creation_date = "2022-10-04" + classification = "TLP:CLEAR" + + strings: + $s1 = ".?AVCHTTP_Protocol@@" ascii wide fullword + $s2 = ".?AVCFileRW@@" ascii wide fullword + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_dangerouspassword_lnk.yar b/yara_rules/apt_lazarus_dangerouspassword_lnk.yar new file mode 100644 index 0000000..6668451 --- /dev/null +++ b/yara_rules/apt_lazarus_dangerouspassword_lnk.yar @@ -0,0 +1,22 @@ +rule apt_lazarus_dangerouspassword_lnk { + meta: + id = "32533880-7f75-4682-a7ae-9868d0b5174b" + version = "1.0" + description = "Detects Lazarus DangerousPassword LNKs" + author = "Sekoia.io" + creation_date = "2022-07-26" + classification = "TLP:CLEAR" + + strings: + $s1 = {6D 00 73 00 68 00 2A} + $s2 = {25 00 70 00 75 00 62 00 6C 00 69 00 63 00 25} + $s3 = {44 00 4F 00 20 00 73 00 74 00 61 00 72 00 74} + $b1 = {2F 00 63 00 20 00 73 00 74 00 61 00 72 00 74 00 20 00 2F 00 62 00 20 00 6D 00 73 00 68 00 74 00 61} + $c1 = {68 00 74 00 74 00 70 00 73 00 3A 00 2F 00 2F 00 62 00 69 00 74 00 2E 00 6C 00 79 00 2F} + + condition: + uint32be(0)== 0x4C000000 and + filesize > 1KB and filesize < 40MB and + (all of ($s*) or $b1 or ($s1 and $c1)) +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_dll_c2_comms.yar b/yara_rules/apt_lazarus_dll_c2_comms.yar new file mode 100644 index 0000000..485f02e --- /dev/null +++ b/yara_rules/apt_lazarus_dll_c2_comms.yar @@ -0,0 +1,34 @@ +rule apt_lazarus_dll_c2_comms { + meta: + id = "9b379aa8-77ce-4c76-ab13-05e35ebfbdfe" + version = "1.0" + description = "Detects DLL communicating with the C2" + author = "Sekoia.io" + creation_date = "2023-04-04" + classification = "TLP:CLEAR" + hash1 = "fe948451df90df80c8028b969bf89ecbf501401e7879805667c134080976ce2e" + hash2 = "bb1066c1ca53139dc5a2c1743339f4e6360d6fe4f2f3261d24fc28a12f3e2ab9" + hash3 = "dca33d6dacac0859ec2f3104485720fe2451e21eb06e676f4860ecc73a41e6f9" + hash4 = "69dd140f45c3fa3aaa64c69f860cd3c74379dec37c46319d7805a29b637d4dbf" + + strings: + $x1 = "vG2eZ1KOeGd2n5fr" ascii fullword + $s1 = "Windows %d(%d)-%s" ascii fullword + $s2 = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" wide fullword + + $op1 = {B8 C8 00 00 00 83 FB 01 44 0F 47 E8 41 8B C5 48 8B B4 24 E0 18 00 00 4C 8B A4 24 E8 18 00 00 48 8B 8D A0 17 00 00 48 33 CC} + $op2 = {33 D2 46 8D 04 B5 00 00 00 00 66 0F 1F 44 00 00 49 63 C0 41 FF C0 8B 4C 84 70 31 4C 94 40 48 FF C2} + $op3 = {89 5C 24 50 0F 57 C0 C7 44 24 4C 04 00 00 00 C7 44 24 48 40 00 00 00 0F 11 44 24 60 0F 11 44 24 70 0F 11 45 80 0F 11 45 90} + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and ( + filesize < 500KB and( + 1 of ($x*) + or 2 of them + ) + or ( + $x1 and 1 of ($s*) + or 3 of them + )) +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_gopuram_backdoor.yar b/yara_rules/apt_lazarus_gopuram_backdoor.yar new file mode 100644 index 0000000..d069a00 --- /dev/null +++ b/yara_rules/apt_lazarus_gopuram_backdoor.yar @@ -0,0 +1,25 @@ +import "pe" + +rule apt_lazarus_gopuram_backdoor { + meta: + id = "947d4ee3-79fa-450b-8482-beafe607baae" + version = "1.0" + description = "Detects Gopuram Backdoor" + author = "Sekoia.io" + creation_date = "2023-04-04" + classification = "TLP:CLEAR" + hash1 = "97b95b4a5461f950e712b82783930cb2a152ec0288c00a977983ca7788342df7" + hash2 = "beb775af5196f30e0ee021790a4978ca7a7ac2a7cf970a5a620ffeb89cc60b2c" + + strings: + $x1 = "%s\\config\\TxR\\%s.TxR.0.regtrans-ms" + $xop = {D1 E8 33 C3 D1 EB A8 01 74 ?? 81 F3 25 A3 87 DE D1 E8 33 C3 D1 EB A8 01 74 ?? 81 F3 25 A3 87 DE D1 E8 33 C3 D1 EB A8 01 74 ?? 81 F3 25 A3 87 DE D1 E8 33 C3 D1 EB A8 01 74 ?? 81 F3 25 A3 87 DE} + $opa1 = {48 89 44 24 ?? 45 33 C9 45 33 C0 33 D2 89 5C 24 ?? 48 89 74 24 ?? 48 89 5C 24 ?? 89 7C 24 ?? FF 15 ?? ?? ?? ?? 85 C0 74 ?? 48 8B 4C 24 ?? 4C 8D 4C 24 ?? 44 8D 43 ??} + $opa2 = {48 89 B4 24 ?? ?? ?? ?? 44 8D 43 ?? 33 D2 48 89 BC 24 ?? ?? ?? ?? 4C 89 B4 24 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B 4C 24 ?? E8 ?? ?? ?? ?? 48 8B 4C 24 ?? 45 33 C0 33 D2 8B F8 E8 ?? ?? ?? ?? 8D 4F ?? E8 ?? ?? ?? ?? 4C 8B 4C 24 ?? 44 8D 43 ?? 48 8B C8 8B D7 48 8B F0 44 8B F7 E8 ?? ?? ?? ?? 48 8B 4C 24 ?? E8 ?? ?? ??} + + condition: (uint16(0) == 0x4d5a and filesize < 2MB + and pe.characteristics & pe.DLL and 1 of ($x*) + ) + or all of ($opa*) +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_lambload_timecheck.yar b/yara_rules/apt_lazarus_lambload_timecheck.yar new file mode 100644 index 0000000..d558227 --- /dev/null +++ b/yara_rules/apt_lazarus_lambload_timecheck.yar @@ -0,0 +1,68 @@ +rule apt_lazarus_lambload_timecheck { + meta: + id = "8807c752-c34e-4c3b-9194-3a9bd2575a88" + version = "1.0" + description = "Detects timeCheck routine in LambLoad" + author = "Sekoia.io" + creation_date = "2023-11-27" + classification = "TLP:CLEAR" + reference = "https://www.microsoft.com/en-us/security/blog/2023/11/22/diamond-sleet-supply-chain-compromise-distributes-a-modified-cyberlink-installer/" + + strings: + /* + 0x41322e 0F8567030000 jne 41359bh + 0x413234 8D8548FBFFFF lea eax, [ebp - 4b8h] + 0x41323a 50 push eax + 0x41323b E8F2490700 call 487c32h + 0x413240 83C404 add esp, 4 + 0x413243 83781802 cmp dword ptr [eax + 18h], 2 + 0x413247 0F854E030000 jne 41359bh + 0x41324d 8B4808 mov ecx, dword ptr [eax + 8] + 0x413250 83F90B cmp ecx, 0bh + 0x413253 0F8C42030000 jl 41359bh + 0x413259 83F90C cmp ecx, 0ch + 0x41325c 0F8D39030000 jge 41359bh + 0x413262 8B4004 mov eax, dword ptr [eax + 4] + 0x413265 83F81E cmp eax, 1eh + 0x413268 0F8C2D030000 jl 41359bh + 0x41326e 83F83C cmp eax, 3ch + 0x413271 0F8D24030000 jge 41359bh + 0x413277 53 push ebx + 0x413278 57 push edi + 0x413279 6808020000 push 208h + 0x41327e 8D8580FDFFFF lea eax, [ebp - 280h] + 0x413284 6A00 push 0 + 0x413286 50 push eax + 0x413287 C78550FBFFFF04010000 mov dword ptr [ebp - 4b0h], 104h + */ + $chunk_1 = { + 0F 85 ?? ?? ?? ?? + 8D 85 ?? ?? ?? ?? + 50 + E8 ?? ?? ?? ?? + 83 C4 ?? + 83 78 ?? ?? + 0F 85 ?? ?? ?? ?? + 8B 48 ?? + 83 F9 ?? + 0F 8C ?? ?? ?? ?? + 83 F9 ?? + 0F 8D ?? ?? ?? ?? + 8B 40 ?? + 83 F8 ?? + 0F 8C ?? ?? ?? ?? + 83 F8 ?? + 0F 8D ?? ?? ?? ?? + 53 + 57 + 68 ?? ?? ?? ?? + 8D 85 ?? ?? ?? ?? + 6A ?? + 50 + C7 85 ?? ?? ?? ?? ?? ?? ?? ?? + } + + condition: + uint16be(0) == 0x4d5a and any of them +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_pondrat.yar b/yara_rules/apt_lazarus_pondrat.yar new file mode 100644 index 0000000..a6bcb7d --- /dev/null +++ b/yara_rules/apt_lazarus_pondrat.yar @@ -0,0 +1,25 @@ +rule apt_lazarus_pondrat { + meta: + id = "a957c158-a79a-4d7a-8473-b6960cf02d9b" + version = "1.0" + description = "Detects PondRAT via mangled command names" + author = "Sekoia.io" + creation_date = "2024-09-23" + classification = "TLP:CLEAR" + hash = "b62c912de846e743effdf7e5654a7605" + hash = "61d7b2c7814971e5323ec67b3a3d7f45" + hash = "ce35c935dcc9d55b2c79945bac77dc8e" + hash = "f50c83a4147b86cdb20cc1fbae458865" + hash = "05957d98a75c04597649295dc846682d" + hash = "33c9a47debdb07824c6c51e13740bdfe" + + strings: + $cmd_PondRAT1 = "_Z7MsgDownP11_TRANS_INFO" ascii + $cmd_PondRAT2 = "_Z5MsgUpP11_TRANS_INFO" ascii + $cmd_PondRAT3 = "_Z6MsgRunP11_TRANS_INFO" ascii + $cmd_PondRAT4 = "_Z6MsgCmdP11_TRANS_INFO" ascii + + condition: + 3 of them and filesize < 4MB +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_vhd_ransomware_downloader.yar b/yara_rules/apt_lazarus_vhd_ransomware_downloader.yar new file mode 100644 index 0000000..4d7c32c --- /dev/null +++ b/yara_rules/apt_lazarus_vhd_ransomware_downloader.yar @@ -0,0 +1,21 @@ +rule apt_lazarus_vhd_ransomware_downloader { + meta: + id = "edcc9df8-650c-437a-adb8-a671e8b75e64" + version = "1.0" + description = "Detects VHD ransomware downloader" + author = "Sekoia.io" + creation_date = "2022-11-28" + classification = "TLP:CLEAR" + + strings: + $ = "rundll32.exe %s #1 %S" wide + $ = "cmd /c timeout /t 10 & Del /f /q \"%s\" & attrib -s -h \"%s\" & rundll32 \"%s\" #1" wide + $ = "cmd /c timeout /t 10 & rundll32 \"%s\" #1" wide + $ = "curl -A cur1-agent -L %s -s -d da" + $ = "curl -A cur1-agent -L %s -s -d dl" + + condition: + filesize < 2MB and + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_lazarus_vhd_ransomware_loader.yar b/yara_rules/apt_lazarus_vhd_ransomware_loader.yar new file mode 100644 index 0000000..1cb5250 --- /dev/null +++ b/yara_rules/apt_lazarus_vhd_ransomware_loader.yar @@ -0,0 +1,31 @@ +rule apt_lazarus_vhd_ransomware_loader { + meta: + id = "377f3ec5-fa2a-431e-93d2-6a1eb9e01d28" + version = "1.0" + description = "Detects VHD ransomware x64 loader " + author = "Sekoia.io" + creation_date = "2022-11-28" + classification = "TLP:CLEAR" + + strings: + $ = { B8 64 [8] B8 75 [8] B8 6D [8] B8 70 [8] B8 2E [8] B8 62 [8] B8 69 [8] B8 6E } + $ = { 48 63 ?? ?? ?? + 48 8B ?? ?? ?? + 0F BE ?? ?? + B9 ?? ?? ?? ?? + 48 6B ?? ?? + 48 8B ?? ?? ?? + 0F BE ?? ?? + ?? ?? + 48 63 ?? ?? ?? + 48 8B ?? ?? ?? + 88 ?? ?? + EB } + $ = { 25 00 73 00 5c [3-15] 25 00 64 00 25 00 64 00 2e 00 62 00 69 00 6e } + + condition: + uint16be(0) == 0x4d5a and + filesize < 200KB and + 2 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_luckymouse_compromised_electronapp.yar b/yara_rules/apt_luckymouse_compromised_electronapp.yar new file mode 100644 index 0000000..ed98cc9 --- /dev/null +++ b/yara_rules/apt_luckymouse_compromised_electronapp.yar @@ -0,0 +1,16 @@ +rule apt_luckymouse_compromised_electronapp { + meta: + id = "7702217d-771f-47af-8eaa-d5acf1e14f4d" + version = "1.0" + description = "Detects compromised ElectronApp" + author = "Sekoia.io" + creation_date = "2022-08-05" + classification = "TLP:CLEAR" + + strings: + $s = "module.exports=function(t){eval(function(p,a,c,k,e,r)" + + condition: + $s at 0 and filesize < 100KB +} + \ No newline at end of file diff --git a/yara_rules/apt_luckymouse_rshell_strings.yar b/yara_rules/apt_luckymouse_rshell_strings.yar new file mode 100644 index 0000000..0c6abe8 --- /dev/null +++ b/yara_rules/apt_luckymouse_rshell_strings.yar @@ -0,0 +1,27 @@ +rule apt_luckymouse_rshell_strings { + meta: + id = "89f18013-ea3e-440f-821e-cef102a43b7b" + version = "1.0" + description = "Detects LuckyMouse RShell Mach-O implant" + author = "Sekoia.io" + creation_date = "2022-08-05" + classification = "TLP:CLEAR" + + strings: + $ = { 64 69 72 00 70 61 74 68 + 00 64 6F 77 6E 00 72 65 + 61 64 00 75 70 6C 6F 61 + 64 00 77 72 69 74 65 00 + 64 65 6C } + $ = { 6C 6F 67 69 6E 00 68 6F + 73 74 6E 61 6D 65 00 6C + 61 6E 00 75 73 65 72 6E + 61 6D 65 00 76 65 72 73 + 69 6F 6E } + + condition: + (uint32be(0) == 0xCFFAEDFE or uint16be(0) == 0x4d5a) and + filesize < 300KB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_luckymouse_rshell_strings_all_platform.yar b/yara_rules/apt_luckymouse_rshell_strings_all_platform.yar new file mode 100644 index 0000000..006da6f --- /dev/null +++ b/yara_rules/apt_luckymouse_rshell_strings_all_platform.yar @@ -0,0 +1,21 @@ +rule apt_luckymouse_rshell_strings_all_platform { + meta: + id = "e79a5ee1-96b3-4643-ab11-0b1095e96488" + version = "1.0" + description = "Detects LuckyMouse RShell Mach-O implant" + author = "Sekoia.io" + creation_date = "2022-08-05" + classification = "TLP:CLEAR" + + strings: + $ = { 6C 6F 67 69 6E 00 68 6F + 73 74 6E 61 6D 65 00 6C + 61 6E 00 75 73 65 72 6E + 61 6D 65 00 76 65 72 73 + 69 6F 6E } + + condition: + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_luckymouse_sysupdate_removing_tool.yar b/yara_rules/apt_luckymouse_sysupdate_removing_tool.yar new file mode 100644 index 0000000..7950fb4 --- /dev/null +++ b/yara_rules/apt_luckymouse_sysupdate_removing_tool.yar @@ -0,0 +1,19 @@ +rule apt_luckymouse_sysupdate_removing_tool { + meta: + id = "711d059c-6229-49ef-aa20-a04d505838dc" + version = "1.0" + description = "Detects the SysUpdate removing tool" + author = "Sekoia.io" + creation_date = "2022-08-03" + classification = "TLP:CLEAR" + + strings: + $ = "KsWAYYYXXsFUCK" wide + $ = "remove Services:%s %d" wide + $ = "remove dir:%s %d" wide + $ = "remove reg %d" wide + + condition: + uint16be(0) == 0x4d5a and filesize < 11MB and 2 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_malware_pocoproxy.yar b/yara_rules/apt_malware_pocoproxy.yar new file mode 100644 index 0000000..5ec9da2 --- /dev/null +++ b/yara_rules/apt_malware_pocoproxy.yar @@ -0,0 +1,26 @@ +rule apt_malware_pocoproxy { + meta: + id = "8b37e37f-339e-4f8b-b792-435096f56af0" + version = "1.0" + description = "Detects strings in PocoProxy" + author = "Sekoia.io" + creation_date = "2024-08-13" + classification = "TLP:CLEAR" + hash = "2b89f15012512002c656ff821bbbeca0" + hash = "8d850fed6bb1f3b60365ed656c6791c5" + + strings: + $ = "-listen" ascii fullword + $ = "-connect" ascii fullword + $ = "-proxy" ascii fullword + $ = "%d-%d-%d %d:%d:%d" ascii fullword + $ = "%S://%S:%u%S" wide + $ = "\\r\\n[%u(%u/%u/%u/%u)]==> %S %S>> %S:%d connect ok." wide + $ = "\\r\\nnconnect to %S:%d faild." wide + $ = "\\r\\nI'm listen %S:%d,welcome..." wide + + condition: + uint16be(0) == 0x4d5a and + 5 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_menupass_maliciouslibvlc_dll.yar b/yara_rules/apt_menupass_maliciouslibvlc_dll.yar new file mode 100644 index 0000000..fa7cae3 --- /dev/null +++ b/yara_rules/apt_menupass_maliciouslibvlc_dll.yar @@ -0,0 +1,18 @@ +import "pe" + +rule apt_menupass_maliciouslibvlc_dll { + meta: + id = "8b6b56f3-33b5-41cf-8bcb-e653c98718bd" + version = "1.0" + description = "Detects the malicious LibVLC variants used by MenuPass" + author = "Sekoia.io" + creation_date = "2022-04-06" + classification = "TLP:CLEAR" + + condition: + pe.DLL and + pe.number_of_exports < 15 and + for all i in (0..pe.number_of_exports - 1): + (pe.export_details[i].name contains "libvlc_") +} + \ No newline at end of file diff --git a/yara_rules/apt_micdown_encrypted_configuration.yar b/yara_rules/apt_micdown_encrypted_configuration.yar new file mode 100644 index 0000000..522ebb6 --- /dev/null +++ b/yara_rules/apt_micdown_encrypted_configuration.yar @@ -0,0 +1,16 @@ +rule apt_micdown_encrypted_configuration { + meta: + id = "9567d68b-05d1-4d41-b87f-c8691ee689cd" + version = "1.0" + description = "Encrypted C2 configuration of micDown" + author = "Sekoia.io" + creation_date = "2023-08-24" + classification = "TLP:CLEAR" + + strings: + $s1 = {?? [20] 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 84 36} + + condition: + filesize == 66 and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_manifestation_backdoor.yar b/yara_rules/apt_muddywater_manifestation_backdoor.yar new file mode 100644 index 0000000..567e760 --- /dev/null +++ b/yara_rules/apt_muddywater_manifestation_backdoor.yar @@ -0,0 +1,21 @@ +rule apt_muddywater_manifestation_backdoor { + meta: + id = "998fb0ab-73ed-41e5-b87e-f987b8f05a8c" + version = "1.0" + description = "Detects Muddys manifestation JScript backdoor" + author = "Sekoia.io" + creation_date = "2022-01-13" + classification = "TLP:CLEAR" + + strings: + $s1 = "/^\\s+|\\s+$/g" ascii + $l2 = "while (1) {" ascii + $l3 = { 57 53 63 72 69 70 74 2e 73 6c 65 65 70 28 ?? ?? 20 2a 20 31 30 30 30 29 3b } + $s4 = ")+ key , false)" ascii + $s5 = ")+ data , false)" ascii + + condition: + filesize > 1000 and + ($l3 in (@l2..@l2+300)) and (any of ($s*)) +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_manifestation_backdoor_obfuscated.yar b/yara_rules/apt_muddywater_manifestation_backdoor_obfuscated.yar new file mode 100644 index 0000000..458ab72 --- /dev/null +++ b/yara_rules/apt_muddywater_manifestation_backdoor_obfuscated.yar @@ -0,0 +1,18 @@ +rule apt_muddywater_manifestation_backdoor_obfuscated { + meta: + id = "58df72a1-822c-4b82-904d-1c0124dc7bc1" + version = "1.0" + description = "Detects obfuscated Muddys manifestation JScript backdoor" + author = "Sekoia.io" + creation_date = "2022-01-13" + classification = "TLP:CLEAR" + + strings: + $m = { 76 61 72 20 5f 30 78 [4-6] 3d 5b } + $w = {57 53 63 72 69 70 74 5b 5f 30 78 [4-6] 28 30 78 [2-3] 29 5d 28 30 78 [2-3] 2a 30 78 [2-3] 29 2c } + $t = "subkeys(key));}" + + condition: + $m at 0 and ($t at (filesize-16) or $w in (filesize-200..filesize)) +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_moriagent.yar b/yara_rules/apt_muddywater_moriagent.yar new file mode 100644 index 0000000..f866c27 --- /dev/null +++ b/yara_rules/apt_muddywater_moriagent.yar @@ -0,0 +1,29 @@ +import "pe" + +rule apt_muddywater_moriagent { + meta: + id = "e7a83663-6a30-416a-8f29-87a6b9445ea4" + version = "1.0" + description = "Detects Muddy's Mori Agent implant" + author = "Sekoia.io" + creation_date = "2022-01-14" + classification = "TLP:CLEAR" + + strings: + $mut = "0x50504060" ascii fullword + $cmd1 = "TType" ascii fullword + $cmd2 = "TPath" ascii fullword + $cmd3 = "TFileid" ascii fullword + $cmd4 = "TCommand" ascii fullword + $cmd5 = "TTimeout" ascii fullword + $cmd6 = "TFilter" ascii fullword + + condition: + + uint16be(0) == 0x4d5a and + ( ( pe.number_of_exports == 2 and + pe.exports("DllRegisterServer") and + pe.exports("DllUnregisterServer") ) and + ( 5 of them ) ) +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_muddyc2go_dll_launcher_strings.yar b/yara_rules/apt_muddywater_muddyc2go_dll_launcher_strings.yar new file mode 100644 index 0000000..2070c65 --- /dev/null +++ b/yara_rules/apt_muddywater_muddyc2go_dll_launcher_strings.yar @@ -0,0 +1,21 @@ +rule apt_muddywater_muddyc2go_dll_launcher_strings { + meta: + id = "59756195-d842-4038-8fbf-43d26f4353bc" + version = "1.0" + description = "Detects MuddyC2Go DLL launcher" + author = "Sekoia.io" + creation_date = "2024-03-07" + classification = "TLP:CLEAR" + hash = "1a0827082d4b517b643c86ee678eaa53f85f1b33ad409a23c50164c3909fdaca" + + strings: + $ = "-Method GET -ErrorAction Stop;Write-Output $response.Content;iex $response.Content;" + $ = "GetCurrentProcess" + $ = "TerminateProcess" + + condition: + uint16be(0) == 0x4d5a and + filesize < 50KB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_powershell_reverse_secure_proxy.yar b/yara_rules/apt_muddywater_powershell_reverse_secure_proxy.yar new file mode 100644 index 0000000..ae5a24c --- /dev/null +++ b/yara_rules/apt_muddywater_powershell_reverse_secure_proxy.yar @@ -0,0 +1,18 @@ +rule apt_muddywater_powershell_reverse_secure_proxy { + meta: + id = "b255f327-cb56-41b7-82f7-83ee23f791a5" + version = "1.0" + description = "Detects PowerShell Reverse Secure Proxy" + author = "Sekoia.io" + creation_date = "2023-11-14" + classification = "TLP:CLEAR" + + strings: + $ = "$CS.Read($buff,4,2) | Out-Null" ascii wide + $ = "$DP = $buff[2]*256 + $buff[3]" ascii wide + $ = "$PS3.BeginInvoke() | Out-Null" ascii wide + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_powgoop_decode_loop.yar b/yara_rules/apt_muddywater_powgoop_decode_loop.yar new file mode 100644 index 0000000..6640637 --- /dev/null +++ b/yara_rules/apt_muddywater_powgoop_decode_loop.yar @@ -0,0 +1,20 @@ +rule apt_muddywater_powgoop_decode_loop { + meta: + id = "644ed1c4-e0e1-496e-9efc-7d9e15565f7b" + version = "1.0" + description = "Detects the loop used in PowGoop and its loader" + author = "Sekoia.io" + creation_date = "2022-01-13" + classification = "TLP:CLEAR" + + strings: + $s1 = "System.Collections.Generic.List[System.Object]" ascii wide + $s2 = "$d.Add($in[$i]);" ascii wide + $s3 = "[System.Convert]::FromBase64String(" ascii wide + + condition: + filesize < 1MB and + $s2 in (@s1..@s1+400) and + $s3 in (@s1..@s1+400) +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_powgoop_decoded.yar b/yara_rules/apt_muddywater_powgoop_decoded.yar new file mode 100644 index 0000000..8b7299b --- /dev/null +++ b/yara_rules/apt_muddywater_powgoop_decoded.yar @@ -0,0 +1,27 @@ +rule apt_muddywater_powgoop_decoded { + meta: + id = "194cb9ef-da96-42b6-a3b5-b0aee7495f2c" + version = "1.0" + description = "Detects decoded PowGoop malware" + author = "Sekoia.io" + creation_date = "2022-01-13" + classification = "TLP:CLEAR" + + strings: + $h1 = "[System.Net.WebRequest]::Create(" ascii wide + $h2 = "Headers.Add('Authorization'" ascii wide + $h3 = "Headers.Add('Cookie',('value=' + $ec + ';')" ascii wide + $h4 = ".GetResponse()" ascii wide + $h5 = "GetResponseStream()" ascii wide + $c1 = "return (65..90) + (97..122) | Get-Random -Count" ascii wide + $c2 = "% {[char]$_}" ascii wide + + condition: + filesize > 1KB and + filesize < 1MB and + ( $h2 in (@h1..@h5) and + $h3 in (@h1..@h5) and + $h4 in (@h1..@h5) ) + or ( $c2 in (@c1..@c1+50) ) and true +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_powgoop_loader.yar b/yara_rules/apt_muddywater_powgoop_loader.yar new file mode 100644 index 0000000..8db2d0f --- /dev/null +++ b/yara_rules/apt_muddywater_powgoop_loader.yar @@ -0,0 +1,20 @@ +rule apt_muddywater_powgoop_loader { + meta: + id = "716b45e1-9f17-4546-a003-a7c78340d623" + version = "1.0" + description = "Detects the loader of PowGoop malware" + author = "Sekoia.io" + creation_date = "2022-01-13" + classification = "TLP:CLEAR" + + strings: + $s1 = "$d.Add($in[$i]);" ascii wide + $s2 = "[System.Text.Encoding]::UTF8.GetString($o);" ascii wide + $s3 = "$i+=(1+1)" ascii wide + $t = { 24 ?? 3d [1-15] 20 24 ?? 3b ?? ?? ?? 20 24 ?? 3b } + + condition: + filesize < 50KB and + (3 of ($s*) or $t in (filesize-50..filesize)) +} + \ No newline at end of file diff --git a/yara_rules/apt_muddywater_rotrot_strings.yar b/yara_rules/apt_muddywater_rotrot_strings.yar new file mode 100644 index 0000000..0bd07a1 --- /dev/null +++ b/yara_rules/apt_muddywater_rotrot_strings.yar @@ -0,0 +1,37 @@ +rule apt_muddywater_rotrot_strings { + meta: + id = "f7bc195a-0e60-4495-b78a-78f101543700" + version = "1.0" + description = "Detects RotRot backdoor based on strings" + author = "Sekoia.io" + creation_date = "2024-06-10" + classification = "TLP:CLEAR" + + strings: + $s1 = "qsphsbnebub" + $s2 = "rtqitcofcvc" + $s3 = "surjudpgdwd" + $s4 = "tvskveqhexe" + $s5 = "uwtlwfrifyf" + $s6 = "vxumxgsjgzg" + + $t1 = "MpbeMjcsbs" + $t2 = "NqcfNkdtct" + $t3 = "OrdgOleudu" + $t4 = "PsehPmfvev" + $t5 = "QtfiQngwfw" + $t6 = "RugjRohxgx" + + $u1 = "UfsnjobufKpcPckfdu" + $u2 = "VgtokpcvgLqdQdlgev" + $u3 = "WhuplqdwhMreRemhfw" + $u4 = "XivqmrexiNsfSfnigx" + $u5 = "YjwrnsfyjOtgTgojhy" + $u6 = "ZkxsotgzkPuhUhpkiz" + + condition: + uint16be(0) == 0x4d5a and + filesize > 100KB and filesize < 300KB and + any of ($s*) and any of ($t*) and any of ($u*) +} + \ No newline at end of file diff --git a/yara_rules/apt_mustang_panda_nupakage.yar b/yara_rules/apt_mustang_panda_nupakage.yar new file mode 100644 index 0000000..bbbba52 --- /dev/null +++ b/yara_rules/apt_mustang_panda_nupakage.yar @@ -0,0 +1,17 @@ +rule apt_mustang_panda_nupakage { + meta: + id = "bd62c220-addc-48e9-bd01-2eff687ac3ce" + version = "1.0" + description = "Detects NUPAKAGE malware (only PDB, too much false positives)" + author = "Sekoia.io" + creation_date = "2023-03-24" + classification = "TLP:CLEAR" + + strings: + $s1 = "D:\\Project\\NEW_PACKAGE_FILE\\Release\\NEW_PACKAGE_FILE.pdb" ascii wide + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustang_panda_toneins.yar b/yara_rules/apt_mustang_panda_toneins.yar new file mode 100644 index 0000000..bfcde33 --- /dev/null +++ b/yara_rules/apt_mustang_panda_toneins.yar @@ -0,0 +1,45 @@ +import "pe" +import "hash" + +rule apt_mustang_panda_toneins { + meta: + id = "f178217a-ff28-4dd7-9395-f19f3e2e934c" + version = "1.0" + description = "Detect the TONEINS implant used by Mustang Panda" + author = "Sekoia.io" + creation_date = "2022-11-28" + classification = "TLP:CLEAR" + + strings: + $rtti1 = ".?AVDNameNode@@" + $rtti2 = ".?AVcharNode@@" + $rtti3 = ".?AVpcharNode@@" + $rtti4 = ".?AVpDNameNode@@" + $rtti5 = ".?AVDNameStatusNode@@" + $rtti6 = ".?AVpairNode@@" + + $s1 = "DefWindowProcW1222_test" wide ascii + $s2 = "schtasks /create /sc minute /mo 2 /tn" wide ascii + $fnv_CreateFile = {CE C9 CA BD} + $fnv_GetFileSize = {18 81 ED 44} + $fnv_ReadFile = {43 C9 FC 54} + $fnv_CloseHandle = {65 00 BA FA} + $fnv_WriteFile = {4A C4 07 7F} + $fnv_CreateEventA = {E2 DD D2 F9} + $fnv_TerminateProcess = {59 EE 4E F8} + $fnv_GetCurrentProcess = {45 A8 D8 6D} + $fnv_CreateProcessA = { 09 0A 7C 4A} + + condition: + uint16be(0) == 0x4d5a and + 4 of ($rtti*) + and + filesize < 8MB and + ( + for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "69f400d3ff4679294e63fb8a8ca97dbb") + or + (all of ($s*) and 5 of ($fnv*)) + ) +} + \ No newline at end of file diff --git a/yara_rules/apt_mustang_panda_toneshell.yar b/yara_rules/apt_mustang_panda_toneshell.yar new file mode 100644 index 0000000..7a85ae1 --- /dev/null +++ b/yara_rules/apt_mustang_panda_toneshell.yar @@ -0,0 +1,161 @@ +import "pe" +import "hash" + +rule apt_mustang_panda_toneshell { + meta: + id = "bf7c68a9-dddc-494a-a603-c2311ed712a4" + version = "1.0" + description = "Detect the TONESHELL implant used by Mustang Panda from specific functions" + author = "Sekoia.io" + creation_date = "2022-11-28" + classification = "TLP:CLEAR" + + strings: + /* GetTEB + result = NtCurrentTeb(); + dword_1007CA38 = (int)result; + return result; + */ + $func1 = { + 55 + 89 E5 + 64 A1 18 00 00 00 + A3 ?? ?? ?? ?? + 5D + C3 + } + + /*memcpy + v5 = a1; + while ( a3-- ) + *a1++ = *a2++; + return v5; + */ + $func2 = { + 55 + 89 E5 + 50 + 8B 45 ?? + 8B 45 ?? + 8B 45 ?? + 8B 45 ?? + 89 45 ?? + 8B 45 ?? + 89 C1 + 83 C1 FF + 89 4D ?? + 83 F8 00 + 0F 84 ?? ?? ?? ?? + 8B 45 ?? + 8A 08 + 8B 45 ?? + 88 08 + 8B 45 ?? + 83 C0 01 + 89 45 ?? + 8B 45 ?? + 83 C0 01 + 89 45 ?? + E9 ?? ?? ?? ?? + 8B 45 ?? + 83 C4 04 + 5D + C3 + } + + /* Decryptionroutine + result = a1; + for ( i = 0; i < 32; ++i ) + { + *(_BYTE *)(a1 + i) ^= 0x7Eu; + result = i + 1; + } + return result; + */ + $decryption_routine1 = { + 8B 45 ?? + C7 45 ?? 00 00 00 00 + 83 7D ?? 20 + 0F 8D ?? ?? ?? ?? + 8B 45 ?? + 8B 4D ?? + 0F BE 04 08 + 83 F0 ?? + 88 C2 + 8B 45 ?? + 8B 4D ?? + 88 14 08 + 8B 45 ?? + 83 C0 01 + 89 45 ?? + E9 ?? ?? ?? ?? + 83 C4 04 + } + + /* + v6 = 0; + for ( i = 0; ; ++i ) + { + result = v6; + if ( v6 >= a2 ) + break; + *(_BYTE *)(a1 + v6) ^= *(_BYTE *)(a3 + i); + if ( i == a4 - 1 ) + i = 0; + ++v6; + } + return result; + */ + $decryption_routine2 = { + 55 + 89 E5 + 83 EC 08 + 8B 45 ?? + 8B 45 ?? + 8B 45 ?? + 8B 45 ?? + C7 45 ?? 00 00 00 00 + C7 45 ?? 00 00 00 00 + 8B 45 ?? + 3B 45 ?? + 0F 8D ?? ?? ?? ?? + 8B 45 ?? + 8B 4D ?? + 0F BE 04 08 + 8B 4D ?? + 8B 55 ?? + 0F BE 0C 11 + 31 C8 + 88 C2 + 8B 45 ?? + 8B 4D ?? + 88 14 08 + 8B 45 ?? + 8B 4D ?? + 83 E9 01 + 39 C8 + 0F 85 ?? ?? ?? ?? + C7 45 ?? 00 00 00 00 + E9 ?? ?? ?? ?? + 8B 45 ?? + 83 C0 01 + 89 45 ?? + 8B 45 ?? + 83 C0 01 + 89 45 ?? + E9 ?? ?? ?? ?? + 83 C4 08 + 5D + C3 + } + + condition: + uint16be(0) == 0x4d5a and + filesize < 8MB and + for all i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) != "69f400d3ff4679294e63fb8a8ca97dbb" + ) and + 3 of them and + true +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_coolclient.yar b/yara_rules/apt_mustangpanda_coolclient.yar new file mode 100644 index 0000000..cfb560f --- /dev/null +++ b/yara_rules/apt_mustangpanda_coolclient.yar @@ -0,0 +1,20 @@ +rule apt_mustangpanda_coolclient { + meta: + id = "2f8fdb66-03a2-400f-808b-56ae1b276d2f" + version = "1.0" + description = "Detect COOLCLIENT via obfuscation & specific string" + author = "Sekoia.io" + creation_date = "2023-03-27" + classification = "TLP:CLEAR" + + strings: + $s1 = {eb 14 ea 50 eb 0b ea 8b c4 a8 01 74 06 eb 0b} + $s2 = {66 0f d6 44 24 eb eb} + $s3 = "c:\\windows\\syste" fullword + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_decrypt_payload.yar b/yara_rules/apt_mustangpanda_decrypt_payload.yar new file mode 100644 index 0000000..06d80fc --- /dev/null +++ b/yara_rules/apt_mustangpanda_decrypt_payload.yar @@ -0,0 +1,28 @@ +rule apt_mustangpanda_decrypt_payload { + meta: + id = "7b954007-0929-454d-8a10-05279a337f1b" + version = "1.0" + description = "Detects the decryption routine of DAT file" + author = "Sekoia.io" + creation_date = "2022-12-08" + classification = "TLP:CLEAR" + + strings: + $chunk_1 = { + 85 ?? + 74 ?? + 8B ?? + D1 EA + A1 ?? ?? ?? ?? + 03 C2 + A3 ?? ?? ?? ?? + 30 04 29 + 41 + 3B ?? + 72 EC + } + + condition: + filesize < 8MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_downloader.yar b/yara_rules/apt_mustangpanda_downloader.yar new file mode 100644 index 0000000..9aad441 --- /dev/null +++ b/yara_rules/apt_mustangpanda_downloader.yar @@ -0,0 +1,20 @@ +rule apt_mustangpanda_downloader { + meta: + id = "54850ffd-f93b-4082-b3ca-8e1d60b35422" + version = "1.0" + description = "Detects the MustangPanda Downloader" + author = "Sekoia.io" + creation_date = "2022-03-02" + classification = "TLP:CLEAR" + + strings: + $ = "Windows Api" wide nocase + $ = "200 OK" wide + $ = "200 ok" wide + $ = "mscoree.dll" wide + + condition: + uint16be(0) == 0x4d5a and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_malicious_lnk_worm.yar b/yara_rules/apt_mustangpanda_malicious_lnk_worm.yar new file mode 100644 index 0000000..d1d3875 --- /dev/null +++ b/yara_rules/apt_mustangpanda_malicious_lnk_worm.yar @@ -0,0 +1,17 @@ +rule apt_mustangpanda_malicious_lnk_worm { + meta: + id = "e7cc5ecc-2369-49ff-9e35-c9faeb69acda" + version = "1.0" + description = "Detects MustangPanda infected ThumbDrive" + author = "Sekoia.io" + creation_date = "2023-09-21" + classification = "TLP:CLEAR" + + strings: + $s1 = "RECYCLER.BIN\\1\\CEFHelper.exe" wide + + condition: + uint32be(0) == 0x4C000000 and + 1 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_maliciousdll_loading_plugx_strings.yar b/yara_rules/apt_mustangpanda_maliciousdll_loading_plugx_strings.yar new file mode 100644 index 0000000..bca666d --- /dev/null +++ b/yara_rules/apt_mustangpanda_maliciousdll_loading_plugx_strings.yar @@ -0,0 +1,24 @@ +import "pe" + +rule apt_mustangpanda_maliciousdll_loading_plugx_strings { + meta: + id = "2296ac6e-63f5-4cff-aeb7-2c5205e6f559" + version = "1.0" + description = "Detects MustangPanda malicious DLL" + author = "Sekoia.io" + creation_date = "2023-12-18" + classification = "TLP:CLEAR" + hash = "651c096cf7043a01d939dff9ba58e4d69f15b2244c71b43bedb4ada8c37e8859" + + strings: + $ = "VirtualAlloc" + $ = "VirtualFree" + $ = "VirtualProtect" + $ = "VirtualQuery" + $ = "GCC: (MinGW-W64" + + condition: + pe.exports("MsiProvideQualifiedComponentW") + and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_mqsttang_qmagent.yar b/yara_rules/apt_mustangpanda_mqsttang_qmagent.yar new file mode 100644 index 0000000..68bb9a4 --- /dev/null +++ b/yara_rules/apt_mustangpanda_mqsttang_qmagent.yar @@ -0,0 +1,24 @@ +rule apt_mustangpanda_mqsttang_qmagent { + meta: + id = "bcf6f961-0d9b-4fbc-81d2-f5d00c68d4d5" + version = "1.0" + description = "Detects specifics string of MQsTTang, also known as QMAGENT" + author = "Sekoia.io" + creation_date = "2023-03-27" + classification = "TLP:CLEAR" + + strings: + $s1 = "iot/server" + $s2 = "QMQTT::Message" + $s3 = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run" + $command1 = "c_topic" + $command2 = "Alive" + $command3 = "msg" + $command4 = "ret" + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 8MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_payload.yar b/yara_rules/apt_mustangpanda_payload.yar new file mode 100644 index 0000000..6368ca3 --- /dev/null +++ b/yara_rules/apt_mustangpanda_payload.yar @@ -0,0 +1,43 @@ +rule apt_mustangpanda_payload { + meta: + id = "ce7ddf20-e13f-4b5f-8fff-4b1387b29568" + version = "1.0" + description = "Decryption routine of mustang panda payload" + author = "Sekoia.io" + creation_date = "2022-12-08" + classification = "TLP:CLEAR" + + strings: + $chunk_1 = { + 89 74 24 ?? + B9 ?? ?? ?? ?? + 8B 44 24 ?? + 3D ?? ?? ?? ?? + B8 ?? ?? ?? ?? + 0F 4C C1 + E9 ?? ?? ?? ?? + B8 ?? ?? ?? ?? + 31 DB + 31 ED + 31 FF + E9 ?? ?? ?? ?? + 8B 44 24 ?? + B9 ?? ?? ?? ?? + 3B 44 24 ?? + B8 ?? ?? ?? ?? + 0F 42 C1 + E9 ?? ?? ?? ?? + 88 5C 24 ?? + 89 6C 24 ?? + 89 7C 24 ?? + B9 ?? ?? ?? ?? + 8B 44 24 ?? + 3D ?? ?? ?? ?? + B8 ?? ?? ?? ?? + 0F 4C C1 + } + + condition: + filesize < 8MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_tinynote.yar b/yara_rules/apt_mustangpanda_tinynote.yar new file mode 100644 index 0000000..a373bec --- /dev/null +++ b/yara_rules/apt_mustangpanda_tinynote.yar @@ -0,0 +1,22 @@ +rule apt_mustangpanda_tinynote { + meta: + id = "a2b9bea4-a211-456f-8a3f-0f31733e8b29" + version = "1.0" + description = "Detects strings in TinyNote backdoor" + author = "Sekoia.io" + creation_date = "2023-06-07" + classification = "TLP:CLEAR" + + strings: + $s1 = "bypassSMADAV" ascii fullword + $s2 = "excuteCmdLine" ascii fullword + $s3 = "/Create1953125" ascii + $s4 = "MINUTEMonday" ascii + $s5 = "WndProc" ascii + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 8MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_tonedrop.yar b/yara_rules/apt_mustangpanda_tonedrop.yar new file mode 100644 index 0000000..c6d1264 --- /dev/null +++ b/yara_rules/apt_mustangpanda_tonedrop.yar @@ -0,0 +1,44 @@ +rule apt_mustangpanda_tonedrop { + meta: + id = "39df631c-5766-4804-838f-6c9b800c0cc9" + version = "1.0" + description = "TONEDROP strings" + author = "Sekoia.io" + creation_date = "2023-06-19" + classification = "TLP:CLEAR" + + strings: + $window1 = "PROCMON_WINDOW_CLASS" ascii wide + $window2 = "OLLYDBG" ascii wide + $window3 = "WinDbgFrameClass" ascii wide + $window4 = "OllyDbg - [CPU]" ascii wide + $window5 = "Immunity Debugger - [CPU]" ascii wide + + $errormsg1 = "Unable to open file %s for writing" ascii wide + + $proc_01 = "cheatengine-x86_64.exe" ascii wide + $proc_02 = "ollydbg.exe" ascii wide + $proc_03 = "ida.exe" ascii wide + $proc_04 = "ida64.exe" ascii wide + $proc_05 = "radare2.exe" ascii wide + $proc_06 = "x64dbg.exe" ascii wide + $proc_07 = "procmon.exe" ascii wide + $proc_08 = "procmon64.exe" ascii wide + $proc_09 = "procexp.exe" ascii wide + $proc_10 = "processhacker.exe" ascii wide + $proc_11 = "pestudio.exe" ascii wide + $proc_12 = "systracerx32.exe" ascii wide + $proc_13 = "fiddler.exe" ascii wide + $proc_14 = "tcpview.exe" ascii wide + + $opcodes_check_PEsize = {C7 85 94 FD FF FF 2C 02} + $opcodes_ShellExecute_1 = {C7 45 BC 53 68 65 6C} + $opcodes_ShellExecute_2 = {C7 45 C0 6C 45 78 65} + $opcodes_ShellExecute_3 = {C7 45 C4 63 75 74 65} + $opcodes_ShellExecute_4 = {66 C7 45 C8 41 00} + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 8MB and 3 of ($window*) and $errormsg1 and 10 of ($proc_*) and 3 of ($opcodes*) +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_windows_remoteshell.yar b/yara_rules/apt_mustangpanda_windows_remoteshell.yar new file mode 100644 index 0000000..8434f94 --- /dev/null +++ b/yara_rules/apt_mustangpanda_windows_remoteshell.yar @@ -0,0 +1,122 @@ +rule apt_mustangpanda_windows_remoteshell { + meta: + id = "cffdd11e-9700-462e-a965-f9f51db63f0b" + version = "1.0" + description = "Detects Remote Shell of Mustang Panda by detecting internal structure intialization" + author = "Sekoia.io" + creation_date = "2022-12-06" + classification = "TLP:CLEAR" + + strings: + /* + *p_dword101a4 = 12; + this->encrypted[5] = 3; + *(_DWORD *)&this->encrypted[6] = this->dword10198; + *(_WORD *)&this->encrypted[10] = this->dword1019c; + */ + + $chunk_1 = { + C7 45 ?? 0C 00 00 00 + 8D 4E ?? + C6 01 03 + 8B 87 ?? ?? ?? ?? + 89 41 ?? + 66 8B 87 ?? ?? ?? ?? + 66 89 41 ?? + } + /* + *p_dword101a4 = 12; + this->encrypted[5] = 2; + *(_DWORD *)&this->encrypted[6] = this->dword10198; + *(_WORD *)&this->encrypted[10] = this->dword1019c; + cme_crypt(&this->encrypted[5], *p_dword101a4 - 5); + */ + + $chunk_2 = { + C7 45 ?? 0C 00 00 00 + 8D 4E ?? + C6 01 02 + 8B 87 ?? ?? ?? ?? + 89 41 ?? + 66 8B 87 ?? ?? ?? ?? + 66 89 41 ?? + 8B 45 ?? + 83 E8 05 + 50 + 51 + E8 ?? ?? ?? ?? + } + /* + + this->dword101a0 = 1; + *p_dword101a4 = 12; + this->encrypted[5] = 4; + *(_DWORD *)&this->encrypted[6] = this->dword10198; + *(_WORD *)&this->encrypted[10] = this->dword1019c; + cme_crypt(&this->encrypted[5], *p_dword101a4 - 5); + */ + $chunk_3 = { + C7 87 ?? ?? ?? ?? 01 00 00 00 + 8D 4E ?? + C7 45 ?? 0C 00 00 00 + C6 01 04 + 8B 87 ?? ?? ?? ?? + 89 41 ?? + 66 8B 87 ?? ?? ?? ?? + 66 89 41 ?? + 8B 45 ?? + 83 E8 05 + 50 + 51 + E8 ?? ?? ?? ?? + } + + /* + for ( i = 0; i < size; ++i ) + encrypt[i] ^= v3[i % 0x70u]; + for ( j = 0; ; ++j ) + { + result = j; + if ( j >= size ) + break; + encrypt[j] ^= v5[j % 0x64u]; + } + + */ + + $chunk_4 = { + 83 65 ?? ?? + EB ?? + 8B 45 ?? + 40 + 89 45 ?? + 8B 45 ?? + 3B 45 ?? + 7D ?? + 8B 45 ?? + 03 45 ?? + 0F B6 08 + 8B 45 ?? + 33 D2 + 6A ?? + 5E + F7 F6 + 0F B6 84 15 ?? ?? ?? ?? + 33 C8 + 8B 45 ?? + 03 45 ?? + 88 08 + EB ?? + 83 65 ?? ?? + EB ?? + 8B 45 ?? + 40 + 89 45 ?? + 8B 45 ?? + } + + condition: + filesize < 8MB and + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_windows_shellcode_decryptionalgorithm.yar b/yara_rules/apt_mustangpanda_windows_shellcode_decryptionalgorithm.yar new file mode 100644 index 0000000..4c9f933 --- /dev/null +++ b/yara_rules/apt_mustangpanda_windows_shellcode_decryptionalgorithm.yar @@ -0,0 +1,29 @@ +rule apt_mustangpanda_windows_shellcode_decryptionalgorithm { + meta: + id = "c9873a5f-97a6-477f-a1a0-650441c73444" + version = "1.0" + description = "Decryption routine for Shellcode of MustangPanda" + author = "Sekoia.io" + creation_date = "2022-12-05" + classification = "TLP:CLEAR" + + strings: + $chunk_1 = { + 7E ?? + 8B 55 ?? + 53 + 56 + 8B 75 ?? + 57 + 8B 7D ?? + 4F + 8D A4 24 ?? ?? ?? ?? + 8A 1C 11 + 30 1C 30 + } + + condition: + + filesize < 8MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_xoreddll.yar b/yara_rules/apt_mustangpanda_xoreddll.yar new file mode 100644 index 0000000..7ed11f7 --- /dev/null +++ b/yara_rules/apt_mustangpanda_xoreddll.yar @@ -0,0 +1,21 @@ +rule apt_mustangpanda_xoreddll { + meta: + id = "73d13624-01df-41ab-b449-86db43dc6c55" + version = "1.0" + description = "Detects xored DLL from MustangPanda embedding a document" + author = "Sekoia.io" + creation_date = "2022-07-19" + classification = "TLP:CLEAR" + + strings: + $clear = "This program cannot be run in DOS mode" + $stub = "This program cannot be run in DOS mode" xor + $res1 = "5w>w9wR'31Z" xor + $res2 = "r0y0~0KlBD" xor + $res3 = "d&o&h&öé7Æ" xor + $res4 = "9{2{5{+0" xor + + condition: + $stub and any of ($res*) and not $clear and filesize < 3MB +} + \ No newline at end of file diff --git a/yara_rules/apt_mustangpanda_zpakage.yar b/yara_rules/apt_mustangpanda_zpakage.yar new file mode 100644 index 0000000..4f8f16c --- /dev/null +++ b/yara_rules/apt_mustangpanda_zpakage.yar @@ -0,0 +1,32 @@ +rule apt_mustangpanda_zpakage { + meta: + id = "a4767d12-5058-4a26-be62-0cec685917bd" + version = "1.0" + description = "Detect obfuscation seen in ZPAKAGE" + author = "Sekoia.io" + creation_date = "2023-03-27" + classification = "TLP:CLEAR" + hash = "711c0e83f4e626a7b54e3948b281a71915a056c5341c8f509ecba535bc199bee" + + strings: + $chunk_1 = { + 88 94 1D ?? ?? ?? ?? + 8A 84 1D ?? ?? ?? ?? + 83 ?? ?? + 88 84 1D ?? ?? ?? ?? + 8A 84 1D ?? ?? ?? ?? + 83 ?? ?? + 88 84 1D ?? ?? ?? ?? + 8A 84 1D ?? ?? ?? ?? + 83 ?? ?? + 88 84 1D ?? ?? ?? ?? + 0F BE 8C 1D ?? ?? ?? ?? + 0F BE 84 1D ?? ?? ?? ?? + } + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + filesize < 1MB and filesize < 11MB and + #chunk_1 > 20 +} + \ No newline at end of file diff --git a/yara_rules/apt_nobelium_acrobox_downloader_apr2022.yar b/yara_rules/apt_nobelium_acrobox_downloader_apr2022.yar new file mode 100644 index 0000000..85a9324 --- /dev/null +++ b/yara_rules/apt_nobelium_acrobox_downloader_apr2022.yar @@ -0,0 +1,25 @@ +rule apt_nobelium_acrobox_downloader_apr2022 { + meta: + id = "77f7f01d-72a2-4b13-b23f-d938a415dd40" + version = "1.0" + description = "Detects AcroBox downloader" + author = "Sekoia.io" + creation_date = "2022-05-11" + classification = "TLP:CLEAR" + + strings: + $s1 = { 80 ?? 7B + 0F 84 ?? ?? 00 00 + 80 ?? ?? 0F + 0F 84 ?? ?? 00 00 + 80 ?? ?? 0F + 0F 84 ?? ?? 00 00 + 80 ?? ?? 0F + 0F 84 ?? ?? 00 00 } + + condition: + uint16be(0) == 0x4d5a and + filesize < 200KB and + all of ($s*) +} + \ No newline at end of file diff --git a/yara_rules/apt_nobelium_nativezone_gen.yar b/yara_rules/apt_nobelium_nativezone_gen.yar new file mode 100644 index 0000000..5cc42d0 --- /dev/null +++ b/yara_rules/apt_nobelium_nativezone_gen.yar @@ -0,0 +1,32 @@ +import "pe" + +rule apt_nobelium_nativezone_gen { + meta: + id = "e16cac97-38dd-4145-95f5-cf641940a19b" + version = "1.0" + description = "Detects NativeZone used in 2022" + author = "Sekoia.io" + creation_date = "2022-02-25" + classification = "TLP:CLEAR" + + strings: + $rich = { 52 69 63 68 [4] 00 } + $obs = { C7 85 [8] C7 85 } + $nobs = { C7 85 [6] 00 00 C7 85 } + + condition: + pe.DLL and + filesize < 2500KB and + pe.number_of_exports > 20 and + pe.number_of_imports < 30 and + ( + pe.imports("kernel32.dll", "VirtualAlloc") and + pe.imports("kernel32.dll", "VirtualProtect") + ) and for any i in (0..pe.number_of_sections - 1): + ( pe.sections[i].name == ".rdata" and + pe.sections[i].raw_data_size > 300000 ) + and #obs > 300 + and #nobs < 150 + and not $rich +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_clipog_strings.yar b/yara_rules/apt_oilrig_clipog_strings.yar new file mode 100644 index 0000000..b05f2bf --- /dev/null +++ b/yara_rules/apt_oilrig_clipog_strings.yar @@ -0,0 +1,21 @@ +rule apt_oilrig_clipog_strings { + meta: + id = "0ac40fd9-f67d-41fa-a774-77a3a1b7cac3" + version = "1.0" + description = "Detects OilRig's Clipog stealer" + author = "Sekoia.io" + creation_date = "2023-10-24" + classification = "TLP:CLEAR" + + strings: + $ = "[ClipBoard=" wide + $ = "[NUMPAD .]" wide + $ = "[SPACE]" wide + $ = "GetClipboardData" + + condition: + uint16be(0) == 0x4d5a + and filesize < 350KB + and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_maliciousdocument_may2022.yar b/yara_rules/apt_oilrig_maliciousdocument_may2022.yar new file mode 100644 index 0000000..e5c0645 --- /dev/null +++ b/yara_rules/apt_oilrig_maliciousdocument_may2022.yar @@ -0,0 +1,23 @@ +rule apt_oilrig_maliciousdocument_may2022 { + meta: + id = "cb4ab310-e24c-4edc-8804-0c49c30124fb" + version = "1.0" + description = "Detects OilRig Malicious Document" + author = "Sekoia.io" + creation_date = "2022-05-13" + classification = "TLP:CLEAR" + + strings: + $s1 = "InteractiveToken" + $s2 = "Select * From Win32_PingStatus Where Address" + $s3 = "She@et1" + $s4 = "_VBA_PROJECT" wide + $s5 = "This program cannot be run in DOS mode." base64 + $s6 = ".Agent.pdb" base64 + $s7 = "GetAgentID" base64 + + condition: + uint32be(0) == 0xD0CF11E0 and + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_odagent_strings.yar b/yara_rules/apt_oilrig_odagent_strings.yar new file mode 100644 index 0000000..317b51c --- /dev/null +++ b/yara_rules/apt_oilrig_odagent_strings.yar @@ -0,0 +1,22 @@ +rule apt_oilrig_odagent_strings { + meta: + id = "1c5c0eb5-7c6f-4a34-b2e2-4a7c6d7030d6" + version = "1.0" + description = "Detects ODAgent malware based on strings" + author = "Sekoia.io" + creation_date = "2023-12-20" + classification = "TLP:CLEAR" + + strings: + $ = "application/x-www-form-urlencoded" ascii wide + $ = "dly>" ascii wide + $ = "DELETE" ascii wide + $ = "nok!" ascii wide + $ = ".c:/content" ascii wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 5MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_oilbooster_strings.yar b/yara_rules/apt_oilrig_oilbooster_strings.yar new file mode 100644 index 0000000..4350ba9 --- /dev/null +++ b/yara_rules/apt_oilrig_oilbooster_strings.yar @@ -0,0 +1,21 @@ +rule apt_oilrig_oilbooster_strings { + meta: + id = "001d12bc-1e7e-4a6c-9172-66687d08d827" + version = "1.0" + description = "Detects OilBooster malware based on strings" + author = "Sekoia.io" + creation_date = "2023-12-20" + classification = "TLP:CLEAR" + + strings: + $ = "/rt.ovf" wide ascii + $ = "User-Agent: " wide ascii + $ = "/me/drive/items" wide ascii + $ = "client_secret" wide ascii + + condition: + uint16be(0) == 0x4d5a and + filesize < 5MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_powerexchange.yar b/yara_rules/apt_oilrig_powerexchange.yar new file mode 100644 index 0000000..bc37a0f --- /dev/null +++ b/yara_rules/apt_oilrig_powerexchange.yar @@ -0,0 +1,20 @@ +rule apt_oilrig_powerexchange { + meta: + id = "cb6b370f-7b05-480b-865e-ac81ded4a2a4" + version = "1.0" + description = "Detects OilRig's PowerExchange backdoor" + author = "Sekoia.io" + creation_date = "2023-10-24" + classification = "TLP:CLEAR" + + strings: + $ = "($h.value).PadRight((($h.value).Length+($h.value).Length%4),'='" ascii wide + $ = "(($h.value).Length%4 -ne 0)" ascii wide + $ = "-match \"@@(.*)@@\"" ascii wide + $ = "[Environment]::NewLine+$_.Exception.Message | Out-File -FilePath" ascii wide + $ = "ContainsSubjectStrings.Add(\"@@\")" ascii wide + + condition: + 2 of them and filesize < 50KB +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_saitama_backdoor_may2022.yar b/yara_rules/apt_oilrig_saitama_backdoor_may2022.yar new file mode 100644 index 0000000..1632601 --- /dev/null +++ b/yara_rules/apt_oilrig_saitama_backdoor_may2022.yar @@ -0,0 +1,21 @@ +rule apt_oilrig_saitama_backdoor_may2022 { + meta: + id = "4ea8c27f-c441-4616-a29b-2b5dfdd3bd20" + version = "1.0" + description = "Detects tje Saitama backdoor" + author = "Sekoia.io" + creation_date = "2022-05-13" + classification = "TLP:CLEAR" + + strings: + $ = { 7E [4] 7E [4] 59 0A 02 8E 69 06 28 [4] D1 0B 02 16 7E [4] 7E [4] 07 } + $ = "systeminfo | findstr" wide + $ = "powershell -exec bypass -enc" wide + $ = "SendAndReceive : {0}" wide + $ = "SleepSecond : Start" wide + + condition: + uint16be(0) == 0x4d5a and + 2 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_saitama_backdoor_may2022_2.yar b/yara_rules/apt_oilrig_saitama_backdoor_may2022_2.yar new file mode 100644 index 0000000..63df961 --- /dev/null +++ b/yara_rules/apt_oilrig_saitama_backdoor_may2022_2.yar @@ -0,0 +1,21 @@ +rule apt_oilrig_saitama_backdoor_may2022_2 { + meta: + id = "f885551a-d0f0-431d-aa4f-7caa93b1db6a" + version = "1.0" + description = "Detects Saitama backdoor variants" + author = "Sekoia.io" + creation_date = "2022-05-13" + classification = "TLP:CLEAR" + + strings: + $ = "_CorExeMain" + $ = "GetAgentID" + $ = "ComputeStringHash" + $ = ".Agent.pdb" + $ = "TaskExecTimeout" + + condition: + uint16be(0) == 0x4d5a and + 5 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_sc5kv3_strings.yar b/yara_rules/apt_oilrig_sc5kv3_strings.yar new file mode 100644 index 0000000..251fdfd --- /dev/null +++ b/yara_rules/apt_oilrig_sc5kv3_strings.yar @@ -0,0 +1,19 @@ +rule apt_oilrig_sc5kv3_strings { + meta: + id = "885ea13b-47b0-4a6d-8136-9b31abc9064a" + version = "1.0" + description = "Detects SC5kv3 malware based on strings" + author = "Sekoia.io" + creation_date = "2023-12-20" + classification = "TLP:CLEAR" + + strings: + $ = "no-reply this email!" ascii wide + $ = "The serial is " ascii wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 5MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_oilrig_webshell.yar b/yara_rules/apt_oilrig_webshell.yar new file mode 100644 index 0000000..868597f --- /dev/null +++ b/yara_rules/apt_oilrig_webshell.yar @@ -0,0 +1,19 @@ +rule apt_oilrig_webshell { + meta: + id = "53955117-5176-4682-89ad-1503faba42aa" + version = "1.0" + description = "Detects a webshell used by OilRig" + author = "Sekoia.io" + creation_date = "2024-10-23" + classification = "TLP:CLEAR" + + strings: + $ = "string d = com;" + $ = "string p = fu;" + $ = "#@rt12!@$$$nnMF##" + $ = "messi(d)))" + + condition: + 2 of them and filesize < 80KB +} + \ No newline at end of file diff --git a/yara_rules/apt_polonium_deepcreep_strings.yar b/yara_rules/apt_polonium_deepcreep_strings.yar new file mode 100644 index 0000000..ba2a890 --- /dev/null +++ b/yara_rules/apt_polonium_deepcreep_strings.yar @@ -0,0 +1,21 @@ +rule apt_polonium_deepcreep_strings { + meta: + id = "b04af229-2bea-4ee8-9e17-8e4befa06e3a" + version = "1.0" + description = "Tries to detect POLONIUM's DeepCreep implant" + author = "Sekoia.io" + creation_date = "2022-10-12" + classification = "TLP:CLEAR" + + strings: + $ = ";Invoke-Expression -Command '$shortcut =" ascii wide + $ = "CreateShortcut($c1" ascii wide + $ = "svchostdp.exe" ascii wide + $ = "HNlIC91IA==" ascii wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 3MB and + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_polonium_megacreep_strings.yar b/yara_rules/apt_polonium_megacreep_strings.yar new file mode 100644 index 0000000..464fb32 --- /dev/null +++ b/yara_rules/apt_polonium_megacreep_strings.yar @@ -0,0 +1,29 @@ +rule apt_polonium_megacreep_strings { + meta: + id = "927c5fd6-0574-43bf-8db9-6ecc328estrin56c7" + version = "1.0" + description = "Tries to detect POLONIUM's MegaCreep implant" + author = "Sekoia.io" + creation_date = "2022-10-12" + classification = "TLP:CLEAR" + + strings: + $ = "[#!#]" ascii wide + $ = "[$$%$$]" ascii wide + $ = ".e##x##e" ascii wide + $ = "WHLib.dll" ascii wide + $ = "TestService.txt" ascii wide + $ = "X = Stop" ascii wide + $ = "Sess.dll" ascii wide + $ = "filepathOnTarget" ascii wide + $ = "FileNameOnMega" ascii wide + $ = "Missing Parameter.. Format of command:" ascii wide + $ = "Your Old K##E##Y is Wronge" ascii wide + $ = "Your Upgrage Is Success" ascii wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 2MB and + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_polonium_powershell_creepydrive_strings.yar b/yara_rules/apt_polonium_powershell_creepydrive_strings.yar new file mode 100644 index 0000000..2cfe2f6 --- /dev/null +++ b/yara_rules/apt_polonium_powershell_creepydrive_strings.yar @@ -0,0 +1,25 @@ +rule apt_polonium_powershell_creepydrive_strings { + meta: + id = "0ba196bd-9cd6-4553-b7bf-69989cdb8be4" + version = "1.0" + description = "Detects POLONIUM CreepyDrive Powershell implant" + author = "Sekoia.io" + creation_date = "2022-06-03" + classification = "TLP:CLEAR" + + strings: + $ = "function Exec($comm)" base64 ascii wide + $ = "$comm = $comm + \"| outstring" base64 ascii wide + $ = "Invoke-Expression -Command:$comm" base64 ascii wide + $ = "microsoft.com" base64 ascii wide + $ = "$req = Invoke-WebRequest" base64 ascii wide + $ = "$j += $data" base64 ascii wide + $ = "$res = Exec($arr[$i])" base64 ascii wide + $ = "$arr = @(iex \"$req\")" base64 ascii wide + $ = "elseif ($req -cmatch" base64 ascii wide + $ = "graph.microsoft.com" base64 ascii wide + + condition: + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_polonium_technocreep_strings.yar b/yara_rules/apt_polonium_technocreep_strings.yar new file mode 100644 index 0000000..014327a --- /dev/null +++ b/yara_rules/apt_polonium_technocreep_strings.yar @@ -0,0 +1,28 @@ +rule apt_polonium_technocreep_strings { + meta: + id = "dad79df3-b081-458e-9c14-1d5e2b43ba91" + version = "1.1" + description = "Tries to detect TechnoCreep implant" + author = "Sekoia.io" + creation_date = "2022-10-12" + classification = "TLP:CLEAR" + + strings: + $ = "file name : " ascii wide + $ = "copy to : " ascii wide + $ = "download" ascii wide + $ = "persistence" ascii wide + $ = "/cmdResult created!" ascii wide + $ = "/downloadsResulat created!" ascii wide + $ = "Downloading will take minets..." ascii wide + $ = "powershell -Command \"$c1 = " ascii wide + $ = "Missing Parameter.. Format of command:" ascii wide + $ = "File Fath On Target Device Not Exists>" ascii wide + $ = "/MissingDownloadParameter.txt" ascii wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_qnapworm_loader_may2022.yar b/yara_rules/apt_qnapworm_loader_may2022.yar new file mode 100644 index 0000000..8500a50 --- /dev/null +++ b/yara_rules/apt_qnapworm_loader_may2022.yar @@ -0,0 +1,29 @@ +rule apt_qnapworm_loader_may2022 { + meta: + id = "c6e87a55-73ea-4df4-ab61-b5d34968d741" + version = "1.0" + description = "Detects the QNAPWorm loader" + author = "Sekoia.io" + creation_date = "2022-05-23" + classification = "TLP:CLEAR" + + strings: + $s1 = { + 66 C1 C0 05 + 0F B7 D8 + 81 C3 85 D0 FF FF + 66 C1 C3 02 + 0F B7 C3 + 0F B6 9A ?? ?? ?? ?? + 33 D8 + 88 1C 11 + 42 + 0F B6 D2 + 81 FA ?? 00 00 00 + } + + condition: + uint16be(0) == 0x4d5a and + all of ($s*) +} + \ No newline at end of file diff --git a/yara_rules/apt_queueseed.yar b/yara_rules/apt_queueseed.yar new file mode 100644 index 0000000..fc54f71 --- /dev/null +++ b/yara_rules/apt_queueseed.yar @@ -0,0 +1,29 @@ +rule apt_queueseed { + meta: + id = "35f7ffd5-4f6f-4b31-8d60-c713a15d14e8" + version = "1.0" + description = "Detects strings of Queueseed/Kapeka malware" + author = "Sekoia.io" + creation_date = "2024-04-22" + classification = "TLP:CLEAR" + + strings: + // Looking for strings with alignment + $ = {2D 00 6F 00 00 00} // '-o' + $ = {2D 00 62 00 63 00 00 00} //'-bc' + $ = {20 00 00 00 00 00 00 00} // ' ' + $ = {20 00 2D 00 77 00 00 00} // ' -w' + $ = {35 00 3A 00 20 00 00 00} // '5: ' + $ = {34 00 3A 00 20 00 00 00} // '4: ' + $ = {33 00 3A 00 20 00 00 00} // '3: ' + $ = {32 00 3A 00 20 00 00 00} // '2: ' + $ = {31 00 3A 00 20 00 00 00} // '1: ' + $ = {50 00 49 00 44 00 20 00 3A 00 20 00 00 00 00 00} // 'PID : ' + + + $ = "ExitCode : " wide + + condition: + uint16be(0) == 0x4d5a and all of them and filesize < 200KB +} + \ No newline at end of file diff --git a/yara_rules/apt_reaper_2fa_phishing_webpage.yar b/yara_rules/apt_reaper_2fa_phishing_webpage.yar new file mode 100644 index 0000000..cc5ed12 --- /dev/null +++ b/yara_rules/apt_reaper_2fa_phishing_webpage.yar @@ -0,0 +1,24 @@ +rule apt_reaper_2fa_phishing_webpage { + meta: + id = "348ca2ad-c8f9-4aed-8a27-95caa3a34f4b" + version = "1.0" + description = "Detects Reaper 2FA phishing webpage" + author = "Sekoia.io" + creation_date = "2023-03-09" + classification = "TLP:CLEAR" + + strings: + $ = "setTimeout(checkUpload," + $ = "commChannel.addListener(" + $ = "else if(commType ==" + $ = "?dir=DOWN&method=READ&id=" + $ = "Content : base64_encode(upload_data)" + $ = "$.post(upHttpRelayer" + $ = "var ablyUpData = {" + $ = "initComm();" + $ = "function Next(arg) {" + + condition: + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_reaper_malicious_lnk.yar b/yara_rules/apt_reaper_malicious_lnk.yar new file mode 100644 index 0000000..366d5f9 --- /dev/null +++ b/yara_rules/apt_reaper_malicious_lnk.yar @@ -0,0 +1,16 @@ +rule apt_reaper_malicious_lnk { + meta: + id = "8f055d1b-5727-4d77-9671-cdbb1ea69d5f" + version = "1.0" + author = "Sekoia.io" + creation_date = "2023-09-12" + classification = "TLP:CLEAR" + + strings: + $ = "*rshell.exe" wide + $ = "/od') do call" wide + + condition: + uint32be(0) == 0x4c000000 and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_redhotel_maliciouslnk_strings.yar b/yara_rules/apt_redhotel_maliciouslnk_strings.yar new file mode 100644 index 0000000..1f1904f --- /dev/null +++ b/yara_rules/apt_redhotel_maliciouslnk_strings.yar @@ -0,0 +1,26 @@ +rule apt_redhotel_maliciouslnk_strings { + meta: + id = "df2f0002-7921-4378-a936-ea0de5fbfa5a" + version = "1.0" + description = "Detects RedHotel's malicious LNKs" + author = "Sekoia.io" + creation_date = "2024-09-06" + classification = "TLP:CLEAR" + hash = "8e2c17040ec78cbcdc07bb2cf9dd7e01" + hash = "dc613a519e515ca817fdfb88f81fc9d7" + hash = "6f7d85c196c277a6a619f6d94b8f69b9" + hash = "b04d484d1e1d793b04af2a5fb88a8a57" + + strings: + $ = "desktop-" ascii + $ = ".\\1.docx" wide + $ = ".\\1.pdf" wide + $ = ".\\1.doc" wide + $ = ".\\1.ppt" wide + $ = ".\\1.pptx" wide + $ = "MACOS" wide + + condition: + uint32be(0) == 0x4c000000 and 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_rusticweb_stealer.yar b/yara_rules/apt_rusticweb_stealer.yar new file mode 100644 index 0000000..6fd6df3 --- /dev/null +++ b/yara_rules/apt_rusticweb_stealer.yar @@ -0,0 +1,20 @@ +rule apt_rusticweb_stealer { + meta: + id = "813072e0-28de-4cb7-b2cc-71d77a1e8508" + version = "1.0" + description = "Detects stealer used by RusticWeb" + author = "Sekoia.io" + creation_date = "2024-01-09" + classification = "TLP:CLEAR" + + strings: + $s1 = "-FTT=@" + $s2 = "https://oshi.at" + $s3 = "curl-T" + $s4 = "upload/upload.php" + $s5 = "cargo" + + condition: + uint16be(0) == 0x4d5a and filesize < 4MB and 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sandworm_awfulshred_obfuscation_apr2022.yar b/yara_rules/apt_sandworm_awfulshred_obfuscation_apr2022.yar new file mode 100644 index 0000000..7769143 --- /dev/null +++ b/yara_rules/apt_sandworm_awfulshred_obfuscation_apr2022.yar @@ -0,0 +1,17 @@ +rule apt_sandworm_awfulshred_obfuscation_apr2022 { + meta: + id = "52317e6b-7f2c-4c2a-bcfc-ebb4ab4c728e" + version = "1.0" + description = "Detects the AWFULSHRED wiper used by Sandworm" + author = "Sekoia.io" + creation_date = "2022-04-12" + classification = "TLP:CLEAR" + + strings: + $h = "#!/bin/bash" + $s = { 64 65 63 6c 61 72 65 20 2d 72 20 [8] 3d } + + condition: + $h at 0 and #s > 15 +} + \ No newline at end of file diff --git a/yara_rules/apt_sandworm_caddywiper_stacked_strings.yar b/yara_rules/apt_sandworm_caddywiper_stacked_strings.yar new file mode 100644 index 0000000..8f9824f --- /dev/null +++ b/yara_rules/apt_sandworm_caddywiper_stacked_strings.yar @@ -0,0 +1,75 @@ +rule apt_sandworm_caddywiper_stacked_strings { + meta: + id = "7750c4b6-5781-4b1c-8200-cbce9f18aa56" + version = "2.0" + description = "Detects stacked strings used in the wiper." + author = "Sekoia.io" + creation_date = "2022-04-06" + classification = "TLP:CLEAR" + + strings: + $ = { C6 45 ?? 6E + C6 45 ?? 65 + C6 45 ?? 74 + C6 45 ?? 61 + C6 45 ?? 70 + C6 45 ?? 69 + C6 45 ?? 33 + C6 45 ?? 32 + C6 45 ?? 2E + C6 45 ?? 64 + C6 45 ?? 6C + C6 45 ?? 6C } + $ = { C6 45 ?? 44 + C6 45 ?? 65 + C6 45 ?? 76 + C6 45 ?? 69 + C6 45 ?? 63 + C6 45 ?? 65 + C6 45 ?? 49 + C6 45 ?? 6F + C6 45 ?? 43 + C6 45 ?? 6F + C6 45 ?? 6E + C6 45 ?? 74 + C6 45 ?? 72 + C6 45 ?? 6F + C6 45 ?? 6C } + $ = { C6 45 ?? 5C + C6 45 ?? 00 + C6 45 ?? 5C + C6 45 ?? 00 + C6 45 ?? 2E + C6 45 ?? 00 + C6 45 ?? 5C + C6 45 ?? 00 + C6 45 ?? 50 + C6 45 ?? 00 + C6 45 ?? 48 + C6 45 ?? 00 + C6 45 ?? 59 + C6 45 ?? 00 + C6 45 ?? 53 + C6 45 ?? 00 + C6 45 ?? 49 + C6 45 ?? 00 + C6 45 ?? 43 + C6 45 ?? 00 + C6 45 ?? 41 + C6 45 ?? 00 + C6 45 ?? 4C + C6 45 ?? 00 + C6 45 ?? 44 + C6 45 ?? 00 + C6 45 ?? 52 + C6 45 ?? 00 + C6 45 ?? 49 + C6 45 ?? 00 + C6 45 ?? 56 + C6 45 ?? 00 + C6 45 ?? 45 } + + condition: + uint16be(0) == 0x4d5a and 2 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sandworm_notpetya_strings.yar b/yara_rules/apt_sandworm_notpetya_strings.yar new file mode 100644 index 0000000..dc5f62c --- /dev/null +++ b/yara_rules/apt_sandworm_notpetya_strings.yar @@ -0,0 +1,22 @@ +rule apt_sandworm_notpetya_strings { + meta: + id = "c6021638-1b59-4d20-a29d-95cabf256a28" + version = "1.0" + description = "Detects NotPetya worm" + author = "Sekoia.io" + creation_date = "2022-04-15" + classification = "TLP:CLEAR" + + strings: + $ = "wevtutil cl Security &" wide + $ = "wevtutil cl System &" wide + $ = "u%s \\%s -accepteula -s" wide + $ = "\\\\%ws\\admin$\\%ws" wide + $ = "\\\\%s\\admin$" wide + $ = "C:\\Windows\\System32\\rundll32.exe \"C:\\Windows\\%s\",#1" wide + + condition: + uint16be(0) == 0x4d5a and + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sandworm_olympicdestroyer.yar b/yara_rules/apt_sandworm_olympicdestroyer.yar new file mode 100644 index 0000000..a24d620 --- /dev/null +++ b/yara_rules/apt_sandworm_olympicdestroyer.yar @@ -0,0 +1,22 @@ +rule apt_sandworm_olympicdestroyer { + meta: + id = "6820eb32-fea2-4a00-a5a2-672ba09f8206" + version = "1.0" + description = "Detects OlympicDestroyer malware" + author = "Sekoia.io" + creation_date = "2022-04-15" + classification = "TLP:CLEAR" + + strings: + $ = "cmd.exe /c (ping 0.0.0.0 > nul)" wide + $ = "if exist %programdata%\\evtchk.txt" wide + $ = "\\\\.\\pipe\\%ls" wide + $ = "%ProgramData%\\%COMPUTERNAME%.exe" wide + $ = "(exit 5) else ( type nul >" wide + $ = "Select * From Win32_ProcessStopTrace" nocase + + condition: + uint16be(0) == 0x4d5a and + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sandworm_orcshred_apr2022.yar b/yara_rules/apt_sandworm_orcshred_apr2022.yar new file mode 100644 index 0000000..1af6081 --- /dev/null +++ b/yara_rules/apt_sandworm_orcshred_apr2022.yar @@ -0,0 +1,19 @@ +rule apt_sandworm_orcshred_apr2022 { + meta: + id = "1a88800c-29e1-4e2c-8374-f5a93dd9fd91" + version = "1.0" + description = "Detects the ORCSHRED script" + author = "Sekoia.io" + creation_date = "2022-04-12" + classification = "TLP:CLEAR" + + strings: + $ = "find /etc -name os-release >" + $ = "/bin/bash /var/" + $ = "crontab -l >" + $ = ".sh & disown" + + condition: + 3 of them and filesize < 2KB +} + \ No newline at end of file diff --git a/yara_rules/apt_sandworm_powergap_apr2022.yar b/yara_rules/apt_sandworm_powergap_apr2022.yar new file mode 100644 index 0000000..130b0b1 --- /dev/null +++ b/yara_rules/apt_sandworm_powergap_apr2022.yar @@ -0,0 +1,21 @@ +rule apt_sandworm_powergap_apr2022 { + meta: + id = "2a1c7f02-92b3-45b8-a710-253b1a28fe85" + version = "1.0" + description = "Detects the POWERGAP malware" + author = "Sekoia.io" + creation_date = "2022-04-12" + classification = "TLP:CLEAR" + + strings: + $ = "Get-WmiObject Win32 ComputerSystem).Domain" nocase wide ascii + $ = "Write-Host \"Error1" nocase wide ascii + $ = "Write-Host \"Done\" -ForegroundColor Red" nocase wide ascii + $ = "sysvol\\$Domain\\Poicies\\$GpoGuid" nocase wide ascii + $ = "Function Start-work" nocase wide ascii + $ = "Domain: {0}\" -f $Domain)" nocase wide ascii + + condition: + filesize < 3KB and 5 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_scanbox_framework_not_obfuscated.yar b/yara_rules/apt_scanbox_framework_not_obfuscated.yar new file mode 100644 index 0000000..77cd8d7 --- /dev/null +++ b/yara_rules/apt_scanbox_framework_not_obfuscated.yar @@ -0,0 +1,24 @@ +rule apt_scanbox_framework_not_obfuscated { + meta: + id = "4790f122-89de-4f7b-a25f-9ac7b1af8333" + version = "1.0" + description = "Detects the non obfuscated version of ScanBox" + author = "Sekoia.io" + creation_date = "2022-09-01" + classification = "TLP:CLEAR" + + strings: + $ = "php?m=a&data=" + $ = "php?m=p&data=" + $ = ".fun.split_data = function" + $ = ".php?data=" + $ = ".php?m=b" + $ = "basic.apipath" + $ = ".info.seed =" + $ = "loadjs =" + $ = "info.color = screen.colorDepth" + + condition: + 5 of them and filesize < 500KB +} + \ No newline at end of file diff --git a/yara_rules/apt_scanbox_obfuscated_versions.yar b/yara_rules/apt_scanbox_obfuscated_versions.yar new file mode 100644 index 0000000..97f5dcc --- /dev/null +++ b/yara_rules/apt_scanbox_obfuscated_versions.yar @@ -0,0 +1,21 @@ +rule apt_scanbox_obfuscated_versions { + meta: + id = "2866cead-7f16-4895-80ef-aad6fb66e864" + version = "1.0" + description = "Detects obfuscated versions of the scanbox framework" + author = "Sekoia.io" + creation_date = "2022-09-01" + classification = "TLP:CLEAR" + + strings: + $ = "$_$_$_$__$_____$__$_$_$_$__$" + $ = "NztCm_NcDkh" + $ = "____$_$__$__$_______w____$_$__$__$_____i____$_$__$__$_____" + $ = "391,379,398,381,386" + $ = "plguinurl" + $ = "plugin_timeout*1000" + + condition: + 2 of them and filesize < 500KB +} + \ No newline at end of file diff --git a/yara_rules/apt_shadowpad_first_called_function.yar b/yara_rules/apt_shadowpad_first_called_function.yar new file mode 100644 index 0000000..2b8161c --- /dev/null +++ b/yara_rules/apt_shadowpad_first_called_function.yar @@ -0,0 +1,37 @@ +rule apt_shadowpad_first_called_function { + meta: + id = "3ce1ffd3-5c30-4b36-b7cc-c9fa873ebc25" + version = "1.0" + description = "Detects entrypoint of shadowpad" + author = "Sekoia.io" + creation_date = "2023-01-30" + classification = "TLP:CLEAR" + + strings: + $chunk_1 = { + 48 83 EC 28 + 33 C9 + FF 15 ?? ?? ?? ?? + 8B 80 ?? ?? ?? ?? + 3B 05 ?? ?? ?? ?? + 74 ?? + E8 ?? ?? ?? ?? + E8 ?? ?? ?? ?? + EB ?? + 48 8B 0D ?? ?? ?? ?? + E8 ?? ?? ?? ?? + 8B C8 + FF 15 ?? ?? ?? ?? + 90 + B9 28 04 00 00 + FF 15 ?? ?? ?? ?? + 90 + 48 83 C4 28 + C3 + } + + condition: + uint16be(0) == 0x4d5a and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sidecopy_actionrat_packer_strings.yar b/yara_rules/apt_sidecopy_actionrat_packer_strings.yar new file mode 100644 index 0000000..2b79515 --- /dev/null +++ b/yara_rules/apt_sidecopy_actionrat_packer_strings.yar @@ -0,0 +1,20 @@ +rule apt_sidecopy_actionrat_packer_strings { + meta: + id = "b9370bd5-12e1-448e-a5b1-2acc72adc4a7" + version = "1.0" + description = "Detects SideCopy's ActionRAT (packer?)" + author = "Sekoia.io" + creation_date = "2023-05-11" + classification = "TLP:CLEAR" + + strings: + $ = "(HTTP/1\\.[01]) (\\d{3})(?: (.*?))?" + $ = "cpp-httplib/0.7" + $ = "\\HTTP Arsanel\\" + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sidecopy_cheex.yar b/yara_rules/apt_sidecopy_cheex.yar new file mode 100644 index 0000000..ea168e6 --- /dev/null +++ b/yara_rules/apt_sidecopy_cheex.yar @@ -0,0 +1,17 @@ +rule apt_sidecopy_cheex { + meta: + id = "e9b57f15-e703-4367-b501-fa8a873e4455" + version = "1.0" + description = "Detects PDB path of Cheex" + author = "Sekoia.io" + creation_date = "2024-08-14" + classification = "TLP:CLEAR" + hash = "825c7a1603f800ff247c8f3e9a1420af" + + strings: + $ = "C:\\Users\\Dead Snake\\source\\repos\\cheex" ascii fullword + + condition: + uint16be(0) == 0x4d5a and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sidecopy_malicious_macro.yar b/yara_rules/apt_sidecopy_malicious_macro.yar new file mode 100644 index 0000000..3f07e9d --- /dev/null +++ b/yara_rules/apt_sidecopy_malicious_macro.yar @@ -0,0 +1,22 @@ +rule apt_sidecopy_malicious_macro { + meta: + id = "4b90c33e-48d4-48b6-87a7-c35686e7e913" + version = "1.0" + description = "Detects malicious macro used by SideCopy" + author = "Sekoia.io" + creation_date = "2023-05-11" + classification = "TLP:CLEAR" + + strings: + $ = "htmlFile$" + $ = "Gecko/20100101 Firefox/91.0" + $ = "Start Menu\\Programs\\Startup\\" + $ = "Document_Close" + $ = "ThisDocument" wide + $ = "ServerXMLHTTP.6.0" + + condition: + uint32be(0) == 0xD0CF11E0 and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sidecopy_reverserat_strings.yar b/yara_rules/apt_sidecopy_reverserat_strings.yar new file mode 100644 index 0000000..ccf87b5 --- /dev/null +++ b/yara_rules/apt_sidecopy_reverserat_strings.yar @@ -0,0 +1,24 @@ +rule apt_sidecopy_reverserat_strings { + meta: + id = "383397c9-fd4a-4255-a8f2-27683bdbb7f7" + version = "1.0" + description = "Detects SideCopy's ReverseRAT" + author = "Sekoia.io" + creation_date = "2023-05-11" + classification = "TLP:CLEAR" + + strings: + $ = "downloadexe" wide + $ = "creatdir" wide + $ = "regnewkey" wide + $ = "reglist" wide + $ = "regdelkey" wide + $ = "clipboardset" wide + $ = "shellexec" wide + $ = "SELECT maxclockspeed, datawidth, name, manufacturer FROM Win32_Processor" wide + + condition: + uint16be(0) == 0x4d5a and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_sofacy_graphitemalware_generic.yar b/yara_rules/apt_sofacy_graphitemalware_generic.yar new file mode 100644 index 0000000..568a15f --- /dev/null +++ b/yara_rules/apt_sofacy_graphitemalware_generic.yar @@ -0,0 +1,26 @@ +import "pe" + +rule apt_sofacy_graphitemalware_generic { + meta: + id = "6b51cfa3-4a7d-4c2a-9fd9-f129b8a18466" + version = "1.0" + description = "Detects APT28 graphite malware based on strings" + author = "Sekoia.io" + creation_date = "2022-09-27" + classification = "TLP:CLEAR" + + strings: + $ = "Microsoft Enhanced RSA and AES Cryptographic Provider" wide + $ = "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)" wide + $ = "%s %04d sp%1d.%1d %s" + $ = "%s%c%s%c%s" + $ = "InternetReadFile" + $ = "ObtainUserAgentString" + $ = "CryptImportKey" + + condition: + uint16be(0) == 0x4d5a and + filesize < 100KB and + ( all of them or pe.imphash() == "c56c322548250651361aef7dacf93eaf" ) +} + \ No newline at end of file diff --git a/yara_rules/apt_spikedwine_malicious_hta.yar b/yara_rules/apt_spikedwine_malicious_hta.yar new file mode 100644 index 0000000..96ceafb --- /dev/null +++ b/yara_rules/apt_spikedwine_malicious_hta.yar @@ -0,0 +1,18 @@ +rule apt_spikedwine_malicious_hta { + meta: + id = "e4526142-d98a-bf35-9d2c-ca2e83638c4b" + version = "1.0" + description = "Detects malicious HTA used by SPIKEDWINE" + author = "Sekoia.io" + creation_date = "2024-02-29" + classification = "TLP:CLEAR" + + strings: + $ = " 1MB and + 5 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_unc4990_emptyspace_pyc.yar b/yara_rules/apt_unc4990_emptyspace_pyc.yar new file mode 100644 index 0000000..0ace5f7 --- /dev/null +++ b/yara_rules/apt_unc4990_emptyspace_pyc.yar @@ -0,0 +1,44 @@ +rule apt_unc4990_emptyspace_pyc { + meta: + id = "d970fd9c-1ce5-471c-96a1-146250f36b89" + version = "1.0" + description = "Detects Python Bytecode of EmptySpace" + author = "Sekoia.io" + creation_date = "2024-02-01" + classification = "TLP:CLEAR" + + strings: + $ = "PYBOOTSTRAP" + $ = "http://google.com/generate_204" + $ = "from" + $ = "pathZ" + $ = "usernamez" + $ = "timeZ" + $ = "win32api" + $ = "base64Z" + $ = "json" + $ = "marshalZ" + $ = "BOOTSTRAP_VERSION" + $ = "getZ" + $ = "sleepZ b64encode" + $ = "dumps" + $ = "executableZ" + $ = "GetUserNameExZ" + $ = "NameSamCompatible" + $ = "encode" + $ = "decodeZ" + $ = "request_dataZ" + $ = "server" + $ = "post" + $ = "raise_for_status" + $ = "exec" + $ = "loadsZ b64decode" + $ = "text" + $ = "globals" + $ = "bootstrap.py" + $ = "" + + condition: + uint32be(0) == 0x420d0d0a and all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_unc4990_explorer_ps1.yar b/yara_rules/apt_unc4990_explorer_ps1.yar new file mode 100644 index 0000000..63b0f20 --- /dev/null +++ b/yara_rules/apt_unc4990_explorer_ps1.yar @@ -0,0 +1,20 @@ +rule apt_unc4990_explorer_ps1 { + meta: + id = "2e1abbbf-f9b7-4147-b7da-3544cbc4a5f1" + version = "1.0" + description = "Detects powershell script (explorer.ps1)" + author = "Sekoia.io" + creation_date = "2024-02-01" + classification = "TLP:CLEAR" + + strings: + $s0 = "$(get-location).Path" + $s1 = "+ \"\\Runtime Broker.exe" + $s2 = "Start-Process -FilePath" + $s3 = "-Wait;" + $s4 = "Start-Sleep -s" + + condition: + all of them and @s3-@s2 < 35 +} + \ No newline at end of file diff --git a/yara_rules/apt_unc4990_explorer_ps1_reverse_b64.yar b/yara_rules/apt_unc4990_explorer_ps1_reverse_b64.yar new file mode 100644 index 0000000..11d97a2 --- /dev/null +++ b/yara_rules/apt_unc4990_explorer_ps1_reverse_b64.yar @@ -0,0 +1,18 @@ +rule apt_unc4990_explorer_ps1_reverse_b64 { + meta: + id = "35c3ffb2-2ced-426c-ac3f-a8cd0c357672" + version = "1.0" + description = "Detects reverse base64 files (explorer.ps1)" + author = "Sekoia.io" + creation_date = "2024-02-01" + classification = "TLP:CLEAR" + + strings: + $s0 = "Invoke-Expression ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String(\"" + $s1 = "Wa1VHJ\"[-1..-" + $s2 = "-join '')))" + + condition: + all of them and $s0 at 0 and @s2 - @s2 < 20 +} + \ No newline at end of file diff --git a/yara_rules/apt_unk_batcopier_strings.yar b/yara_rules/apt_unk_batcopier_strings.yar new file mode 100644 index 0000000..015cb4e --- /dev/null +++ b/yara_rules/apt_unk_batcopier_strings.yar @@ -0,0 +1,19 @@ +rule apt_unk_batcopier_strings { + meta: + id = "eb76bbd0-a722-4fec-a4a7-c48c70a1880b" + version = "1.0" + description = "Detects BatCopier variant" + author = "Sekoia.io" + creation_date = "2024-09-06" + classification = "TLP:CLEAR" + reference = "https://www.seqrite.com/blog/operation-oxidovy-sophisticated-malware-campaign-targets-czech-officials-using-nato-themed-decoys/" + + strings: + $ = "@echo off" + $ = "echo F|xcopy" + $ = "attrib +r +s +h" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/apt_unk_dex_china_freedom_trap_spyware.yar b/yara_rules/apt_unk_dex_china_freedom_trap_spyware.yar new file mode 100644 index 0000000..bd54466 --- /dev/null +++ b/yara_rules/apt_unk_dex_china_freedom_trap_spyware.yar @@ -0,0 +1,32 @@ +rule apt_unk_dex_china_freedom_trap_spyware { + meta: + id = "3d66b6b8-8397-441a-a337-4a282df39591" + version = "1.0" + description = "Detects China Freedom Trap spyware dex file" + author = "Sekoia.io" + creation_date = "2022-09-07" + classification = "TLP:CLEAR" + hash = "ceb70fce74898ea64ded6880a978441c" + + strings: + $ = "INSTALL" base64 + $ = "FAILED" base64 + $ = "TEST" base64 + $ = "ONLY" base64 + $ = "INSTALL" base64 + $ = "INCONSISTENT" base64 + $ = "CERTIFICATES" base64 + $ = "Network country iso:" base64 + $ = "Network operator name:" base64 + $ = "SIM operator name:" base64 + $ = "SIM country iso:" base64 + $ = "SIM state:" base64 + $ = "PIN REQUIRED" base64 + $ = "PUK REQUIRED" base64 + + condition: + uint32be(0) == 0x6465780A and + filesize < 100KB and + 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_unk_hrserv_memory_commands_strings.yar b/yara_rules/apt_unk_hrserv_memory_commands_strings.yar new file mode 100644 index 0000000..dc981d4 --- /dev/null +++ b/yara_rules/apt_unk_hrserv_memory_commands_strings.yar @@ -0,0 +1,20 @@ +rule apt_unk_hrserv_memory_commands_strings { + meta: + id = "1b5f442a-e758-4bd5-a612-8b504a542d29" + version = "1.0" + description = "Detects HrServ web shell memory commands" + author = "Sekoia.io" + creation_date = "2023-11-23" + classification = "TLP:CLEAR" + + strings: + $ = "list all the process" ascii wide + $ = "equal with cmd /c tasklist" ascii wide + $ = "start target service by name" ascii wide + $ = "query local process information by wmi." ascii wide + $ = "upload local shellcode to" ascii wide + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_unk_hrserv_webshell_strings.yar b/yara_rules/apt_unk_hrserv_webshell_strings.yar new file mode 100644 index 0000000..093c0f0 --- /dev/null +++ b/yara_rules/apt_unk_hrserv_webshell_strings.yar @@ -0,0 +1,24 @@ +rule apt_unk_hrserv_webshell_strings { + meta: + id = "684fd41c-9ea6-4f4e-8db4-82325a2ff80b" + version = "1.0" + description = "Detects HrServ web shell based on strings" + author = "Sekoia.io" + creation_date = "2023-11-23" + classification = "TLP:CLEAR" + + strings: + $ = "open file error!" + $ = "create file error!" + $ = "[!] CreatePipe failed." + $ = "[!] CreateProcess failed." + $ = "[!] CreateProcess success,no result return." + $ = "; cadataIV=" + $ = "cadataKey=" + + condition: + uint16be(0) == 0x4d5a and + filesize < 300KB and + 5 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_unk_malicious_lnk.yar b/yara_rules/apt_unk_malicious_lnk.yar new file mode 100644 index 0000000..9a49b6a --- /dev/null +++ b/yara_rules/apt_unk_malicious_lnk.yar @@ -0,0 +1,22 @@ +rule apt_unk_malicious_lnk { + meta: + id = "d2248803-7ddf-4cde-ab6a-78b20e760919" + version = "1.0" + description = "Detects a malicious LNK used by an APT" + author = "Sekoia.io" + creation_date = "2024-09-06" + classification = "TLP:CLEAR" + hash = "a8d7e56eb01a8cf576533db9af2e92ec" + reference = "https://www.seqrite.com/blog/operation-oxidovy-sophisticated-malware-campaign-targets-czech-officials-using-nato-themed-decoys/" + + strings: + $ = ".pdf.lnkPK" + $ = ".jfifPK" + $ = ".batPK" + $ = ".pdfPK" + + condition: + uint32be(0) == 0x504b0304 and + all of them +} + \ No newline at end of file diff --git a/yara_rules/apt_unknown_sessionmanageriis_strings.yar b/yara_rules/apt_unknown_sessionmanageriis_strings.yar new file mode 100644 index 0000000..fb698e8 --- /dev/null +++ b/yara_rules/apt_unknown_sessionmanageriis_strings.yar @@ -0,0 +1,24 @@ +rule apt_unknown_sessionmanageriis_strings { + meta: + id = "7d55dd82-509f-444d-a1ba-6417b51f392f" + version = "1.0" + description = "Detects the IIS SessionManager backdoor" + author = "Sekoia.io" + creation_date = "2022-07-04" + classification = "TLP:CLEAR" + + strings: + $ = "Wokring OK" + $ = "Delete File Success :" + $ = "Delete File Error :" + $ = "SM_SESSION=" + $ = "SM_SESSIONID" + $ = "attachment; filename =" + $ = "CHttpModule::" + + condition: + uint16be(0) == 0x4d5a and + filesize > 100KB and filesize < 400KB and + 4 of them +} + \ No newline at end of file diff --git a/yara_rules/apt_uta0178_javascript_inclusion_strings.yar b/yara_rules/apt_uta0178_javascript_inclusion_strings.yar new file mode 100644 index 0000000..ccfb950 --- /dev/null +++ b/yara_rules/apt_uta0178_javascript_inclusion_strings.yar @@ -0,0 +1,24 @@ +rule apt_uta0178_javascript_inclusion_strings { + meta: + id = "af816c35-1f00-47ea-86ee-c034607c625e" + version = "1.0" + description = "Detects UTA0178 malicious inclusion strings" + author = "Sekoia.io" + creation_date = "2024-01-12" + classification = "TLP:CLEAR" + + strings: + $s0 = ".value" + $s1 = "btoa(" + $s2 = "https://" + $s3 = "new XMLHttpRequest();" + $s4 = ".send(null);" + + condition: + @s0 < @s1 and + @s1 < @s2 and + @s2 < @s3 and + @s3 < @s4 and + @s4-@s0 < 350 +} + \ No newline at end of file diff --git a/yara_rules/apt_uta0218_upstyle_backdoor_strings.yar b/yara_rules/apt_uta0218_upstyle_backdoor_strings.yar new file mode 100644 index 0000000..5ed392a --- /dev/null +++ b/yara_rules/apt_uta0218_upstyle_backdoor_strings.yar @@ -0,0 +1,28 @@ +rule apt_uta0218_upstyle_backdoor_strings { + meta: + id = "098fbad7-efaf-4198-83de-208c2ae16f89" + version = "1.0" + description = "Detects UPSTYLE backdoor" + author = "Sekoia.io" + creation_date = "2024-04-16" + classification = "TLP:CLEAR" + + strings: + $s1_1 = "f.write(b'''import base64;exec(base64.b64decode(b" ascii + $s1_2 = "atime=os.path.getatime(" ascii + + $s2_1 = "exec(base64.b64decode(functioncode))" ascii base64 + $s2_2 = "os.path.exists(systempth):" ascii base64 + $s2_3 = ".read().replace(b\"\\x00\",b\" \")" ascii base64 + + $s3_1 = "if WRITE_FLAG:" ascii base64 + $s3_2 = "re.search(SHELL_PATTERN" ascii base64 + $s3_3 = "import threading,time,os,re,base64" ascii base64 + + condition: + filesize < 1500 and + (2 of ($s1_*) or + 2 of ($s2_*) or + 2 of ($s3_*) ) +} + \ No newline at end of file diff --git a/yara_rules/apt_win_disabledefender.yar b/yara_rules/apt_win_disabledefender.yar new file mode 100644 index 0000000..539e1e3 --- /dev/null +++ b/yara_rules/apt_win_disabledefender.yar @@ -0,0 +1,21 @@ +import "pe" + +rule apt_win_disabledefender { + meta: + id = "a7b124ab-4c9d-47c0-a59e-211cc713b9b3" + version = "1.0" + description = "detects strings and imphash" + author = "Sekoia.io" + creation_date = "2022-09-23" + classification = "TLP:CLEAR" + + strings: + $ = "Restarting with privileges" + $ = "Windows defender is currently ACTIVE" + $ = "Windows defender is currently OFF" + $ = "Disabled windows defender" + $ = "Failed to disable defender..." + + condition: 4 of them or pe.imphash() == "74a6ef9e7b49c71341e439022f643c8e" +} + \ No newline at end of file diff --git a/yara_rules/apt_windows_wip19_screencap.yar b/yara_rules/apt_windows_wip19_screencap.yar new file mode 100644 index 0000000..39c710b --- /dev/null +++ b/yara_rules/apt_windows_wip19_screencap.yar @@ -0,0 +1,19 @@ +import "pe" +import "hash" + +rule apt_windows_wip19_screencap { + meta: + id = "ebf5d2c5-81c9-45c3-aa61-05870f800f6b" + version = "1.0" + description = "Detects ScreenCap resource" + author = "Sekoia.io" + creation_date = "2022-10-18" + classification = "TLP:CLEAR" + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and + for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "89f4d0e3f7f3318270aa9c8345c1402202b1a02ffefc03c7a86636e297aa0ffc" + ) and filesize < 2MB +} + \ No newline at end of file diff --git a/yara_rules/apt_yemen_apk_guardzoo.yar b/yara_rules/apt_yemen_apk_guardzoo.yar new file mode 100644 index 0000000..dfbc56e --- /dev/null +++ b/yara_rules/apt_yemen_apk_guardzoo.yar @@ -0,0 +1,41 @@ +rule apt_yemen_apk_guardzoo { + meta: + id = "f4004e7c-2904-46ea-a3e6-2bdd3e704fea" + version = "1.0" + description = "Detects Dex files containing GuardZoo strings." + author = "Sekoia.io" + creation_date = "2024-08-09" + classification = "TLP:CLEAR" + hash = "3afad114c68489e2d294720339baf570" + hash = "c59d0f5c8d00485199f147b96c5abca0" + hash = "75c58948725133160085dc1cfdf602ec" + hash = "d76a39ee85263900f7e6eaacb804f5e2" + hash = "51356c95dfe1221c0f4ca2475bc787f8" + hash = "1d0dd8201c051d9c8d2c945c8b31a48c" + hash = "b7b6be5e8eec44dd13e1df1f3908fcf0" + hash = "229984f004578a8fa643afb881d81e8c" + hash = "f3f1ccb3912c49a0a6ea710a0bd856de" + hash = "a3f8365bfa5f8185e8c7eba8efc63165" + hash = "7392deaf81ddf50b8a6f2179538f7e81" + hash = "c40d56e1586f9fa382c688d624d25525" + hash = "629fb04b91c4db4ea282440e20317dab" + hash = "bcebc41628196f8bd119f72e1e8eb47c" + hash = "f1cfdc9e91c3a20563246cf366b94f10" + hash = "a75ffb11adbace40a7c59128adba43ad" + + strings: + $classes_1 = "GuardZoo.java" + $classes_2 = "com/animals" + $path_1 = "&Password=" + $path_2 = "&Coordinates=" + $path_3 = "&Data=" + $path_4 = "&Device=" + $path_5 = "&ISPICTURE=" + $path_6 = "&Phone_Number=" + $path_7 = "&Provider=" + + condition: + uint32be(0) == 0x6465780a and filesize < 10MB and + ((any of ($classes_*)) and (3 of ($path_*))) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_blueshell.yar b/yara_rules/backdoor_blueshell.yar new file mode 100644 index 0000000..9f20439 --- /dev/null +++ b/yara_rules/backdoor_blueshell.yar @@ -0,0 +1,24 @@ +rule backdoor_blueshell { + meta: + id = "8f1cd966-c4d8-44f9-8cd5-4f5277332546" + version = "1.0" + description = "Detects BlueShell backdoor" + author = "Sekoia.io" + creation_date = "2023-09-08" + classification = "TLP:CLEAR" + + strings: + $s1 = "BlueShell" ascii + $s2 = "client.go" ascii + $s3 = "server ip" ascii + $s4 = "server port" ascii + $s5 = "reconnect wait time" ascii + $s6 = "shell" ascii + $s7 = "socks" ascii + $s8 = "socks5" ascii + $s9 = "GetInteractiveShell" ascii + + condition: + filesize < 11MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_lin_bifrost.yar b/yara_rules/backdoor_lin_bifrost.yar new file mode 100644 index 0000000..d57d817 --- /dev/null +++ b/yara_rules/backdoor_lin_bifrost.yar @@ -0,0 +1,21 @@ +rule backdoor_lin_bifrost { + meta: + id = "9726b5f5-8cc3-4fad-950b-f20cac04d496" + version = "1.0" + description = "Detect the Bifrost backdor based on strings" + author = "Sekoia.io" + creation_date = "2024-03-05" + classification = "TLP:CLEAR" + reference = "https://unit42.paloaltonetworks.com/new-linux-variant-bifrost-malware/" + hash1 = "8e85cb6f2215999dc6823ea3982ff4376c2cbea53286e95ed00250a4a2fe4729" + hash2 = "2aeb70f72e87a1957e3bc478e1982fe608429cad4580737abe58f6d78a626c05" + hash3 = "f2bef6bed27f4b527118dd62b4035003c14afaffa72729c8117f213623f644ec" + + strings: + $ = "%c2%s%c3%u%c4%u-%.2u-%.2u %.2u:%.2u" + $ = "%c1%s%c3D%c4%u-%.2u-%.2u %.2u:%.2u" + + condition: + uint32be(0) == 0x7f454c46 and all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_lin_bpfdoor.yar b/yara_rules/backdoor_lin_bpfdoor.yar new file mode 100644 index 0000000..d9f41d1 --- /dev/null +++ b/yara_rules/backdoor_lin_bpfdoor.yar @@ -0,0 +1,23 @@ +rule backdoor_lin_bpfdoor { + meta: + id = "1776ff6f-6fbb-4a81-bcad-c43b5117c67c" + version = "1.0" + description = "Detect the BPFDoor backdoor used by the Chinese TA Red Menshen" + author = "Sekoia.io" + creation_date = "2022-05-05" + classification = "TLP:CLEAR" + reference = "https://github.com/Neo23x0/signature-base/blob/master/yara/mal_lnx_implant_may22.yar" + + strings: + $op1 = { e8 ?? ff ff ff 80 45 ee 01 0f b6 45 ee 3b 45 d4 7c 04 c6 45 ee 00 80 45 ff 01 80 7d ff 00 } + $op2 = { 55 48 89 e5 48 83 ec 30 89 7d ec 48 89 75 e0 89 55 dc 83 7d dc 00 75 0? } + $op3 = { e8 a? fe ff ff 0f b6 45 f6 48 03 45 e8 0f b6 10 0f b6 45 f7 48 03 45 e8 0f b6 00 8d 04 02 } + $op4 = { c6 80 01 01 00 00 00 48 8b 45 c8 0f b6 90 01 01 00 00 48 8b 45 c8 88 90 00 01 00 00 c6 45 ef 00 0f b6 45 ef 88 45 ee } + + condition: + uint32(0)==0x464c457f + and filesize > 10KB + and filesize < 50KB + and (all of ($op*)) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_lin_sysupdate.yar b/yara_rules/backdoor_lin_sysupdate.yar new file mode 100644 index 0000000..a320c03 --- /dev/null +++ b/yara_rules/backdoor_lin_sysupdate.yar @@ -0,0 +1,21 @@ +rule backdoor_lin_sysupdate { + meta: + id = "9cb806cf-4ca1-44d8-809a-58cc5f364fb8" + version = "1.0" + description = "Detect the SysUpdate malware" + author = "Sekoia.io" + creation_date = "2023-03-01" + classification = "TLP:CLEAR" + + strings: + $ = "generate guid path=%s" + $ = "3rd/asio/include/asio/detail/posix_event.hpp" + $ = "expires_at" + $ = "%s -f %s" + $ = "expires_after" + $ = "-run" + + condition: + uint32(0)==0x464c457f and all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_mul_sparkrat.yar b/yara_rules/backdoor_mul_sparkrat.yar new file mode 100644 index 0000000..d3efa9c --- /dev/null +++ b/yara_rules/backdoor_mul_sparkrat.yar @@ -0,0 +1,60 @@ +rule backdoor_mul_sparkrat { + meta: + id = "cd818207-f8ec-41fa-abef-c29d481c7897" + version = "1.0" + description = "Detect SparkRAT using string found in the source code" + author = "Sekoia.io" + creation_date = "2023-01-30" + classification = "TLP:CLEAR" + reference = "https://github.com/XZB-1248/Spark" + + strings: + $ = "2006/01/02 15:04:05" wide ascii + $ = "can not find secret header" wide ascii + $ = "${i18n|COMMON.UNKNOWN_ERROR}" wide ascii + $ = "/api/client/update" wide ascii + $ = "application/octet-stream" wide ascii + $ = "${i18n|COMMON.OPERATION_NOT_SUPPORTED}" wide ascii + $ = "no IP address found" wide ascii + $ = "failed to read network io counters" wide ascii + $ = "failed to read cpu info" wide ascii + $ = "PING" wide ascii + $ = "OFFLINE" wide ascii + $ = "LOCK" wide ascii + $ = "LOGOFF" wide ascii + $ = "HIBERNATE" wide ascii + $ = "SUSPEND" wide ascii + $ = "RESTART" wide ascii + $ = "SHUTDOWN" wide ascii + $ = "SCREENSHOT" wide ascii + $ = "TERMINAL_INIT" wide ascii + $ = "TERMINAL_INPUT" wide ascii + $ = "TERMINAL_RESIZE" wide ascii + $ = "TERMINAL_PING" wide ascii + $ = "TERMINAL_KILL" wide ascii + $ = "FILES_LIST" wide ascii + $ = "FILES_FETCH" wide ascii + $ = "FILES_REMOVE" wide ascii + $ = "FILES_UPLOAD" wide ascii + $ = "FILE_UPLOAD_TEXT" wide ascii + $ = "PROCESSES_LIST" wide ascii + $ = "PROCESS_KILL" wide ascii + $ = "DESKTOP_INIT" wide ascii + $ = "DESKTOP_PING" wide ascii + $ = "DESKTOP_KILL" wide ascii + $ = "DESKTOP_SHOT" wide ascii + $ = "COMMAND_EXEC" wide ascii + $ = "DEVICE_UPDATE" wide ascii + $ = "${i18n|COMMON.INVALID_PARAMETER}" wide ascii + $ = "${i18n|EXPLORER.FILE_OR_DIR_NOT_EXIST}" wide ascii + $ = "SPARK COMMIT: " wide ascii + $ = "${i18n|COMMON.DISCONNECTED}" wide ascii + $ = "${i18n|DESKTOP.NO_DISPLAY_FOUND}" wide ascii + $ = "/api/bridge/push" wide ascii + $ = "${i18n|COMMON.OPERATION_NOT_SUPPORTED}" wide ascii + + condition: + 17 of them + and filesize > 4MB +} + \ No newline at end of file diff --git a/yara_rules/backdoor_mul_supershell_client.yar b/yara_rules/backdoor_mul_supershell_client.yar new file mode 100644 index 0000000..b9e4eb3 --- /dev/null +++ b/yara_rules/backdoor_mul_supershell_client.yar @@ -0,0 +1,22 @@ +rule backdoor_mul_supershell_client { + meta: + id = "3498ca9e-a165-4dda-bc15-2e5d6d43d9c1" + version = "1.0" + description = "Detect the Supershell client (unpacked) by looking for github references" + author = "Sekoia.io" + creation_date = "2024-04-25" + classification = "TLP:CLEAR" + hash1 = "a42906f8b392089fa1fe3ea264f6cb549ce5437b5ea253d9e1b8dd94bf115dad" + hash2 = "d97b41e8cd6b63cd55c9a4f99ccadf5a9141088319bc9eb467d96e54080f3c85" + hash3 = "2b54d1c064892a22f48b5742ba6da55bf62b73e5b1e0649e8b7880b286498735" + hash4 = "0dedab2ef8d44f9beef782a29dd8f628dd0218b90f23f729b315660437019ccd" + hash5 = "2484de7944889d784b8229f4fd756d3930e55c91654921019db4437877e30ab7" + + strings: + $ = "github.com/NHAS/reverse_ssh/internal/client/" + $ = "golang.org" + + condition: + (uint32be(0) == 0x7f454c46 or uint16be(0) == 0x4d5a) and all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_opensource_northstar_strings.yar b/yara_rules/backdoor_opensource_northstar_strings.yar new file mode 100644 index 0000000..0b0a227 --- /dev/null +++ b/yara_rules/backdoor_opensource_northstar_strings.yar @@ -0,0 +1,22 @@ +rule backdoor_opensource_northstar_strings { + meta: + id = "6bf2f428-ec1a-4115-9c5e-258e9176969a" + version = "1.0" + description = "Detects the NorthStar Backdoor strings" + author = "Sekoia.io" + creation_date = "2022-08-23" + classification = "TLP:CLEAR" + + strings: + $ = "_SAMDUMP.zip" wide + $ = "northstar" wide + $ = "smanage.php?sid=" wide + $ = "File Not Exists" wide + $ = "" wide + $ = "getjuice.php" wide + + condition: + uint16be(0) == 0x4d5a and + 6 of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_oyster.yar b/yara_rules/backdoor_oyster.yar new file mode 100644 index 0000000..0c109b4 --- /dev/null +++ b/yara_rules/backdoor_oyster.yar @@ -0,0 +1,17 @@ +rule backdoor_oyster { + meta: + id = "f95f98ea-1e52-45ae-8abf-a986f95d4ab2" + version = "1.0" + description = "Detects files related to the Oyster backdoor." + author = "Sekoia.io" + creation_date = "2024-08-29" + classification = "TLP:CLEAR" + + strings: + $s1 = "CleanUp30.dll" ascii fullword + $s2 = "MSTeamsSetup_c_l_.exe" ascii fullword + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_powershellempire_batlauchers.yar b/yara_rules/backdoor_powershellempire_batlauchers.yar new file mode 100644 index 0000000..cbeded1 --- /dev/null +++ b/yara_rules/backdoor_powershellempire_batlauchers.yar @@ -0,0 +1,18 @@ +rule backdoor_powershellempire_batlauchers { + meta: + id = "ad371665-ec59-45c8-9d99-2a675842c384" + version = "1.0" + description = "Detect BAT launchers for Empire" + author = "Sekoia.io" + creation_date = "2022-04-15" + classification = "TLP:CLEAR" + + strings: + $ = "powershell -noP -sta -w 1 -enc SQB" nocase wide ascii + $ = "powershell -ep bypass -noP -sta -w 1 -enc SQB" nocase wide ascii + $ = "-nol -nop -ep bypass \"[IO.File]::ReadAllText('%~f0')|iex" nocase wide ascii + + condition: + any of them and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/backdoor_powershellempire_csharp.yar b/yara_rules/backdoor_powershellempire_csharp.yar new file mode 100644 index 0000000..9006149 --- /dev/null +++ b/yara_rules/backdoor_powershellempire_csharp.yar @@ -0,0 +1,24 @@ +rule backdoor_powershellempire_csharp { + meta: + id = "952e8e9b-8e4d-4550-9cf4-7ffd2f9d0672" + version = "1.0" + description = "Detects CSharp version of Empire" + author = "Sekoia.io" + creation_date = "2022-04-15" + classification = "TLP:CLEAR" + + strings: + $ = "[-] Catastrophic .Net Agent Failure, Attempting Agent Restart:" ascii wide + $ = "[!] Upload failed - No Delimiter" ascii wide + $ = "SELECT * FROM Win32_IP4RouteTable" ascii wide + $ = "no shell command supplied" ascii wide + $ = "[-] CmdletInvocationException:" ascii wide + $ = "[*] File download of" ascii wide + $ = "Script successfully saved in memory" ascii wide + $ = "Invoke-Empire" ascii wide + $ = "website to reach:" ascii wide + + condition: + uint16be(0) == 0x4d5a and 5 of them and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/backdoor_powershellempire_gen.yar b/yara_rules/backdoor_powershellempire_gen.yar new file mode 100644 index 0000000..8d5d640 --- /dev/null +++ b/yara_rules/backdoor_powershellempire_gen.yar @@ -0,0 +1,17 @@ +rule backdoor_powershellempire_gen { + meta: + id = "36050a5b-bdca-45cd-8e26-7129fdcbf1e8" + version = "1.0" + description = "Detects EmpirePowershell" + author = "Sekoia.io" + creation_date = "2022-04-15" + classification = "TLP:CLEAR" + + strings: + $ = "%{$J=($J+$S[$_]+$K[$_%$K.COUNt])%256;" nocase wide ascii + $ = "($IV+$K))|IEX" nocase wide ascii + + condition: + all of them and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/backdoor_powershellempire_python.yar b/yara_rules/backdoor_powershellempire_python.yar new file mode 100644 index 0000000..5eb1089 --- /dev/null +++ b/yara_rules/backdoor_powershellempire_python.yar @@ -0,0 +1,17 @@ +rule backdoor_powershellempire_python { + meta: + id = "c2913f60-46a2-42c1-8569-72568eaddaed" + version = "1.0" + description = "Detects Empire Python version" + author = "Sekoia.io" + creation_date = "2022-04-15" + classification = "TLP:CLEAR" + + strings: + $ = "import sys,base64;exec" + $ = "aW1wb3J0IHN5cztpbXBvcnQgcmUsIHN1YnByb2" + + condition: + all of them and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/backdoor_powershellempire_sharpire.yar b/yara_rules/backdoor_powershellempire_sharpire.yar new file mode 100644 index 0000000..57253e3 --- /dev/null +++ b/yara_rules/backdoor_powershellempire_sharpire.yar @@ -0,0 +1,20 @@ +rule backdoor_powershellempire_sharpire { + meta: + id = "fed21fbd-52ed-4649-a1ff-56eae57fc9ef" + version = "1.0" + description = "Detect Sharpire version of Empire" + author = "Sekoia.io" + creation_date = "2022-04-15" + classification = "TLP:CLEAR" + + strings: + $ = "GetAgentID" ascii wide + $ = "SetAgentID" ascii wide + $ = "StartAgentJob" ascii wide + $ = "get_JobThread" ascii wide + $ = "GetStagerURI" ascii wide + + condition: + uint16be(0) == 0x4d5a and 4 of them and filesize < 1MB +} + \ No newline at end of file diff --git a/yara_rules/backdoor_sandman_strings.yar b/yara_rules/backdoor_sandman_strings.yar new file mode 100644 index 0000000..2860578 --- /dev/null +++ b/yara_rules/backdoor_sandman_strings.yar @@ -0,0 +1,24 @@ +rule backdoor_sandman_strings { + meta: + id = "7bac7a1e-7d4a-4410-9ad4-1c85beb6faaf" + version = "1.0" + description = "Detect the Sandman backdoor based on strings" + author = "Sekoia.io" + creation_date = "2022-08-23" + classification = "TLP:CLEAR" + + strings: + $s1 = "e9f7c24c-879d-49f2-b9bf-2477dc28e2ee" + $s2 = "System.Net.Sockets" + $s3 = "ntpServer" + $s4 = "payloadUrl" + $s5 = "keepRunning" + $s6 = "payloadSize" + $s7 = "defaultNtpMessageSize" + $s8 = "InjectShellcode" + + condition: + uint16be(0) == 0x4d5a and + 7 of them or $s1 +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_andardoor.yar b/yara_rules/backdoor_win_andardoor.yar new file mode 100644 index 0000000..54a3fb9 --- /dev/null +++ b/yara_rules/backdoor_win_andardoor.yar @@ -0,0 +1,35 @@ +import "pe" +import "hash" + +rule backdoor_win_andardoor { + meta: + id = "27f28f6e-b8fd-41dc-88a8-92f5a125a807" + version = "1.0" + description = "Detect the Andardoor backdoor used by Andariel" + author = "Sekoia.io" + creation_date = "2023-09-04" + classification = "TLP:CLEAR" + + strings: + $ = " : Deleted Dir" wide + $ = " : Not Exists" wide + $ = " : Deleted File" wide + $ = " : Closed." wide + $ = " : Opened." wide + $ = "GoodLuck!" wide + + condition: + // Strings + uint16(0)==0x5A4D and all of them + + // PE section + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "9fea4972270c492ca304f3663913ae63" + ) + + // PE resource + or for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "34fde27c3c864efa6225e72016992d341f29cbbea638432a1c63ce05ca568300" + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_blackrat.yar b/yara_rules/backdoor_win_blackrat.yar new file mode 100644 index 0000000..3a0b7da --- /dev/null +++ b/yara_rules/backdoor_win_blackrat.yar @@ -0,0 +1,34 @@ +import "pe" +import "hash" + +rule backdoor_win_blackrat { + meta: + id = "3a5a6290-6344-45ce-8929-ea5a4451840f" + version = "1.0" + description = "Detect Andariel's Black RAT malware" + author = "Sekoia.io" + creation_date = "2023-09-04" + classification = "TLP:CLEAR" + hash1 = "c2500a6e12f22b16e221ba01952b69c92278cd05632283d8b84c55c916efe27c" + + strings: + $s1 = "I:/01___Tools/02__RAT/Black/Client_Go/Client.go" + $s2 = "I:/01___Tools/02__RAT/Black/Client_Go/Define.go" + $s3 = "I:/01___Tools/02__RAT/Black/Client_Go/Screenshot.go" + + // It is possible that it exists a Rust version of this RAT + $x1 = "RAT/Black/Client" + + condition: + uint16be(0) == 0x4d5a and (all of ($s*) or #x1 >= 3) + + // All section of the sample are unique. I use them for research purpose + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "74c4cdc9d33fc63aee7ae9659b6f8d24" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "298948afbe85985025e176605ee21176" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "e5ca54c5def3c7a950e6d4034dc86277" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "440ae899aea859458df5b6de7dbc5b34" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "98e46f76b965ffb58f6cd53ff8dc91c0" + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_feedload.yar b/yara_rules/backdoor_win_feedload.yar new file mode 100644 index 0000000..6b9fec0 --- /dev/null +++ b/yara_rules/backdoor_win_feedload.yar @@ -0,0 +1,16 @@ +rule backdoor_win_feedload { + meta: + id = "29cc46c4-7ed7-4a34-9749-a8ba8d37eb4c" + version = "1.0" + author = "Sekoia.io" + creation_date = "2023-10-24" + classification = "TLP:CLEAR" + hash = "f251144f7ad0be0045034a1fc33fb896e8c32874e0b05869ff5783e14c062486" + + strings: + $s1 = " C:\\LibreSS5\\crypto\\" + + condition: + uint16be(0)==0x4d5a and #s1 > 200 +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_foresttiger.yar b/yara_rules/backdoor_win_foresttiger.yar new file mode 100644 index 0000000..6e6eb09 --- /dev/null +++ b/yara_rules/backdoor_win_foresttiger.yar @@ -0,0 +1,22 @@ +rule backdoor_win_foresttiger { + meta: + id = "d3128da2-a86d-4db8-9b75-2f3048831c7e" + version = "1.0" + description = "Detect Lazarus' malware ForestTiger" + author = "Sekoia.io" + creation_date = "2023-10-24" + classification = "TLP:CLEAR" + hash1 = "e06f29dccfe90ae80812c2357171b5c48fba189ae103d28e972067b107e58795" + hash2 = "0be1908566efb9d23a98797884f2827de040e4cedb642b60ed66e208715ed4aa" + reference = "https://www.microsoft.com/en-us/security/blog/2023/10/18/multiple-north-korean-threat-actors-exploiting-the-teamcity-cve-2023-42793-vulnerability/" + + strings: + $ = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.42" + $ = "biwbih=" + $ = "rlzbiw=" + $ = "whoami EnDePriv Erro" wide + + condition: + uint16be(0) == 0x4d5a and all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_headertip.yar b/yara_rules/backdoor_win_headertip.yar new file mode 100644 index 0000000..b4a89bb --- /dev/null +++ b/yara_rules/backdoor_win_headertip.yar @@ -0,0 +1,25 @@ +import "pe" +import "hash" + +rule backdoor_win_headertip { + meta: + id = "82899406-4ec3-41d2-bcc1-bdd1ee440e77" + version = "1.0" + description = "Detect HeaderTip backdoor used by the Chinese threat actor Scarab. This backdoor has its hardcoded C2 in strings" + author = "Sekoia.io" + creation_date = "2022-03-25" + classification = "TLP:CLEAR" + hash1 = "e1523185eac41a615b8d2af8b7fd5fe07b755442df2836041be544dff6881237" + hash2 = "da8a98d9b9a3c176ba44fb69ad0a820a971950e05f1eb0c4bbbf6c2fbb748bdc" + hash3 = "63a218d3fc7c2f7fcadc0f6f907f326cc86eb3f8cf122704597454c34c141cf1" + + strings: + $post = "POST" wide + $ua = "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko" wide + + condition: + (uint16(0)==0x5A4D and $post at 7256 and $ua at 7304 and filesize < 10KB) + or pe.imphash() == "60d01115d6baa0f214990c6e19339133" + or hash.md5(pe.rich_signature.clear_data) == "48f9cf422144c033e2ca183f72587910" +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_ketrum2.yar b/yara_rules/backdoor_win_ketrum2.yar new file mode 100644 index 0000000..8c2359a --- /dev/null +++ b/yara_rules/backdoor_win_ketrum2.yar @@ -0,0 +1,36 @@ +import "pe" +import "hash" + +rule backdoor_win_ketrum2 { + meta: + id = "afcc349a-d44b-4b66-b86f-c62e700fa899" + version = "1.0" + description = "Detect Ke3chang's Ketrum backdoor version 2" + author = "Sekoia.io" + creation_date = "2022-10-19" + classification = "TLP:CLEAR" + reference = "https://www.intezer.com/blog/research/the-evolution-of-apt15s-codebase-2020/" + hash1 = "271384a078f2a2f58e14d7703febae8a28c6e2d7ddb00a3c8d3eead4ea87a0c0" + hash2 = "aa467945dd7b9b095e592fc96384bb385f2c95d00d5424e42bb6ab09827cb0ce" + hash3 = "aacaf0d4729dd6fda2e452be763d209f92d107ecf24d8a341947c545de9b7311" + hash4 = "ac5cb6e17f094068686225075251153e3eb21dc2d1ae744a97ab113cab034a36" + + strings: + $ = "powershell.exe" wide + $ = "cmd.exe" wide + $ = "%s\\adult.sft" wide + $ = "%s\\Notice" wide + $ = "%s\\Message" wide + $ = "\\Microsoft\\Media Player" wide + $ = "Windows\\CurrentVersion\\Explorer\\Shell Folders" wide ascii + $ = "Windows\\CurrentVersion\\Internet Settings" wide ascii + + condition: + all of them + + // Very common resource but appears in all Ketrum samples + and for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "49a60be4b95b6d30da355a0c124af82b35000bce8f24f957d1c09ead47544a1e" + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_kimsuky.yar b/yara_rules/backdoor_win_kimsuky.yar new file mode 100644 index 0000000..55d5a58 --- /dev/null +++ b/yara_rules/backdoor_win_kimsuky.yar @@ -0,0 +1,39 @@ +import "pe" +import "hash" + +rule backdoor_win_kimsuky { + meta: + id = "db927d1c-34cf-4501-a6ce-3e8ecdefc5a3" + version = "1.0" + description = "Detect the backdoors used by Kimsuky based on specific PE ressources" + author = "Sekoia.io" + creation_date = "2024-06-04" + classification = "TLP:CLEAR" + hash1 = "000e2926f6e094d01c64ff972e958cd38590299e9128a766868088aa273599c7" + hash2 = "cca1705d7a85fe45dce9faec5790d498427b3fa8e546d7d7b57f18a925fdfa5d" + + condition: + uint16be(0) == 0x4d5a + and for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "3d570af85db2bb18265d80e7209a5c90f7cc82e0c868c0088a925df6f34e9066" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "3d570af85db2bb18265d80e7209a5c90f7cc82e0c868c0088a925df6f34e9066" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "ac9ed305c6dac749163db359736e7d92fca9173ff5c9e1f021d500b306e3c5ec" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "0ca965ccf7324b098da617909d38986c1e6aae3e12d9629975f1815ed4ed3907" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "25d79e59a6b625e5c22ccb55cc49373d38cc6f20cb75504b0df1bc0804bb1247" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "ce5619ffe04ec569bf2565e0964156378bda7c42eb646bedbac2191a5af7bebf" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "ce10e65f7bf105fc06005340f0a8eaea9b351f3750d2818c1cf2ca25a7f495be" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "5a9e2a392c530ab8b38ff917ae0f28496107f1bde94e89515931fd29a0bfb2e5" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "19f4f3a05b809d8e33bb0004f62899ca5f9eac7e4cdba68dfd5c0a6f2d71bec3" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "b9c208b9bada7bac4d5bfe53992f570e34e0b4d5cfa0862de9847ddf5630ab9a" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "3d570af85db2bb18265d80e7209a5c90f7cc82e0c868c0088a925df6f34e9066" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "ac9ed305c6dac749163db359736e7d92fca9173ff5c9e1f021d500b306e3c5ec" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "0ca965ccf7324b098da617909d38986c1e6aae3e12d9629975f1815ed4ed3907" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "25d79e59a6b625e5c22ccb55cc49373d38cc6f20cb75504b0df1bc0804bb1247" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "ce5619ffe04ec569bf2565e0964156378bda7c42eb646bedbac2191a5af7bebf" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "ce10e65f7bf105fc06005340f0a8eaea9b351f3750d2818c1cf2ca25a7f495be" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "5a9e2a392c530ab8b38ff917ae0f28496107f1bde94e89515931fd29a0bfb2e5" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "19f4f3a05b809d8e33bb0004f62899ca5f9eac7e4cdba68dfd5c0a6f2d71bec3" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "b9c208b9bada7bac4d5bfe53992f570e34e0b4d5cfa0862de9847ddf5630ab9a" + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_mgbot_main.yar b/yara_rules/backdoor_win_mgbot_main.yar new file mode 100644 index 0000000..e951c6a --- /dev/null +++ b/yara_rules/backdoor_win_mgbot_main.yar @@ -0,0 +1,36 @@ +import "pe" +import "hash" + +rule backdoor_win_mgbot_main { + meta: + id = "528baa11-58d5-470a-bd6d-963d4ac75d97" + version = "1.0" + description = "Detect MgBot main.dll file" + author = "Sekoia.io" + creation_date = "2024-03-20" + classification = "TLP:CLEAR" + reference = "https://symantec-enterprise-blogs.security.com/blogs/threat-intelligence/apt-attacks-telecoms-africa-mgbot" + hash1 = "706c9030c2fa5eb758fa2113df3a7e79257808b3e79e46869d1bf279ed488c36" + hash2 = "017187a1b6d58c69d90d81055db031f1a7569a3b95743679b21e44ea82cfb6c7" + + condition: + // Imphash + pe.imphash() == "8e1ee04a99c77bd54c6dc55214ffa2e3" + + // Rich header hash + or hash.md5(pe.rich_signature.clear_data) == "67e8e8b75b981b5c8ff31149dc2c61b2" + + // Sections + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "7c6adf9987e6dfbf19b5f156b0314798" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "46fa9f5a035c8ae8de1a0d14150bd5ef" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "f7895f9456f8d51125e6744960c38133" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "5d82bb8a7ef37c417615381b446f715c" + ) + + // Resource + or for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "d7808c6662f098e685040f7c61bc033d9e73002f674de7cf2ffcd6230d60d429" + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_minibike.yar b/yara_rules/backdoor_win_minibike.yar new file mode 100644 index 0000000..2f859e3 --- /dev/null +++ b/yara_rules/backdoor_win_minibike.yar @@ -0,0 +1,38 @@ +import "pe" +import "hash" + +rule backdoor_win_minibike { + meta: + id = "d758c41a-279c-4706-9cf3-87740e45f71d" + version = "1.0" + description = "Detect the MINIBIKE malware" + author = "Sekoia.io" + creation_date = "2024-04-08" + classification = "TLP:CLEAR" + hash1 = "985967e245d8fbc722e30371c9ed48c3269ceaa6b9b9b80caf2b95c920c856c2" + hash2 = "ab0b602665b609392eacdcbfc6c1981f216c19f21e2156a55cf9998eab02227b" + hash3 = "8e2429d70989bbdd2ea8842dce7c3d790ebe148490ee519b47767557f4a4a733" + hash4 = "be86b8559a84d97aa1cc9852e60a553f5164477bacfc69b7f3453ad37fb6fd2a" + hash5 = "78065411e7e8eb205ddae7215a229b7c93bdca5d628670f89caa982238ac7eb6" + hash6 = "73bf3a5877a7fe16544d15670e3ece034e4826323ba555b3527ad4d061f44ec4" + reference = "https://www.mandiant.com/resources/blog/suspected-iranian-unc1549-targets-israel-middle-east" + + strings: + $ = "Mini-Junked.dll" + + condition: + // Strings + uint16(0)==0x5A4D and all of them + + // Imphash + or pe.imphash() == "75a9ae7d4394abdc30e2a873908fa09d" + + // Rich header + or hash.md5(pe.rich_signature.clear_data) == "06b2ec5892ac9ad566693b04cf427f3f" + + // Section + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "612006b6f68cd0b8b0d48252dbdef4be" + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_minibus.yar b/yara_rules/backdoor_win_minibus.yar new file mode 100644 index 0000000..9bf1140 --- /dev/null +++ b/yara_rules/backdoor_win_minibus.yar @@ -0,0 +1,42 @@ +import "pe" +import "hash" + +rule backdoor_win_minibus { + meta: + id = "f88bcf15-9a9f-4d84-adc6-db1db55fe93c" + version = "1.0" + description = "Detect the MINIBUS backdoor used by UNC1549 since August 2023" + author = "Sekoia.io" + creation_date = "2024-02-29" + classification = "TLP:CLEAR" + reference = "https://www.mandiant.com/resources/blog/suspected-iranian-unc1549-targets-israel-middle-east" + + strings: + $dll_150_1 = "TorvaldsPersist.dll" + $dll_150_2 = "FileCoAuth.exe" + + $dll_50_1 = "TorvaldInitial.dll" + $dll_50_2 = "\\essential.dat" + + condition: + // 150KB DLL + // 10e9d1eaf24ad3c63578d89f8b887adb47700aae02da1532c4842428725e77d6 + // 720afa3e1216a9eb68b66858d50de0326f52afa279ef9ee0521aee98b312382f + ( + uint16(0)==0x5A4D and all of ($dll_150_*) or + for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "2cf9797b1cfb5795d0fb892b7c371d506a5dd8b7c64fdc82975b3fde6d997df0" + ) + ) + + // 50-06KB DLL + // 26ca51cb067e1fdf1b8ad54ba49883bc5d1945952239aec0c4840754bff76621 + // 90fa29cc98be1d715df26d22079bdb8ce1d1fd3ce6a4efb39a4c192134e01020 + or ( + uint16(0)==0x5A4D and all of ($dll_50_*) or + for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "de3fb5d4419eb6b943872dd6e3dd93d19584ef2b158aa3158b3b09f0a9b628ef" + ) + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_nukesped_andariel.yar b/yara_rules/backdoor_win_nukesped_andariel.yar new file mode 100644 index 0000000..e0ffbeb --- /dev/null +++ b/yara_rules/backdoor_win_nukesped_andariel.yar @@ -0,0 +1,20 @@ +import "pe" +import "hash" + +rule backdoor_win_nukesped_andariel { + meta: + id = "a3601f0b-5782-4546-ac22-8a0514791f8f" + version = "1.0" + description = "Detect the NukeSped variant type 1 used by Andariel in October 2023" + author = "Sekoia.io" + creation_date = "2023-11-27" + classification = "TLP:CLEAR" + reference = "https://asec.ahnlab.com/en/59073/" + + condition: + for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "4ce43c7e358e3951f4c4ebd050d570786cbb473ee353974fc7414e3d753da9f6" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "355485cbe2bec406d60a48d7d8d25c71d9ded3c508c87273d936a92b94720d9b" + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_rokrat.yar b/yara_rules/backdoor_win_rokrat.yar new file mode 100644 index 0000000..d9ec58d --- /dev/null +++ b/yara_rules/backdoor_win_rokrat.yar @@ -0,0 +1,32 @@ +rule backdoor_win_rokrat { + meta: + id = "97a3acc1-4120-4d67-a6ad-fa204f2fd7f5" + version = "1.0" + description = "Detect the RokRAT malware" + author = "Sekoia.io" + creation_date = "2023-07-11" + classification = "TLP:CLEAR" + hash1 = "84760cac26513915ebfb0a80ad3ddabe62f03ec4fda227d63e764f9c4a118c4e" + hash2 = "758348521331bb18241d1cfc90d7e687dbc5bad8d596a2b2d6a9deb6cfc8cb1d" + hash3 = "2a253c2aa1db3f809c86f410e4bd21f680b7235d951567f24d614d8e4d041576" + hash4 = "ebce34cdeb20bc8c75249ce87a3080054f48b03ef66572fbc9dc40e6c36310d6" + hash5 = "a1e4e95a20120f16adacb342672eec1e73bd7826b332096f046bb7e2b7cd80a1" + hash6 = "3be58a7a7a25dbceee9e7ef06ef20aa86aef083be19db9e5ffb181d3f9f6615a" + hash7 = "fa4df84071b9ae20b321e4d22162d8480f6992206bc046e403c2fbedd1655503" + hash8 = "aa76b4db29cf929b4b22457ccb8cd77308191f091cde2f69e578ade9708d7949" + + strings: + // String in all samples since 2019 + $ = "--wwjaughalvncjwiajs--" + + // {"path":"%s","mode":{".tag":"overwrite"}} + $ = {7b 00 22 00 70 00 61 00 74 00 68 00 22 00 3a 00 22 00 25 00 73 00 22 00 2c 00 22 00 6d 00 6f 00 64 00 65 00 22 00 3a 00 7b 00 22 00 2e 00 74 00 61 00 67 00 22 00 3a 00 22 00 6f 00 76 00 65 00 72 00 77 00 72 00 69 00 74 00 65 00 22 00 7d 00 7d} + + // https://cloud-api.yandex.net/v1/disk/resources/upload?path=%s&overwrite=%s + $ = {68 00 74 00 74 00 70 00 73 00 3a 00 2f 00 2f 00 63 00 6c 00 6f 00 75 00 64 00 2d 00 61 00 70 00 69 00 2e 00 79 00 61 00 6e 00 64 00 65 00 78 00 2e 00 6e 00 65 00 74 00 2f 00 76 00 31 00 2f 00 64 00 69 00 73 00 6b 00 2f 00 72 00 65 00 73 00 6f 00 75 00 72 00 63 00 65 00 73 00 2f 00 75 00 70 00 6c 00 6f 00 61 00 64 00 3f 00 70 00 61 00 74 00 68 00 3d 00 25 00 73 00 26 00 6f 00 76 00 65 00 72 00 77 00 72 00 69 00 74 00 65 00 3d 00 25 00 73} + + condition: + uint16(0)==0x5A4D + and any of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_rollsling.yar b/yara_rules/backdoor_win_rollsling.yar new file mode 100644 index 0000000..b6e3ac6 --- /dev/null +++ b/yara_rules/backdoor_win_rollsling.yar @@ -0,0 +1,22 @@ +rule backdoor_win_rollsling { + meta: + id = "5ef23b9c-5bc5-4f02-b1b4-1af18a03241a" + version = "1.0" + description = "Detect Lazarus' RollSling malware (aka LazarLoader)" + author = "Sekoia.io" + creation_date = "2023-10-24" + classification = "TLP:CLEAR" + hash1 = "d9add2bfdfebfa235575687de356f0cefb3e4c55964c4cb8bfdcdc58294eeaca" + hash2 = "48538a935ddf2cbeb4918d0ccf9372ec8e0a57c5fd145a584a9b1bb4ebbcd5ce" + hash3 = "18825be6b269087d7699f3d0aa2e6db2ae72ded36c56aa8e7b8a606dde3741fa" + hash4 = "645205e38dfdd560f6242ba717af1bfdd8e85baf5e710d724b853fe9808c4551" + hash5 = "455bab490a300d9d63b8777c223287c0a6a647ca7b98b96fd3236f83b8adc77b" + reference = "https://www.microsoft.com/en-us/security/blog/2023/10/18/multiple-north-korean-threat-actors-exploiting-the-teamcity-cve-2023-42793-vulnerability/" + + strings: + $s1 = "LookupPrivilegeVCreateRemoteThreAdjustTokenPriviOpenProcessToken" + + condition: + uint16be(0) == 0x4d5a and all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_sidewinder_cobaltstrike_2022_09.yar b/yara_rules/backdoor_win_sidewinder_cobaltstrike_2022_09.yar new file mode 100644 index 0000000..af40cbc --- /dev/null +++ b/yara_rules/backdoor_win_sidewinder_cobaltstrike_2022_09.yar @@ -0,0 +1,30 @@ +import "pe" +import "hash" + +rule backdoor_win_sidewinder_cobaltstrike_2022_09 { + meta: + id = "b5e8f87a-4a2c-49bb-aa98-bf3fb5056b23" + version = "1.0" + description = "Detect the SideWinder malware" + author = "Sekoia.io" + creation_date = "2022-10-24" + classification = "TLP:CLEAR" + + strings: + // eNEVER GONNA GIVE YOU UP! + $s1 = {65004e004500560045005200200047004f004e004e00410020004700490056004500200059004f0055002000550050002100} + + condition: + $s1 + + //Imphash + or pe.imphash() == "b1e345b2d78e4b82617d995d18100790" + + //Sections + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "ac989507d4af352fa354560efef99ba6" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "8090b29a44c750b7b21287f9639fe747" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "ea8693d6bacf3e7876f717a3d8abc433" + ) +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_spacecolon.yar b/yara_rules/backdoor_win_spacecolon.yar new file mode 100644 index 0000000..dfb4459 --- /dev/null +++ b/yara_rules/backdoor_win_spacecolon.yar @@ -0,0 +1,40 @@ +rule backdoor_win_spacecolon { + meta: + id = "ae09f0e2-e913-44d5-abe1-715170368cc8" + version = "1.0" + description = "Finds Spacecolon samples based on specific strings (ScHackTool component)" + author = "Sekoia.io" + reference = "https://www.welivesecurity.com/en/eset-research/scarabs-colon-izing-vulnerable-servers/" + creation_date = "2023-08-25" + classification = "TLP:CLEAR" + + strings: + $str01 = "Before Work" ascii + $str02 = "DEFENDER OFF" ascii + $str03 = "Stop Service" ascii + $str04 = "Kill All (Default)" ascii + $str05 = "Keyboard EN" ascii + $str06 = "After Work" ascii + $str07 = "Del Shadow Log" ascii + $str08 = "Kill OSK" ascii + $str09 = "PWGEN" ascii + $str10 = "Character :" ascii + $str11 = "PW GEN" ascii + $str12 = "Cobian UI Pass" ascii + $str13 = "Credssp" ascii + $str14 = "Username :" ascii + $str15 = "Password :" ascii + $str16 = "TSpeedButton" ascii + $str17 = "Ab1q2w3e!" ascii + $str18 = "PC Details" ascii + $str19 = "Mimi Dump" ascii + $str20 = "MIMI Dump" ascii + $str21 = "powershell -ExecutionPolicy Bypass -File \"" wide + $str22 = "lastlog.txt" wide + $str23 = "$AdminGroupName = (Get-WmiObject -Class Win32_Group -Filter 'LocalAccount = True AND SID = \"S-1-5-32-544\"').Name" wide + $str24 = "net localgroup $AdminGroupName " wide + + condition: + uint16(0) == 0x5a4d and 17 of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_sponsor.yar b/yara_rules/backdoor_win_sponsor.yar new file mode 100644 index 0000000..806d415 --- /dev/null +++ b/yara_rules/backdoor_win_sponsor.yar @@ -0,0 +1,25 @@ +rule backdoor_win_sponsor { + meta: + id = "d410cdb7-a2a8-481e-a90a-49ef15a7a0e3" + version = "1.0" + description = "Detect the Sponsor backdoor" + author = "Sekoia.io" + creation_date = "2024-03-29" + classification = "TLP:CLEAR" + reference = "https://www.welivesecurity.com/en/eset-research/sponsor-batch-filed-whiskers-ballistic-bobcats-scan-strike-backdoor/" + hash1 = "e5ee874bd59bb2a6dec700686544e7914312abff166a7390b34f7cb29993267a" + hash2 = "e2b74ed355d68bed2e7242baecccd7eb6eb480212d6cc54526bc4ff7e6f57629" + hash3 = "2a99cf7d73d453f3554e24bf3efa49d8109da9e8543db815a8f813559d083f8f" + hash4 = "c4dbda41c726af9ba3d9224f2e38fc433d2b60f4a23512437adeae8ef8986c57" + + strings: + $ = "Content-Type: application/x-www-form-urlencoded" + $ = "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation" + $ = "\\Uninstall.bat" + $ = "\\config.txt" + $ = "\\node.txt" + + condition: + uint16be(0) == 0x4d5a and all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_volgmer.yar b/yara_rules/backdoor_win_volgmer.yar new file mode 100644 index 0000000..2356a72 --- /dev/null +++ b/yara_rules/backdoor_win_volgmer.yar @@ -0,0 +1,33 @@ +rule backdoor_win_volgmer { + meta: + id = "9468a66d-787c-488f-937b-22617c7a2ded" + version = "1.0" + description = "Detect the NukeSped variant called Volgmer used by Andariel" + author = "Sekoia.io" + creation_date = "2023-09-04" + classification = "TLP:CLEAR" + hash1 = "3098e6e7ae23b3b8637677da7bfc0ba720e557e6df71fa54a8ef1579b6746061" + hash2 = "7339cfa5a67f5a4261c18839ef971d7f96eaf60a46190cab590b439c71c4742b" + hash3 = "8daa6b20caf4bf384cc7912a73f243ce6e2f07a5cb3b3e95303db931c3fe339f" + hash4 = "1b88b939e5ec186b2d19aec8f17792d493d74dd6ab3d5a6ddc42bfe78b01aff1" + + strings: + $ = "Fixed" wide + $ = "CDRom" wide + $ = "Removable" wide + $ = "%.2fGB" wide + $ = "\\*.*" wide + $ = "Folder" wide + $ = "%.1fKB" wide + $ = "%.1fMB" wide + $ = "%s\\*.*" wide + $ = "%s\\%s\\%s" wide + $ = "%s\\%s%s" wide + $ = "Remote PC" wide + $ = "%s|%s|%s|%s|%s|%s|" wide + $ = "%s\\cmd.exe" wide + + condition: + uint16be(0) == 0x4d5a and all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_warhawk.yar b/yara_rules/backdoor_win_warhawk.yar new file mode 100644 index 0000000..3d74772 --- /dev/null +++ b/yara_rules/backdoor_win_warhawk.yar @@ -0,0 +1,57 @@ +rule backdoor_win_warhawk { + meta: + id = "d0ec19a7-cb08-4bca-b153-d7b0358186b4" + version = "1.0" + description = "Detect the WarHawk backdoor used by the SideWinder intrusion-set" + author = "Sekoia.io" + creation_date = "2022-10-24" + classification = "TLP:CLEAR" + reference = "https://www.zscaler.com/blogs/security-research/warhawk-new-backdoor-arsenal-sidewinder-apt-group-0" + hash_exe1 = "7d3574c62df44b74337fc74ec7877792b4ffa1486a49bb19668433c3ca8836b5" + hash_exe2 = "624c6b56ee3865f4a5792ad1946a8e86b876440a5af3bac22ac1dee92f1b7372" + hash_iso1 = "58b3686e4255d32dbcf7dee9dac1d5be6d4692d086cde167da1e1a5e0e1b315a" + hash_iso2 = "f97d5d3e1c2ceb3e9d23ae5b5d4e7c9857155df5acf7f67fee995cb041c797dc" + + strings: + // { \"name\": \"%s\", \"size\": \"\", \"mod\": \"%s\", \"type\": \"File folder\" }, + $ = {7b205c226e616d655c223a205c2225735c222c205c2273697a655c223a205c225c222c205c226d6f645c223a205c2225735c222c205c22747970655c223a205c2246696c6520666f6c6465725c22207d2c} + + // { \"name\": \"%s\", \"mod\": \"%s\", \"type\": \"%s\", \"size\": \"%u\" }, + //$ = {7b205c226e616d655c223a205c2225735c222c205c226d6f645c223a205c2225735c222c205c22747970655c223a205c2225735c222c205c2273697a655c223a205c2225755c22207d2c} + + // { "_hwid": "%s", "_computer": "%s", "_username": "%s", "_os": "%s" } + $ = {7b20225f68776964223a20222573222c20225f636f6d7075746572223a20222573222c20225f757365726e616d65223a20222573222c20225f6f73223a2022257322207d} + + // {\"name\": \"%s\", \"type\": \"%s\"}, + $ = {7b5c226e616d655c223a205c2225735c222c205c22747970655c223a205c2225735c227d2c} + + // { "_hwid": "%s", "_filemgr_done": "true", "_response": "%s" } + $ = {7b20225f68776964223a20222573222c20225f66696c656d67725f646f6e65223a202274727565222c20225f726573706f6e7365223a2022257322207d} + + // { "_hwid": "%s", "_task": "true" } + $ = {7b20225f68776964223a20222573222c20225f7461736b223a20227472756522207d} + + // { "_hwid": "%s", "_task_done": "true", "_id": "%s" } + $ = {7b20225f68776964223a20222573222c20225f7461736b5f646f6e65223a202274727565222c20225f6964223a2022257322207d} + + // { "_hwid": "%s", "_cmd": "true" } + $ = {7b20225f68776964223a20222573222c20225f636d64223a20227472756522207d} + + // { "_hwid": "%s", "_cmd_done": "true", "_response": "%s" } + $ = {7b20225f68776964223a20222573222c20225f636d645f646f6e65223a202274727565222c20225f726573706f6e7365223a2022257322207d} + + // { "_hwid": "%s", "_filemgr": "true" } + $ = {7b20225f68776964223a20222573222c20225f66696c656d6772223a20227472756522207d} + + // { "_hwid": "%s" } + $ = {7b20225f68776964223a2022257322207d} + + // { "_hwid": "%s", "_ping": "true" } + $ = {7b20225f68776964223a20222573222c20225f70696e67223a20227472756522207d} + + $ = "cmd.exe" + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/backdoor_win_winordll64.yar b/yara_rules/backdoor_win_winordll64.yar new file mode 100644 index 0000000..619e0d9 --- /dev/null +++ b/yara_rules/backdoor_win_winordll64.yar @@ -0,0 +1,24 @@ +import "hash" +import "pe" + +rule backdoor_win_winordll64 { + meta: + id = "86a32538-bc69-47ea-9842-4af360588c27" + version = "1.0" + description = "Detect the WinorDLL64 backdoor" + author = "Sekoia.io" + creation_date = "2023-02-24" + classification = "TLP:CLEAR" + + condition: + hash.md5(pe.rich_signature.clear_data) == "d16713cbfe04151b3a9e832c8afd55df" + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "3f638774c2565594029fb52ceb67db7a" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "f9416bfb43b2c70837927e43e7591a2a" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "6eede2cebaef39eec5bd1c24c809e3dc" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "1177658fb0469cd5982102c9f3cd2eea" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "658d877d1bf0d2928b2c3efec9ec06cf" + ) + or pe.imphash() == "d6b6f8cdffb06f469e06c7af9639897c" +} + \ No newline at end of file diff --git a/yara_rules/backdoor_xploitspy_strings.yar b/yara_rules/backdoor_xploitspy_strings.yar new file mode 100644 index 0000000..3be36d9 --- /dev/null +++ b/yara_rules/backdoor_xploitspy_strings.yar @@ -0,0 +1,29 @@ +rule backdoor_xploitspy_strings { + meta: + id = "0aa86c2e-dba6-4ef4-a47e-f1b43e04f1f3" + version = "1.0" + description = "Detects XploitSPY DEX file" + author = "Sekoia.io" + creation_date = "2022-08-24" + classification = "TLP:CLEAR" + + strings: + $ = { 04 30 78 43 42 00 } + $ = { 04 30 78 43 4C 00 } + $ = { 04 30 78 43 4F 00 } + $ = { 04 30 78 46 49 00 } + $ = { 04 30 78 47 50 00 } + $ = { 04 30 78 49 4E 00 } + $ = { 04 30 78 4C 4F 00 } + $ = { 04 30 78 4D 49 00 } + $ = { 04 30 78 4E 4F 00 } + $ = { 04 30 78 50 4D 00 } + $ = { 04 30 78 53 4D 00 } + $ = { 04 30 78 57 49 00 } + + condition: + uint32be(0) == 0x6465780A and + filesize < 1MB and + 10 of them +} + \ No newline at end of file diff --git a/yara_rules/backoor_win_gobear.yar b/yara_rules/backoor_win_gobear.yar new file mode 100644 index 0000000..26bd95e --- /dev/null +++ b/yara_rules/backoor_win_gobear.yar @@ -0,0 +1,19 @@ +import "pe" +import "hash" + +rule backoor_win_gobear { + meta: + id = "f922bf1b-652e-4a2f-91e9-76ecd2e3bf6a" + version = "1.0" + description = "Detect the GoBear backdoor used by Kimsuky" + author = "Sekoia.io" + creation_date = "2024-02-13" + classification = "TLP:CLEAR" + reference = "https://medium.com/s2wblog/kimsuky-disguised-as-a-korean-company-signed-with-a-valid-certificate-to-distribute-troll-stealer-cfa5d54314e2" + + condition: + for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "668031f53390dc749971888029911c12d4171534f77c17a962e698bf121d0e20" + ) +} + \ No newline at end of file diff --git a/yara_rules/backoor_win_tinyturla_ng.yar b/yara_rules/backoor_win_tinyturla_ng.yar new file mode 100644 index 0000000..97a6cab --- /dev/null +++ b/yara_rules/backoor_win_tinyturla_ng.yar @@ -0,0 +1,29 @@ +import "pe" + +rule backoor_win_tinyturla_ng { + meta: + id = "019043bb-0212-4b73-bc93-03e9a746d28d" + version = "1.0" + description = "Detect the TinyTurla-NG backdoor used by Turla" + author = "Sekoia.io" + creation_date = "2024-03-04" + classification = "TLP:CLEAR" + reference = "https://blog.talosintelligence.com/tinyturla-next-generation/" + hash1 = "267071df79927abd1e57f57106924dd8a68e1c4ed74e7b69403cdcdf6e6a453b" + hash2 = "d6ac21a409f35a80ba9ccfe58ae1ae32883e44ecc724e4ae8289e7465ab2cf40" + + strings: + $ = "delkill /F /IM explENT_USER\\Softwar" + $ = "Set-PSReadLineOption -HistorySaveStyle SaveNothing" + $ = "changeshell" + $ = "chcp 437 > $null" + $ = "powershell.exe -nologo" + + condition: + // Strings + uint16be(0) == 0x4d5a and all of them + + // Imphash + or pe.imphash() == "2240ae6f0dcbc0537836dfd9205a1f2b" +} + \ No newline at end of file diff --git a/yara_rules/bot_lin_enemybot_april22.yar b/yara_rules/bot_lin_enemybot_april22.yar new file mode 100644 index 0000000..b54b990 --- /dev/null +++ b/yara_rules/bot_lin_enemybot_april22.yar @@ -0,0 +1,27 @@ +rule bot_lin_enemybot_april22 { + meta: + id = "5778c653-39ce-4f5d-b10b-1503b74e5041" + version = "1.0" + description = "Detect enemybot based on command line observed in strings" + author = "Sekoia.io" + reference = "https://twitter.com/3xp0rtblog/status/137520616938452173://www.fortinet.com/blog/threat-research/enemybot-a-look-into-keksecs-latest-ddos-botnet" + creation_date = "2022-04-14" + classification = "TLP:CLEAR" + + strings: + $cmd0 = "wget http://%s/update.sh" ascii + $cmd1 = "busybox wget http://%s/update.sh" ascii + $cmd2 = "curl http://%s/update.sh" ascii + $cmd3 = "chmod 777 update.sh" ascii + $cmd4 = "rm -rf update.sh" ascii + + $str0 = "ENEMEYBOT" ascii xor + $str1 = "KEKSEC" ascii xor + $str2 = "/tmp/.pwned" ascii xor + $str3 = "echo -e \"\x65\x6e\x65\x6d\x79" + + condition: + (uint32(0)==0x464c457f or uint32(0)==0xfeedfacf) //elf or mach-o + and (4 of ($cmd*) or 2 of ($str*)) +} + \ No newline at end of file diff --git a/yara_rules/bot_lin_kinsing_strings.yar b/yara_rules/bot_lin_kinsing_strings.yar new file mode 100644 index 0000000..51c0344 --- /dev/null +++ b/yara_rules/bot_lin_kinsing_strings.yar @@ -0,0 +1,24 @@ +rule bot_lin_kinsing_strings { + meta: + id = "ce41b6d0-bc22-4a85-a3bb-ed3234871524" + version = "1.0" + description = "Catch Kinsing malware based on strings" + author = "Sekoia.io" + creation_date = "2023-11-24" + classification = "TLP:CLEAR" + + strings: + $s1 = "MinerUrl" ascii + $s2 = "main.masscan" ascii + $s3 = "redisBrute" ascii + $s4 = "ActiveC2CUrl" ascii + $s5 = "main.getKi" ascii + $s6 = "main.getMu" ascii + $s7 = "tryToRunMiner" ascii + $s8 = "main.kiLoader" ascii + $s9 = "main.downloadAndExecute" ascii + + condition: + uint32(0)==0x464c457f and all of them +} + \ No newline at end of file diff --git a/yara_rules/bot_lin_lucifer_strings.yar b/yara_rules/bot_lin_lucifer_strings.yar new file mode 100644 index 0000000..9f5651d --- /dev/null +++ b/yara_rules/bot_lin_lucifer_strings.yar @@ -0,0 +1,21 @@ +rule bot_lin_lucifer_strings { + meta: + id = "c341b6d0-bc22-4a85-aebb-ed323487f524" + version = "1.0" + description = "Catch Lucifer DDoS - lin version - malware based on strings" + author = "Sekoia.io" + creation_date = "2024-09-24" + classification = "TLP:CLEAR" + + strings: + $s1 = "DealwithDDoS" ascii + $s2 = "DecryptData" ascii + $s3 = "They say I'm rude. I'm not rude at all, but I still want to say, fuck your mother" ascii + $s4 = "stratum+tcp://" ascii + $s5 = "gethostip" ascii + $s6 = "GetmyName" ascii + + condition: + uint32(0)==0x464c457f and all of them +} + \ No newline at end of file diff --git a/yara_rules/bot_lin_xorddos_strings.yar b/yara_rules/bot_lin_xorddos_strings.yar new file mode 100644 index 0000000..ec7cf1d --- /dev/null +++ b/yara_rules/bot_lin_xorddos_strings.yar @@ -0,0 +1,18 @@ +rule bot_lin_xorddos_strings { + meta: + id = "2f5c70a3-fe3f-4091-905d-d779bd0cb2cd" + version = "1.0" + description = "Catch XORDDoS strings" + author = "Sekoia.io" + creation_date = "2023-11-02" + classification = "TLP:CLEAR" + + strings: + $s1 = "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; TencentTraveler ; .NET CLR 1.1.4322)" ascii fullword + $s2 = "sed -i '/\\/etc\\/cron.hourly\\/gcc.sh/d' /etc/crontab && echo '*/3 * * * * root /etc/cron.hourly/gcc.sh' >> /etc/crontab" ascii fullword + $s3 = "for i in `cat /proc/net/dev|grep :|awk -F: {'print $1'}`; do ifconfig $i up& done" + + condition: + uint32(0)==0x464c457f and filesize > 600KB and filesize < 700KB and 3 of them +} + \ No newline at end of file diff --git a/yara_rules/bot_lin_zerobot_dec22.yar b/yara_rules/bot_lin_zerobot_dec22.yar new file mode 100644 index 0000000..c9abe69 --- /dev/null +++ b/yara_rules/bot_lin_zerobot_dec22.yar @@ -0,0 +1,31 @@ +rule bot_lin_zerobot_dec22 { + meta: + id = "ce028297-a526-4a6a-95db-8762fb5895f6" + version = "1.0" + description = "Detect the linux Zerobot implant using specific strings" + author = "Sekoia.io" + reference = "https://www.fortinet.com/blog/threat-research/zerobot-new-go-based-botnet-campaign-targets-multiple-vulnerabilities" + creation_date = "2022-08-05" + classification = "TLP:CLEAR" + + strings: + $str01 = "rm -rf " + $str02 = "wget http://" + $str03 = "curl -O http://" + $str04 = "tftp" + $str05 = "-c get" + $str06 = "ftpget -v -u anonymous -P" + $str07 = "chmod 777" + $str08 = "nohup" + $str09 = "/dev/null 2>&1 &" + $str10 = "zero." + $str11 = "ppc64le" + $str12 = "riscv64" + $str13 = "s390x" + $str14 = "rm -rf ~/.bash_history" + $str15 = "history -c" + + condition: + 11 of ($str*) and filesize < 10KB +} + \ No newline at end of file diff --git a/yara_rules/bot_win_yamabot.yar b/yara_rules/bot_win_yamabot.yar new file mode 100644 index 0000000..2b52fa4 --- /dev/null +++ b/yara_rules/bot_win_yamabot.yar @@ -0,0 +1,21 @@ +rule bot_win_yamabot { + meta: + id = "9f5b85c4-59e3-448f-b054-5b4932ee89bb" + version = "1.0" + description = "Detect the Yamabot implant used by Lazarus" + author = "Sekoia.io" + creation_date = "2023-08-29" + classification = "TLP:CLEAR" + hash1 = "1e4de822695570421eb2f12fdfe1d32ab8639655e12180a7ab3cf429e7811b8f" + hash2 = "66415464a0795d0569efa5cb5664785f74ed0b92a593280d689f3a2ac68dca66" + hash3 = "74529dd15d1953a47f0d7ecc2916b2b92865274a106e453a24943ca9ee434643" + hash4 = "def2f01fbd4be85f48101e5ab7ddd82efb720e67daa6838f30fd8dcda1977563" + + strings: + $s1 = "_/D_/Bot/YamaBot/" + $s2 = "Go build ID: \"ujRRNborth3MgXzS7HTu/aYhLszO8_95srnr8Fk1n/Xr8P792kGZ_VUqOQVc97/kgx_H7YuMZBl2Ajyac2M\"" + + condition: + uint16be(0) == 0x4d5a and 1 of them and filesize > 3MB +} + \ No newline at end of file diff --git a/yara_rules/botnet_lin_tsunami.yar b/yara_rules/botnet_lin_tsunami.yar new file mode 100644 index 0000000..d31f566 --- /dev/null +++ b/yara_rules/botnet_lin_tsunami.yar @@ -0,0 +1,22 @@ +rule botnet_lin_tsunami { + meta: + id = "65d2ff89-064f-489a-a215-33197926a62d" + version = "1.0" + description = "Catch tsunami botnet based on string" + author = "Sekoia.io" + creation_date = "2024-09-24" + classification = "TLP:CLEAR" + hash = "536a28db011459d841652e25a852ccf2" + + strings: + $n = "NOTICE %s" ascii + $t = "TSUNAMI" ascii nocase + $s1 = "NICK" ascii fullword + $s2 = "GETSPOOFS" ascii fullword + $s3 = "IRC" ascii fullword + $s4 = "PONG" ascii + + condition: + uint32(0)==0x464c457f and #n > 40 and #t > 3 and 3 of ($s*) +} + \ No newline at end of file diff --git a/yara_rules/builder_win_royalroad_rtf.yar b/yara_rules/builder_win_royalroad_rtf.yar new file mode 100644 index 0000000..07fae26 --- /dev/null +++ b/yara_rules/builder_win_royalroad_rtf.yar @@ -0,0 +1,16 @@ +rule builder_win_royalroad_rtf { + meta: + id = "065e798b-eadd-4aac-a444-de61b75f0273" + description = "Detects RoyalRoad weaponized RTF documents" + creation_date = "2022-06-23" + author = "Sekoia.io" + version = "1.0" + classification = "TLP:CLEAR" + + strings: + $ = "{\\object\\objocx{\\objdata" + $ = "ods0000" + + condition: uint32be(0) == 0x7B5C7274 and all of them +} + \ No newline at end of file diff --git a/yara_rules/bumblebee_loader.yar b/yara_rules/bumblebee_loader.yar new file mode 100644 index 0000000..55c5559 --- /dev/null +++ b/yara_rules/bumblebee_loader.yar @@ -0,0 +1,19 @@ +rule bumblebee_loader { + meta: + id = "8fd795c7-6896-498c-a892-de9da6427b60" + version = "1.0" + description = "Detect the BUMBLEBEE loader" + author = "Sekoia.io" + creation_date = "2022-05-23" + classification = "TLP:CLEAR" + + strings: + $str0 = { 5a 00 3a 00 5c 00 68 00 6f 00 6f 00 6b 00 65 00 72 00 32 00 5c 00 43 00 6f 00 6d 00 6d 00 6f 00 6e 00 5c 00 6d 00 64 00 35 00 2e 00 63 00 70 00 70 00 } + $str1 = "/gate" ascii + $str2 = "3C29FEA2-6FE8-4BF9-B98A-0E3442115F67" wide + $str3 = "BLACK" ascii + + condition: + uint16be(0) == 0x4d5a and 3 of them +} + \ No newline at end of file diff --git a/yara_rules/bumblebee_vhd.yar b/yara_rules/bumblebee_vhd.yar new file mode 100644 index 0000000..ff1eda2 --- /dev/null +++ b/yara_rules/bumblebee_vhd.yar @@ -0,0 +1,23 @@ +import "magic" + +rule bumblebee_vhd { + meta: + id = "0a9d1ffa-a3ff-4b15-b660-b4c132d5a415" + version = "1.0" + description = "BumbleBee new infection vector via VHD file and powershell second stage" + author = "Sekoia.io" + creation_date = "2022-09-09" + classification = "TLP:CLEAR" + + strings: + $s1 = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" ascii + $s2 = "Invalid partition table" ascii + $s3 = "BOOTMGR" ascii + $s4 = "LNK" ascii + + condition: + magic.mime_type() == "application/x-virtualbox-vhd" and + filesize > 3MB and filesize < 10MB and + all of ($s*) +} + \ No newline at end of file diff --git a/yara_rules/clipper_win_atlas_strings.yar b/yara_rules/clipper_win_atlas_strings.yar new file mode 100644 index 0000000..8d25680 --- /dev/null +++ b/yara_rules/clipper_win_atlas_strings.yar @@ -0,0 +1,23 @@ +rule clipper_win_atlas_strings { + meta: + id = "f08c6af6-c325-4f7d-8686-575b25550d6a" + version = "1.0" + description = "Detects Atlas Clipper" + author = "Sekoia.io" + creation_date = "2023-07-10" + classification = "TLP:CLEAR" + + strings: + $s1 = "C:/Users/box/Desktop/ATLAS/ATLAS/main.go" ascii + $s2 = "ATLAS Clipper" ascii + $s3 = "Victim: %s" ascii + $s4 = "Attacker: %s" ascii + $s5 = "Install Path: %s" ascii + $s6 = "HWID: %s" ascii + $s7 = "Install Date: %s" ascii + $s8 = "https://t.me/atlasclipper_channel" ascii + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/clipper_win_cryptoclippy.yar b/yara_rules/clipper_win_cryptoclippy.yar new file mode 100644 index 0000000..94f5123 --- /dev/null +++ b/yara_rules/clipper_win_cryptoclippy.yar @@ -0,0 +1,26 @@ +rule clipper_win_cryptoclippy { + meta: + id = "eaa98a8e-e29e-43a4-8b2d-2137d33d4116" + version = "1.0" + description = "Finds CryptoClippy samples" + author = "Sekoia.io" + reference = "https://unit42.paloaltonetworks.com/crypto-clipper-targets-portuguese-speakers/" + creation_date = "2023-04-11" + classification = "TLP:CLEAR" + + strings: + $str01 = "C:\\mbedtls\\library\\" ascii + $str02 = "udp://8.8.8.8:53" ascii + $str03 = "Upgrade: websocket" ascii + $str04 = "%s\\%s.lnk" ascii + $str05 = "%s\\%s.ps1" ascii + $str06 = "%s\\%s.bat" ascii + $str07 = "set PSExecutionPolicyPreference=Unrestricted" ascii + $str08 = "schtasks /delete /tn \"%ls\" /f" ascii + $str09 = "SetClipboardData" ascii + $str10 = "SetWinEventHook" ascii + + condition: + uint16(0) == 0x5A4D and 8 of them +} + \ No newline at end of file diff --git a/yara_rules/clwiper_strings.yar b/yara_rules/clwiper_strings.yar new file mode 100644 index 0000000..972241c --- /dev/null +++ b/yara_rules/clwiper_strings.yar @@ -0,0 +1,21 @@ +rule clwiper_strings { + meta: + id = "91e531e2-8548-460f-88a8-cc09abb901e0" + version = "1.0" + author = "Sekoia.io" + creation_date = "2022-09-15" + classification = "TLP:CLEAR" + + strings: + $w1 = "missing args" + $w2 = "wp starts" + $w3 = "Total Bytez : %lld" + $w4 = "percent is %f spent time is %.2fs" + $d1 = "\\\\?\\RawDisk3" + $d2 = "B4B615C28CCD059CF8ED1ABF1C71FE03C0354522990AF63ADF3C911E2287A4B906D47D" + + condition: + uint16be(0) == 0x4d5a and + (3 of ($w*) or all of ($d*)) +} + \ No newline at end of file diff --git a/yara_rules/crime_sload_mainpowershellimplant.yar b/yara_rules/crime_sload_mainpowershellimplant.yar new file mode 100644 index 0000000..15dfa98 --- /dev/null +++ b/yara_rules/crime_sload_mainpowershellimplant.yar @@ -0,0 +1,32 @@ +rule crime_sload_mainpowershellimplant { + meta: + id = "09d268e7-d688-4390-856e-9e9ed47aec04" + version = "1.0" + description = "Detects the main PowerShell implant" + author = "Sekoia.io" + creation_date = "2022-08-03" + classification = "TLP:CLEAR" + + strings: + $c1 = "priority FOREGROUND" + $c2 = "app|Services|RuntimeBroker|Search|host" + $c3 = "([wmiclass]\"win32_Process\").create(" + $c4 = "Start-Sleep -seconds" + $c5 = "while($e -eq 1){ $dCnt++;" + + $d1 = "112,114,105,111,114,105,116,121,32,70,79,82,69,71,82,79,85,78,68" + $d2 = "97,112,112,124,83,101,114,118,105,99,101,115,124,82,117,110,116,105,109,101,66,114,111,107,101,114,124,83,101,97,114,99,104,124,104,111,115,116" + $d3 = "40,91,119,109,105,99,108,97,115,115,93,34,119,105,110,51,50,95,80,114,111,99,101,115,115,34,41,46,99,114,101,97,116,101,40" + $d4 = "83,116,97,114,116,45,83,108,101,101,112,32,45,115,101,99,111,110,100,115" + $d5 = "119,104,105,108,101,40,36,101,32,45,101,113,32,49,41,123,32,36,100,67,110,116,43,43,59" + + $b1 = "priority FOREGROUND" base64 + $b2 = "app|Services|RuntimeBroker|Search|host" base64 + $b3 = "([wmiclass]\"win32_Process\").create(" base64 + $b4 = "Start-Sleep -seconds" base64 + $b5 = "while($e -eq 1){ $dCnt++;" base64 + + condition: + 3 of ($c*) or 3 of ($d*) or 3 of ($b*) and filesize < 30KB +} + \ No newline at end of file diff --git a/yara_rules/crime_sload_powershellarchiveexfiltrator_strings.yar b/yara_rules/crime_sload_powershellarchiveexfiltrator_strings.yar new file mode 100644 index 0000000..70c0921 --- /dev/null +++ b/yara_rules/crime_sload_powershellarchiveexfiltrator_strings.yar @@ -0,0 +1,17 @@ +rule crime_sload_powershellarchiveexfiltrator_strings { + meta: + id = "3934696a-2116-49cb-9f75-3740767ad6f3" + version = "1.0" + author = "Sekoia.io" + creation_date = "2022-08-02" + classification = "TLP:CLEAR" + + strings: + $ = "if ($wr1 -or $wr2){" + $ = "if ($zp1 -or $zp2){" + $ = "-join ((65..90) + (97..122) | Get-Random -Count 16 | % {[char]$_});" + + condition: + all of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/crime_sload_scheduledtask_dropper_strings.yar b/yara_rules/crime_sload_scheduledtask_dropper_strings.yar new file mode 100644 index 0000000..a4700ec --- /dev/null +++ b/yara_rules/crime_sload_scheduledtask_dropper_strings.yar @@ -0,0 +1,17 @@ +rule crime_sload_scheduledtask_dropper_strings { + meta: + id = "01c51da8-71a5-449f-a609-933c37bc2e63" + version = "1.0" + author = "Sekoia.io" + creation_date = "2022-08-02" + classification = "TLP:CLEAR" + + strings: + $ = "$hh='hi'+'dd'+'en';" + $ = { 7D 65 6C 73 65 7B 0A 24 72 73 3D 30 3B 0A 7D 0A } + $ = { 6B 69 6C 6C 20 2D 6E 61 6D 65 20 2A 77 65 72 73 68 65 6C 2A } + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/crime_sload_vbs_downloader_strings_1.yar b/yara_rules/crime_sload_vbs_downloader_strings_1.yar new file mode 100644 index 0000000..9fee230 --- /dev/null +++ b/yara_rules/crime_sload_vbs_downloader_strings_1.yar @@ -0,0 +1,18 @@ +rule crime_sload_vbs_downloader_strings_1 { + meta: + id = "77ff0d21-9249-43b2-9a6d-87988a2dec3b" + version = "1.0" + description = "Detects an sLoad downloader based on strings" + author = "Sekoia.io" + creation_date = "2022-08-02" + classification = "TLP:CLEAR" + + strings: + $ = "On Error Resume Next" + $ = {0A [4] 3D 41 72 72 61 79} + $ = { 2E 50 61 74 74 65 72 6E 20 3D 20 22 28 [4-10] 7C [4-10] 7C [4-10] 7C [4-10] 7C [4-10] 7C [4-10] 7C [4-10] 7C } + + condition: + all of them and filesize < 20KB +} + \ No newline at end of file diff --git a/yara_rules/crime_sload_vbs_downloader_strings_2.yar b/yara_rules/crime_sload_vbs_downloader_strings_2.yar new file mode 100644 index 0000000..f5e4930 --- /dev/null +++ b/yara_rules/crime_sload_vbs_downloader_strings_2.yar @@ -0,0 +1,18 @@ +rule crime_sload_vbs_downloader_strings_2 { + meta: + id = "77ff0d21-9249-43b2-9a6d-87988a2dec3b" + version = "1.0" + description = "Detects an sLoad downloader based on strings" + author = "Sekoia.io" + creation_date = "2022-08-02" + classification = "TLP:CLEAR" + + strings: + $ = "On Error Resume Next" + $ = {0A [4] 3D 41 72 72 61 79} + $ = { 2E 50 61 74 74 65 72 6E 20 3D 20 22 28 [4-10] 7C [4-10] 7C [4-10] 7C [4-10] 7C [4-10] 7C [4-10] 7C [4-10] 7C } + + condition: + all of them and filesize < 20KB +} + \ No newline at end of file diff --git a/yara_rules/crime_sload_vbs_wsf_downloader.yar b/yara_rules/crime_sload_vbs_wsf_downloader.yar new file mode 100644 index 0000000..b169c03 --- /dev/null +++ b/yara_rules/crime_sload_vbs_wsf_downloader.yar @@ -0,0 +1,19 @@ +rule crime_sload_vbs_wsf_downloader { + meta: + id = "55d87205-5f8f-479a-a616-bf3fce571f03" + version = "1.0" + description = "Detects sLoad Downloader" + author = "Sekoia.io" + creation_date = "2022-08-01" + classification = "TLP:CLEAR" + + strings: + $ = { 53 65 74 20 6c 69 6e 6b 20 3d 20 [5-10] 2e 43 72 65 61 74 65 53 68 6f 72 74 63 75 74 28 } + $ = { 2e 72 75 6e 20 22 63 3a 5c 55 73 65 72 73 5c 50 75 62 6c 69 63 5c 44 6f 63 75 6d 65 6e 74 73 5c [5-10] 2e 6c 6e 6b 20 2f 63 20 70 6f 77 65 72 73 68 65 6c 6c } + $ = { 3d 22 20 2f 63 20 70 6f 77 65 72 73 68 65 6c 6c 20 22 } + $ = { 20 2f 63 20 70 6f 77 65 72 73 68 65 6c 6c 20 22 20 26 20 } + + condition: + 2 of them and filesize < 1KB +} + \ No newline at end of file diff --git a/yara_rules/crime_sload_zip_archives.yar b/yara_rules/crime_sload_zip_archives.yar new file mode 100644 index 0000000..ff1ae16 --- /dev/null +++ b/yara_rules/crime_sload_zip_archives.yar @@ -0,0 +1,20 @@ +rule crime_sload_zip_archives { + meta: + id = "5335ad65-bca5-4937-8634-46cbd7aa1b0e" + version = "1.0" + description = "Detects ZIP archives used by sLOad" + author = "Sekoia.io" + creation_date = "2022-08-01" + classification = "TLP:CLEAR" + + strings: + $pic = { 00 00 00 [6] 2E ( 70 6E 67 | 67 69 66 | 6a 70 67 | 6A 70 65 67 ) } + $pdf = { 00 00 00 [8] 2E 70 64 66 } + $vbs = { ( 4c 65 67 67 69 6d 69 | 66 69 73 63 ) 2e ( 77 73 66 | 76 62 73 ) } + + condition: + uint16be(0) == 0x504B + and filesize < 30KB + and all of them +} + \ No newline at end of file diff --git a/yara_rules/crimeware_njrat_strings.yar b/yara_rules/crimeware_njrat_strings.yar new file mode 100644 index 0000000..2485525 --- /dev/null +++ b/yara_rules/crimeware_njrat_strings.yar @@ -0,0 +1,25 @@ +rule crimeware_njrat_strings { + meta: + id = "215807ae-fbcb-478d-8941-e0787b883669" + version = "1.0" + description = "Detects njRAT based on some strings" + author = "Sekoia.io" + creation_date = "2022-08-22" + classification = "TLP:CLEAR" + + strings: + $ = "set cdaudio door closed" wide + $ = "set cdaudio door open" wide + $ = "ping 0" wide + $ = "[endof]" wide + $ = "TiGeR-Firewall" wide + $ = "NetSnifferCs" wide + $ = "IPBlocker" wide + $ = "Sandboxie Control" wide + + condition: + uint16be(0) == 0x4d5a and + filesize < 1MB and + 5 of them +} + \ No newline at end of file diff --git a/yara_rules/crybercrime_prophetspider_proxy.yar b/yara_rules/crybercrime_prophetspider_proxy.yar new file mode 100644 index 0000000..bf4e5dc --- /dev/null +++ b/yara_rules/crybercrime_prophetspider_proxy.yar @@ -0,0 +1,42 @@ +import "pe" + +rule crybercrime_prophetspider_proxy { + meta: + id = "b7637fc3-bf81-40c4-869c-1c283574e0a7" + version = "1.0" + description = "Detects the Winntaa decryption loop or imphash" + author = "Sekoia.io" + creation_date = "2022-02-17" + classification = "TLP:CLEAR" + + strings: + $ = { 56 + 57 + 48 8D 95 F0 FE FF FF + 31 C0 + 66 21 02 + 48 89 CE + AC + 48 89 D7 + 4C 89 C2 + 88 D4 + 30 C2 + 0F B6 CA + 48 89 95 E8 FE FF FF + AC + 30 E0 + AA + E2 FA + 88 C8 + AA + 48 8D 85 F0 FE FF FF + 48 8B 95 E8 FE FF FF + 5F + 5E + C3 } + + condition: + uint16be(0) == 0x4d5a and + (all of them or pe.imphash() == "55e0b8e5b4d787c680ada4e450789a4d") +} + \ No newline at end of file diff --git a/yara_rules/crypter_vbs_to_exe.yar b/yara_rules/crypter_vbs_to_exe.yar new file mode 100644 index 0000000..bf888d2 --- /dev/null +++ b/yara_rules/crypter_vbs_to_exe.yar @@ -0,0 +1,20 @@ +rule crypter_vbs_to_exe { + meta: + id = "33ed286f-3055-452e-952b-abaf11a543a1" + version = "1.0" + description = "first stage of Crypter-VBS-to-EXE dropped on infected hosted" + author = "Sekoia.io" + creation_date = "2023-01-03" + classification = "TLP:CLEAR" + + strings: + $theDot = ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" ascii + $s1 = "cmd.exe /c curl" ascii + $s2 = "WScript.Sleep(3000)" ascii + $s3 = "runCmd = \"cmd.exe /c powershell.exe -exec Bypass -C \" + myVar +" ascii + $s4 = "WshShell.Run \"cmd /c \" & runCmd, 0, True" ascii + + condition: + #theDot > 200 and all of ($s*) +} + \ No newline at end of file diff --git a/yara_rules/crypter_win_dotrunpex.yar b/yara_rules/crypter_win_dotrunpex.yar new file mode 100644 index 0000000..302debf --- /dev/null +++ b/yara_rules/crypter_win_dotrunpex.yar @@ -0,0 +1,16 @@ +rule crypter_win_dotrunpex { + meta: + id = "6fb4ffe0-3a5c-432c-8ae2-404bb5960c30" + version = "1.0" + description = "Detect the dotRunpeX crypter based on strings" + author = "Sekoia.io" + creation_date = "2023-06-08" + classification = "TLP:CLEAR" + + strings: + $ = {52 00 75 00 6e 00 70 00 65 00 58 00 2e 00 53 00 74 00 75 00 62 00 2e 00 46 00 72 00 61 00 6d 00 65 00 77 00 6f 00 72 00 6b 00 2e 00 65 00 78 00 65} //R.u.n.p.e.X...S.t.u.b...F.r.a.m.e.w.o.r.k...e.x.e + + condition: + uint16(0)==0x5A4D and all of them +} + \ No newline at end of file diff --git a/yara_rules/darkriver_encodedurl.yar b/yara_rules/darkriver_encodedurl.yar new file mode 100644 index 0000000..a367d58 --- /dev/null +++ b/yara_rules/darkriver_encodedurl.yar @@ -0,0 +1,22 @@ +rule darkriver_encodedurl { + meta: + id = "60f1676f-dade-4376-9980-f510dff52ae5" + version = "1.0" + description = "Detects encoding URL inside docx documents" + author = "Sekoia.io" + creation_date = "2023-10-10" + classification = "TLP:CLEAR" + hash1 = "5c9551388213f54c4b54cd42ccb034d8d9173a4bbfcf8b666e0db8df929762e7" + hash1 = "13de9f39b1ad232e704b5e0b5051800fcd844e9f661185ace8287a23e9b3868e" + hash1 = "3b05e89ff2338472cc493d59bae450338effd29f0ed7d46fb999709e63cf2472" + + strings: + $s1 = "mhtml:http" + $s2 = "&_ts=" + $header = "" + + condition: + filesize < 500KB and + any of ($s*) and $header at 0 +} + \ No newline at end of file diff --git a/yara_rules/dotnet_injector_new_payload.yar b/yara_rules/dotnet_injector_new_payload.yar new file mode 100644 index 0000000..23c46bf --- /dev/null +++ b/yara_rules/dotnet_injector_new_payload.yar @@ -0,0 +1,31 @@ +import "dotnet" + +rule dotnet_injector_new_payload { + meta: + id = "b0a1d471-5381-4fa8-8563-7e72ecd15bed" + version = "1.0" + description = "New dotnet injector" + author = "Sekoia.io" + creation_date = "2022-12-21" + classification = "TLP:CLEAR" + + strings: + $f1 = "DownloadFile" ascii + $f2 = "StreamReader" ascii + $f3 = "ReadToEnd" ascii + $f4 = "Reverse" ascii + $f5 = "Load" ascii + $f6 = "StringToByteArray" ascii + $s1 = "Admin" wide + $s2 = "User" wide + $p1 = "\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\" wide + $p2 = ".lnk" wide + + condition: + filesize < 300KB and + all of ($f*) and + all of ($s*) and + all of ($p*) and + dotnet.is_dotnet +} + \ No newline at end of file diff --git a/yara_rules/downloader_kimsuky_lnk.yar b/yara_rules/downloader_kimsuky_lnk.yar new file mode 100644 index 0000000..10c2375 --- /dev/null +++ b/yara_rules/downloader_kimsuky_lnk.yar @@ -0,0 +1,23 @@ +rule downloader_kimsuky_lnk { + meta: + id = "3831d115-7874-4bc9-aeb4-d2cb9bc2b5c9" + version = "1.0" + description = "Detect Kimsuky LNK" + author = "Sekoia.io" + creation_date = "2024-07-16" + classification = "TLP:CLEAR" + reference = "https://blogs.jpcert.or.jp/en/2024/07/attack-activities-by-kimsuky-targeting-japanese-organizations.html" + hash1 = "3065b8e4bb91b4229d1cea671e8959da8be2e7482067e1dd03519c882738045e" + hash2 = "d912f49d24792aa7197509f76e2097ac3858cde23199e1b40f2516948d39c589" + hash3 = "e936445935c4a636614f7113e4121695a5f3e4a6c137b7cdcceb6f629aa957c4" + hash4 = "fe156159a26f8b7c140db61dd8b136e1c8103a800748fe9b70a3a3fdf179d3c3" + + strings: + $ = "AType: Text Document" wide + $ = "Size: 5.23 KB" wide + $ = "Date modified: 01/02/2020 11:23" wide + + condition: + all of them +} + \ No newline at end of file diff --git a/yara_rules/downloader_mac_rustbucket.yar b/yara_rules/downloader_mac_rustbucket.yar new file mode 100644 index 0000000..9d174c8 --- /dev/null +++ b/yara_rules/downloader_mac_rustbucket.yar @@ -0,0 +1,32 @@ +rule downloader_mac_rustbucket { + meta: + id = "5a003b68-ad9a-47f9-b157-dd898181dac2" + version = "1.0" + description = "RustBucket fake PDF reader" + author = "Sekoia.io" + creation_date = "2023-04-24" + classification = "TLP:CLEAR" + reference = "https://www.jamf.com/blog/bluenoroff-apt-targets-macos-rustbucket-malware/" + hash1 = "38106b043ede31a66596299f17254d3f23cbe1f983674bf9ead5006e0f0bf880" + hash2 = "bea33fb3205319868784c028418411ee796d6ee3dfe9309f143e7e8106116a49" + hash3 = "7981ebf35b5eff8be2f3849c8f3085b9cec10d9759ff4d3afd46990520de0407" + hash4 = "e74e8cdf887ae2de25590c55cb52dad66f0135ad4a1df224155f772554ea970c" + + strings: + $down_exec1 = "_down_update_run" nocase + $down_exec2 = "downAndExec" nocase + $encrypt1 = "_encrypt_pdf" + $encrypt2 = "_encrypt_data" + $error_msg1 = "_alertErr" + $error_msg2 = "_show_error_msg" + $view_pdf1 = "-[PEPWindow view_pdf:]" + $view_pdf2 = "-[PEPWindow viewPDF:]" + $macho_magic = {CF FA ED FE} + $java_magic = {CA FE BA BE} + + condition: + ($macho_magic at 0 or $java_magic at 0) + and 5 of them + and filesize > 50KB +} + \ No newline at end of file diff --git a/yara_rules/downloader_mac_rustbucket_swiftloader.yar b/yara_rules/downloader_mac_rustbucket_swiftloader.yar new file mode 100644 index 0000000..79746ed --- /dev/null +++ b/yara_rules/downloader_mac_rustbucket_swiftloader.yar @@ -0,0 +1,20 @@ +rule downloader_mac_rustbucket_swiftloader { + meta: + id = "bdbc95db-5d58-4c96-91f9-34b653e67f50" + version = "1.0" + description = "Detect the file com.EdoneViewer in the new version of RustBucker 2023-10" + author = "Sekoia.io" + creation_date = "2023-12-05" + classification = "TLP:CLEAR" + hash1 = "7c5bf60787bfd076c8806eaa4f1185f5b9fda69008376624ab3d17f207eb16a4" + hash2 = "bc90adde92bd47b4de7d384e5b20c1a1791d603629bd0fcba4b550fb35e93216" + hash3 = "c9a7b42c7b29ca948160f95f017e9e9ae781f3b981ecf6edbac943e52c63ffc8" + + strings: + $ = "/Users/ghost/Desktop/EdoneViewer/EdoneViewer/" + $ = "EdoneViewerApp.swift" + + condition: + 1 of them +} + \ No newline at end of file diff --git a/yara_rules/downloader_mac_smooth_operator.yar b/yara_rules/downloader_mac_smooth_operator.yar new file mode 100644 index 0000000..a3d1082 --- /dev/null +++ b/yara_rules/downloader_mac_smooth_operator.yar @@ -0,0 +1,17 @@ +rule downloader_mac_smooth_operator { + meta: + id = "c132b3f0-f536-4a66-bcf8-2a95c258c414" + version = "1.0" + description = "Detect the Smooth_Operator malware" + author = "Sekoia.io" + creation_date = "2023-07-04" + classification = "TLP:CLEAR" + + strings: + $ = "%s/.main_storage" + $ = "%s/UpdateAgent" + + condition: + uint32be(0)==0xcafebabe and all of them +} + \ No newline at end of file diff --git a/yara_rules/downloader_win_andarloader.yar b/yara_rules/downloader_win_andarloader.yar new file mode 100644 index 0000000..e1e547a --- /dev/null +++ b/yara_rules/downloader_win_andarloader.yar @@ -0,0 +1,21 @@ +import "pe" +import "hash" + +rule downloader_win_andarloader { + meta: + id = "96dd737e-601c-4370-9fa6-4bbafafae203" + version = "1.0" + description = "Detect the AndarLoader downloader used by Andariel" + author = "Sekoia.io" + creation_date = "2023-09-04" + classification = "TLP:CLEAR" + hash1 = "02135f60f3edff0b9baa4c20715ee6a80c94f282079bf879265f5e020d37cf88" + hash2 = "54ed7a7430974cc2ea694f49f3e637b835dcd24aa19d66af854ad47b87068c92" + + condition: + for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "b338ad077c7f5be85c33def7287198841d55af8cd1ad856fdcd16fdc78f18838" + ) + and filesize < 100KB +} + \ No newline at end of file diff --git a/yara_rules/downloader_win_apt33_tickler.yar b/yara_rules/downloader_win_apt33_tickler.yar new file mode 100644 index 0000000..9632847 --- /dev/null +++ b/yara_rules/downloader_win_apt33_tickler.yar @@ -0,0 +1,30 @@ +import "pe" +import "hash" + +rule downloader_win_apt33_tickler { + meta: + id = "e1f704d6-d527-479a-8311-d286c06768ac" + version = "1.0" + description = "Detect the downloader used by APT33 to diwnload Tickler" + author = "Sekoia.io" + creation_date = "2024-08-29" + classification = "TLP:CLEAR" + + condition: + uint16be(0) == 0x4d5a and + pe.imphash() == "e43c58659b5b3082387307603478881a" + or hash.md5(pe.rich_signature.clear_data) == "d30bd7875b225709ecf95bf68dbd435f" + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "d7d2079d0a656c06a03f2c277bb08bda" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "61a1425e6a0d28e29c6fd3d451ac3717" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "916bf96ed3274ce8322d9f370432844f" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "3fab9d4ae989d53cecb2f443b8ce88d0" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "e0967483e074da72ceff4dea3bc17530" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "b4a571736b6646765155ffbd57c27c83" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "35c88ba521887f8fe1b2501f8cd8bd98" + ) + or for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "636dc666c7496cb3382b029fed53473f181cdc24405886c468e51a103d78b4d4" + ) +} + \ No newline at end of file diff --git a/yara_rules/downloader_win_cobianrat.yar b/yara_rules/downloader_win_cobianrat.yar new file mode 100644 index 0000000..573fbf3 --- /dev/null +++ b/yara_rules/downloader_win_cobianrat.yar @@ -0,0 +1,24 @@ +rule downloader_win_cobianrat { + meta: + id = "7a86c17f-bf4e-4465-9488-244b75fc36f1" + version = "1.0" + description = "Detect CobianRAT downloader" + author = "Sekoia.io" + creation_date = "2024-08-23" + classification = "TLP:CLEAR" + hash = "7a70779d9d7de5e370fac0fa2d4ccd13" + hash = "2ce40599a4990680db3af5defcd5381a" + hash = "56515c48f82475e7bb6a26b027a459d7" + hash = "3450bece12bd8103d5e718a2661d0404" + hash = "132858739129d2b863dc547facbed7e9" + hash = "693bd96d162c54d7e9605580eaf54a6e" + hash = "d03a4988e22e6c7b2a03efa2bdb1502d" + hash = "ab8c68b907ec2ce316bf18f00938710c" + + strings: + $ = {24 00 44 00 6F 00 77 00 6E 00 6C 00 6F 00 61 00 64 00 55 00 72 00 6C 00 20 00 3D 00 20 00 27} + + condition: + uint16be(0) == 0x4d5a and all of them +} + \ No newline at end of file diff --git a/yara_rules/downloader_win_curl_agent.yar b/yara_rules/downloader_win_curl_agent.yar new file mode 100644 index 0000000..4da3376 --- /dev/null +++ b/yara_rules/downloader_win_curl_agent.yar @@ -0,0 +1,20 @@ +rule downloader_win_curl_agent { + meta: + id = "ddeb2d8f-1b10-4a33-b768-d19412e8551a" + version = "1.0" + description = "Detect the downloader used by Bluenoroff to install it CurlAgent" + author = "Sekoia.io" + creation_date = "2023-05-02" + classification = "TLP:CLEAR" + + strings: + $ = "%s\\marcoor.dll" wide + $ = "curl -A cur1-agent -L %s -s -d dl" + $ = "curl -A cur1-agent -L %s -s -d da" + $ = "cmd /c timeout /t 10 & rundll32 \"%s\" #1" wide + $ = "cmd /c timeout /t 10 & Del /f /q \"%s\" & attrib -s -h \"%s\" & rundll32 \"%s\" #1" wide + + condition: + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/downloader_win_donot.yar b/yara_rules/downloader_win_donot.yar new file mode 100644 index 0000000..7944f07 --- /dev/null +++ b/yara_rules/downloader_win_donot.yar @@ -0,0 +1,20 @@ +rule downloader_win_donot { + meta: + id = "31b153cc-a4b9-40a0-8bcb-ce1370645b4b" + version = "1.0" + description = "Detect the DoNot's downloader malware. There are big binaries in downloader strings." + author = "Sekoia.io" + creation_date = "2023-03-20" + classification = "TLP:CLEAR" + + strings: + // start of binary, translated: bin(bin("cmd.exe /C ping 1.1.1.1 -n 1 -w 3000 > Nul & Del /f /q "%s"")) + $ = "001100000011000100110001001100000011000000110000001100010011000100110000001100010011000100110000001100010011000100110000001100010011" + // other binary strings + $ = "01010011011011110110011001110100011101110110000101110010011001010101110001001101011010010110001101110010011011110111001101101111011001100111010001011100010101110110100101101110011001000110111101110111011100110101110001000011011101010111001001110010011001010110111001110100010101100110010101110010011100110110100101101111011011100101110001010101011011100110100101101110011100110111010001100001011011000110110000000000" + $ = "0101110001110011011110010111001101110100011001010110110100110011001100100101110001110010011101010110111001100100011011000110110000110011001100100010111001100101011110000110010100000000" + + condition: + 1 of them +} + \ No newline at end of file diff --git a/yara_rules/downloader_win_fake_tor_browser.yar b/yara_rules/downloader_win_fake_tor_browser.yar new file mode 100644 index 0000000..e808d51 --- /dev/null +++ b/yara_rules/downloader_win_fake_tor_browser.yar @@ -0,0 +1,19 @@ +import "pe" +import "hash" + +rule downloader_win_fake_tor_browser { + meta: + id = "6b070ba6-490b-43c2-9a01-65812d829eeb" + version = "1.0" + description = "Detect fake TOR browser used to spy Chinese TOR users" + author = "Sekoia.io" + creation_date = "2022-10-05" + classification = "TLP:CLEAR" + reference = "https://securelist.com/onionpoison-infected-tor-browser-installer-youtube/107627/" + + condition: + for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "7172f95f934574be95c0250fb42b8f51" + ) +} + \ No newline at end of file diff --git a/yara_rules/downloader_win_newsterminal.yar b/yara_rules/downloader_win_newsterminal.yar new file mode 100644 index 0000000..c008bb2 --- /dev/null +++ b/yara_rules/downloader_win_newsterminal.yar @@ -0,0 +1,21 @@ +rule downloader_win_newsterminal { + meta: + id = "2f9aae45-e3bd-4d87-b336-5d141738952b" + version = "1.0" + description = "Detect the PowerShell based downloader used by APT42 called NEWSTERMINAL" + author = "Sekoia.io" + creation_date = "2024-08-26" + classification = "TLP:CLEAR" + hash = "2b756515400d7e3b6e21ee3a83f313c8" + + strings: + $ = "Start-Process -FilePath $takeownCommand -ArgumentList $takeownArgs -Wait -NoNewWindow" + $ = "function Download-And-Extract-Dll {" + // $icaclsArgs = $destinationFilePath, "/grant", "Administrators:F", "/c", "/q" + $ = {24 69 63 61 63 6C 73 41 72 67 73 20 3D 20 24 64 65 73 74 69 6E 61 74 69 6F 6E 46 69 6C 65 50 61 74 68 2C 20 22 2F 67 72 61 6E 74 22 2C 20 22 41 64 6D 69 6E 69 73 74 72 61 74 6F 72 73 3A 46 22 2C 20 22 2F 63 22 2C 20 22 2F 71 22} + $ = "$publicip=(iwr http://127.0.0.1:4040/api/tunnels" + + condition: + 1 of them and filesize < 30KB +} + \ No newline at end of file diff --git a/yara_rules/downloader_win_search.yar b/yara_rules/downloader_win_search.yar new file mode 100644 index 0000000..9cd54a4 --- /dev/null +++ b/yara_rules/downloader_win_search.yar @@ -0,0 +1,19 @@ +rule downloader_win_search { + meta: + id = "8094ddda-6294-4dee-93cb-de79aaed1ec6" + version = "1.0" + description = "'Search.exe' script used by APT42" + author = "Sekoia.io" + creation_date = "2024-08-23" + classification = "TLP:CLEAR" + hash = "a29fa85ecfc0e5554c21f3b9db185de97b3504517403f4aa102adbd2c46dc1bf" + hash = "f83e2b3be2e6db20806a4b9b216edc7508fa81ce60bf59436d53d3ae435b6060" + + strings: + $ = "C:\\Users\\pc\\source\\repos\\Search\\Search\\obj\\Debug\\Search.pdb" + + condition: + uint16be(0) == 0x4d5a and + all of them +} + \ No newline at end of file diff --git a/yara_rules/dropper_mac_lazarus_manuscrypt.yar b/yara_rules/dropper_mac_lazarus_manuscrypt.yar new file mode 100644 index 0000000..a9c5cf0 --- /dev/null +++ b/yara_rules/dropper_mac_lazarus_manuscrypt.yar @@ -0,0 +1,22 @@ +rule dropper_mac_lazarus_manuscrypt { + meta: + id = "6138bd0c-1fcf-4586-b2b6-29955c7d6266" + version = "1.0" + description = "MacOS Manuscrypt dropped by TraderTraitor" + author = "Sekoia.io" + creation_date = "2022-04-19" + classification = "TLP:CLEAR" + hash = "dced1acbbe11db2b9e7ae44a617f3c12d6613a8188f6a1ece0451e4cd4205156" + hash = "9d9dda39af17a37d92b429b68f4a8fc0a76e93ff1bd03f06258c51b73eb40efa" + + strings: + $ = "networksetup -getwebproxy '%s'" ascii + $ = "Cookie: _ga=%s%02d%d%d%02d%s" ascii + $ = "networksetup -listallnetworkservices" ascii + $ = "gid=%s%02d%d%03d%s" ascii + + condition: + uint32(0) == 0xFEEDFACF + and all of them +} + \ No newline at end of file diff --git a/yara_rules/dropper_win_konni_cab.yar b/yara_rules/dropper_win_konni_cab.yar new file mode 100644 index 0000000..d569e1c --- /dev/null +++ b/yara_rules/dropper_win_konni_cab.yar @@ -0,0 +1,19 @@ +rule dropper_win_konni_cab { + meta: + id = "87a209d5-667a-4a81-837a-660ab98c33c8" + version = "1.0" + description = "Detect the CAB files used to drop the KONNI malware" + author = "Sekoia.io" + creation_date = "2023-09-26" + classification = "TLP:CLEAR" + + strings: + $magic = "MSCF" + $file2 = "check.bat" + $file3 = "wpnprv64.dll" + $file4 = "wpnprv32.dll" + + condition: + $magic at 0 and all of ($file*) +} + \ No newline at end of file diff --git a/yara_rules/dropper_win_ninerat.yar b/yara_rules/dropper_win_ninerat.yar new file mode 100644 index 0000000..f7e2765 --- /dev/null +++ b/yara_rules/dropper_win_ninerat.yar @@ -0,0 +1,42 @@ +import "pe" +import "hash" + +rule dropper_win_ninerat { + meta: + id = "798e3bee-4cee-4647-abda-3c3dcc602f0a" + version = "1.0" + description = "NineRAT dropper" + author = "Sekoia.io" + creation_date = "2023-12-12" + classification = "TLP:CLEAR" + reference = "https://blog.talosintelligence.com/lazarus_new_rats_dlang_and_telegram/" + hash1 = "534f5612954db99c86baa67ef51a3ad88bc21735bce7bb591afa8a4317c35433" + hash2 = "f91188d23b14526676706a5c9ead05c1a91ea0b9d6ac902623bc565e1c200a59" + + strings: + $ = "\\x64\\Release\\Dropper.pdb" + $ = "TelegramRat\\lastest\\Dropper" + + condition: + all of them + + // Imphash + or pe.imphash() == "92b8e9dea06fd5719e29a510e95b92ac" + + // Rich Header + or hash.md5(pe.rich_signature.clear_data) == "ba1ea20fe779ef0b747e5073c0881a99" + + // Section + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "c0471e0a78eef692b567cd89eeaddf08" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "965dc8b7c98325ca3d3371ced8424823" + ) + + // Resources + or for any i in (0..pe.number_of_resources-1) : ( + hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "bae1db350e313bf7bbd3b2178b20e6f6dd9b0331780099374edae5a99625bc5b" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "1abb447513b4435837029933e722b6ed92222291571a8ce0a306c9f6a335aa19" + or hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "ffbcd5bbe6c02aa5c993886811d7597f020abd6665fc82af133c5756ab72fb0a" + ) +} + \ No newline at end of file diff --git a/yara_rules/dropper_win_romcom_dropper.yar b/yara_rules/dropper_win_romcom_dropper.yar new file mode 100644 index 0000000..7462514 --- /dev/null +++ b/yara_rules/dropper_win_romcom_dropper.yar @@ -0,0 +1,32 @@ +import "pe" +import "hash" + +rule dropper_win_romcom_dropper { + meta: + id = "ca1b7114-5a83-4620-a9e2-8228df2be7b1" + version = "1.0" + description = "Detect the dropper of RomCom malware" + author = "Sekoia.io" + creation_date = "2022-11-04" + classification = "TLP:CLEAR" + + strings: + $ = "regInjecttNew.dll" + + condition: + //Strings + uint16(0)==0x5A4D and all of them + + //Imphash + or pe.imphash()=="643c3d5c721741ad5b90c98c48007038" + + //Sections + or for any i in (0..pe.number_of_sections-1) : ( + hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "1c397f4ddafdcfd12bbc41cae45cdf9f" + or hash.md5(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) == "b71dc0007c685c790fb2542ddcf284f4" + ) + + //Vhash + or vhash=="175076655d155515655038z55?z1" +} + \ No newline at end of file diff --git a/yara_rules/dropper_win_selfau3.yar b/yara_rules/dropper_win_selfau3.yar new file mode 100644 index 0000000..b7035ab --- /dev/null +++ b/yara_rules/dropper_win_selfau3.yar @@ -0,0 +1,25 @@ +rule dropper_win_selfau3 { + meta: + id = "2d005a54-b013-40e9-b88a-30454e4b22af" + version = "1.0" + description = "Finds SelfAU3 Dropper samples based on specific strings" + author = "Sekoia.io" + creation_date = "2024-02-12" + classification = "TLP:CLEAR" + + strings: + $sfx = "!Require Windows" ascii + + $ins01 = ";!@Install@!UTF-8!" ascii + $set = {53 65 74 45 6e 76 69 72 6f 6e 6d 65 6e 74 3d 22 [1-15] 3d ?? 22} //SetEnvironment="??..?=?" + $run = "RunProgram=\"hidcon:c" ascii + $ins02 = ";!@InstallEnd@!" ascii + + condition: + $sfx at 77 and + $set in (@ins01..@ins01+500) and + #set > 5 and + $run in (@set..@set+1000) and + $ins02 in (@run..@run+500) +} + \ No newline at end of file diff --git a/yara_rules/emmenhtal_strings_hta_exe.yar b/yara_rules/emmenhtal_strings_hta_exe.yar new file mode 100644 index 0000000..883680f --- /dev/null +++ b/yara_rules/emmenhtal_strings_hta_exe.yar @@ -0,0 +1,22 @@ +rule emmenhtal_strings_hta_exe { + meta: + id = "64e08610-e8a4-4edd-8f6b-d4e8d2b47d87" + version = "1.0" + description = "Emmenhtal Loader string" + author = "Sekoia.io" + creation_date = "2024-09-06" + classification = "TLP:CLEAR" + hash = "e86a22f1c73b85678e64341427c7193ba65903f3c0f29af2e65d7c56d833d912" + + strings: + $char = / = String\.fromCharCode\([a-zA-Z]{2,4},[a-zA-Z]{2,4},/ + $var = "var " + $eval = "eval(" + $script1 = "MZ" + //$hta = "" NOT IN ALL SAMPLES + + condition: + uint16be(0) == 0x4d5a and all of them and $var in (@script1..@script1+2000) and $char in (@var..@var+100) +} + \ No newline at end of file diff --git a/yara_rules/evilnumpayload_fmtstr.yar b/yara_rules/evilnumpayload_fmtstr.yar new file mode 100644 index 0000000..8f92f50 --- /dev/null +++ b/yara_rules/evilnumpayload_fmtstr.yar @@ -0,0 +1,29 @@ +rule evilnumpayload_fmtstr { + meta: + id = "980c58e4-e04d-4076-a92e-2c04ced19ece" + version = "1.1" + description = "Detect payload of EvilNum" + author = "Sekoia.io" + creation_date = "2022-07-25" + classification = "TLP:CLEAR" + + strings: + + $fmtstr01 = "{\"v\":\"" ascii wide + $fmtstr02 = ",\"u\":\"" ascii wide + $fmtstr03 = ",\"a\":\"" ascii wide + $fmtstr04 = ",\"w\":\"" ascii wide + $fmtstr05 = ",\"d\":\"" ascii wide + $fmtstr06 = ",\"n\":\"" ascii wide + $fmtstr07 = ",\"r\":\"1\"" ascii wide + $fmtstr08 = ",\"r\":\"0\"" ascii wide + $fmtstr09 = ",\"xn\":\"" ascii wide + $fmtstr10 = ",\"s\":0}" ascii wide + $fmtstr11 = "{\"u\":\"" ascii wide + $fmtstr12 = "\",\"sc\":1" ascii wide + $fmtstr13 = ",\"dt\":\"" ascii wide + + condition: + 8 of ($fmtstr*) +} + \ No newline at end of file diff --git a/yara_rules/exploit_cve20191458_strings.yar b/yara_rules/exploit_cve20191458_strings.yar new file mode 100644 index 0000000..ea42645 --- /dev/null +++ b/yara_rules/exploit_cve20191458_strings.yar @@ -0,0 +1,22 @@ +rule exploit_cve20191458_strings { + meta: + id = "0be4a550-0f0a-4596-ab32-aafaececf919" + version = "1.0" + description = "Detects compiled exploit for CVE-2019-1458 (Generic)" + author = "Sekoia.io" + creation_date = "2022-08-29" + classification = "TLP:CLEAR" + + strings: + $ = "[-] Failed to create SploitWnd window" + $ = "[+] ProcessCreated with pid %d!" + $ = "[!] Exploit fail, test:0x%p,tagWND:0x%p, error:0x%lx" + $ = "[*] tagWND: 0x%p, tagCLS:0x%p, gap:0x%llx" + $ = "[*] Simulating alt key press" + + condition: + uint16be(0) == 0x4d5a and + filesize < 200KB and + 3 of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_ez_pwnkit_strings.yar b/yara_rules/exploit_ez_pwnkit_strings.yar new file mode 100644 index 0000000..cedb2d7 --- /dev/null +++ b/yara_rules/exploit_ez_pwnkit_strings.yar @@ -0,0 +1,19 @@ +rule exploit_ez_pwnkit_strings { + meta: + id = "24301f35-8174-4e0d-b14a-fc7e45a29b26" + version = "1.0" + description = "Detects ez-pwnkit exploit" + author = "Sekoia.io" + creation_date = "2024-01-22" + classification = "TLP:CLEAR" + + strings: + $s1 = "go.buildid" + $s2 = "github.com/OXDBXKXO/ez-pwnkit" + + condition: + uint32be(0) == 0x7f454c46 and + filesize < 5MB and + $s1 and #s2 > 5 +} + \ No newline at end of file diff --git a/yara_rules/exploit_linux_eop_cve20177308_strings.yar b/yara_rules/exploit_linux_eop_cve20177308_strings.yar new file mode 100644 index 0000000..afca844 --- /dev/null +++ b/yara_rules/exploit_linux_eop_cve20177308_strings.yar @@ -0,0 +1,19 @@ +rule exploit_linux_eop_cve20177308_strings { + meta: + id = "72d225dd-386c-47d5-afb3-c6712c0bdd9a" + version = "1.0" + description = "Detects CVE-2017-7308 exploit" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "[.] SMEP & SMAP bypass enabled, turning them off" + $ = "[.] done, SMEP & SMAP should be off now" + $ = "[.] executing get root payload %p" + $ = "[.] done, should be root now" + + condition: + uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_linux_eop_cve202121974_exploit_strings.yar b/yara_rules/exploit_linux_eop_cve202121974_exploit_strings.yar new file mode 100644 index 0000000..d5f6a6a --- /dev/null +++ b/yara_rules/exploit_linux_eop_cve202121974_exploit_strings.yar @@ -0,0 +1,19 @@ +rule exploit_linux_eop_cve202121974_exploit_strings { + meta: + id = "8e1fbbe5-7d51-48b4-80d5-90abff8cab9e" + version = "1.0" + description = "Detects CVE-2021-21974 Local Privesc exploit" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = ".name.replace('Thread','SLP Client'" + $ = "print('[' + name + '] recv: ', d)" + $ = "requests[28].put(connect())" + $ = "[+] stack enviorn address:" + + condition: + uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_linux_eop_dirtyc0w_strings.yar b/yara_rules/exploit_linux_eop_dirtyc0w_strings.yar new file mode 100644 index 0000000..44eb8b2 --- /dev/null +++ b/yara_rules/exploit_linux_eop_dirtyc0w_strings.yar @@ -0,0 +1,18 @@ +rule exploit_linux_eop_dirtyc0w_strings { + meta: + id = "f0551e56-b08f-4f6f-81df-f30fbb8ee7b8" + version = "1.0" + description = "Detects DirtyCow exploit" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "DirtyCow root privilege escalation" + $ = "Backing up %s to /tmp/bak" + $ = "(o o)_____/" + + condition: + uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_linux_eop_dirtypipe_strings.yar b/yara_rules/exploit_linux_eop_dirtypipe_strings.yar new file mode 100644 index 0000000..41a74d0 --- /dev/null +++ b/yara_rules/exploit_linux_eop_dirtypipe_strings.yar @@ -0,0 +1,19 @@ +rule exploit_linux_eop_dirtypipe_strings { + meta: + id = "712d8a01-576e-4f43-a930-63dcdc535d93" + version = "1.0" + description = "Detects DirtyPipe Local Privesc exploit" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "[+] hijacking suid binary.." + $ = "[+] dropping suid shell.." + $ = "[+] restoring suid binary.." + $ = "[+] popping root shell.." + + condition: + uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_linux_eop_polkit_pkexec_strings.yar b/yara_rules/exploit_linux_eop_polkit_pkexec_strings.yar new file mode 100644 index 0000000..0fec24a --- /dev/null +++ b/yara_rules/exploit_linux_eop_polkit_pkexec_strings.yar @@ -0,0 +1,18 @@ +rule exploit_linux_eop_polkit_pkexec_strings { + meta: + id = "de45c29e-432a-4e4f-b700-a016341d56d2" + version = "1.0" + description = "Detects Polkit Local Privesc exploit" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "[.] Spawning suid process (%s) ..." + $ = "[.] Tracing midpid ..." + $ = "PTRACE_TRACEME local root (CVE-2019-13272)" + + condition: + uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_linux_eop_pwnkit_strings.yar b/yara_rules/exploit_linux_eop_pwnkit_strings.yar new file mode 100644 index 0000000..1b8eaca --- /dev/null +++ b/yara_rules/exploit_linux_eop_pwnkit_strings.yar @@ -0,0 +1,22 @@ +rule exploit_linux_eop_pwnkit_strings { + meta: + id = "8637c602-62da-4983-bcb7-ba546fb2ed82" + version = "1.0" + description = "Detects Pwnkit Local Privesc exploit" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "CHARSET=PWNKIT" + $ = "i/do/not/exists" + $ = "pwnkit/pwnkit.c" + $ = "/usr/bin/pkexec" + $ = "SHELL=pwnkit" + $ = "pwnkit.so" + $ = "./pwnkit/" + + condition: + uint32be(0) == 0x7f454c46 and filesize < 1MB and 2 of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_linux_eop_rationallove_strings.yar b/yara_rules/exploit_linux_eop_rationallove_strings.yar new file mode 100644 index 0000000..dcba700 --- /dev/null +++ b/yara_rules/exploit_linux_eop_rationallove_strings.yar @@ -0,0 +1,18 @@ +rule exploit_linux_eop_rationallove_strings { + meta: + id = "e71e026e-ca2c-42b7-b552-b3fd013676db" + version = "1.0" + description = "Detects RationalLove Local Privesc exploit" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "../x/../../AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/" + $ = "Detected OS version: %s" + $ = "Content-Type: text/plain; charset=UTF-8" + + condition: + uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_linux_eop_ubuntu_overlayfs_local_privesc_strings.yar b/yara_rules/exploit_linux_eop_ubuntu_overlayfs_local_privesc_strings.yar new file mode 100644 index 0000000..72d8835 --- /dev/null +++ b/yara_rules/exploit_linux_eop_ubuntu_overlayfs_local_privesc_strings.yar @@ -0,0 +1,21 @@ +rule exploit_linux_eop_ubuntu_overlayfs_local_privesc_strings { + meta: + id = "5e0e73f5-4cb3-4a79-adac-578b17ed7660" + version = "1.0" + description = "Detects Ubuntu OverlayFS Local Privesc exploit" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "./ovlcap" + $ = "rm -rf '%s/'" + $ = "./ovlcap/work" + $ = "./ovlcap/lower" + $ = "./ovlcap/upper" + $ = "./ovlcap/merge" + + condition: + uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them +} + \ No newline at end of file diff --git a/yara_rules/exploit_win_cloudatlas_cve_2018_0798.yar b/yara_rules/exploit_win_cloudatlas_cve_2018_0798.yar new file mode 100644 index 0000000..295e0a7 --- /dev/null +++ b/yara_rules/exploit_win_cloudatlas_cve_2018_0798.yar @@ -0,0 +1,21 @@ +rule exploit_win_cloudatlas_cve_2018_0798 { + meta: + id = "fcff4bc7-fe88-4546-bb5b-f2a1c2f8b0a5" + version = "1.0" + description = "Detect RTF files used by CloudAtlas to exploit CVE-2018-0798" + author = "Sekoia.io" + creation_date = "2022-11-15" + classification = "TLP:CLEAR" + hash1 = "c2064c7f4826c46bc609c472597366fd" + hash2 = "e2281402c63d4b544b81678250d24e61" + hash3 = "a97fa135d7e42886bcfdacca0d96c047" + + strings: + $ = "6060606061616161616161616161616161616161" ascii nocase + $ = "FB0B00004bE8FFFFFFFFC35F83C71B33C966B908" ascii nocase + $ = "010f0d00ddd8d97424f4668137" ascii nocase + + condition: + uint32be(0) == 0x7b5c7274 and all of them +} + \ No newline at end of file diff --git a/yara_rules/gen_empire_onedrive_stager.yar b/yara_rules/gen_empire_onedrive_stager.yar new file mode 100644 index 0000000..ca03f9c --- /dev/null +++ b/yara_rules/gen_empire_onedrive_stager.yar @@ -0,0 +1,17 @@ +rule gen_empire_onedrive_stager { + meta: + id = "2053416f-1f53-491e-9c70-787a04362d16" + version = "1.0" + description = "Detects the Empire OneDrive stager" + author = "Sekoia.io" + creation_date = "2022-01-26" + classification = "TLP:CLEAR" + + strings: + $sleep = "Start-Sleep -Seconds $(($PI -as [Int])*2)" wide ascii nocase + $down = "wc.DownloadData" wide ascii nocase + + condition: + $down in (@sleep..@sleep+1000) +} + \ No newline at end of file diff --git a/yara_rules/generic_bat_script_mock_http_services.yar b/yara_rules/generic_bat_script_mock_http_services.yar new file mode 100644 index 0000000..609cc73 --- /dev/null +++ b/yara_rules/generic_bat_script_mock_http_services.yar @@ -0,0 +1,24 @@ +rule generic_bat_script_mock_http_services { + meta: + id = "1cfbe5ba-6304-476d-8308-928100a85c16" + version = "1.0" + description = "Generic rule detecting BAT script using mock HTTP services (used by APT28)" + author = "Sekoia.io" + creation_date = "2023-09-07" + classification = "TLP:CLEAR" + + strings: + $bat1 = "@echo off" + $bat2 = "chcp 65001" + $ps1 = "WebClient" + $ps2 = "UploadString" + $dom1 = "mockbin.org" + $dom2 = "webhook.site" + $dom3 = "mocky.io" + $dom4 = "pipedream.com" + + condition: + (1 of ($bat*) or 1 of ($ps*) ) and 1 of ($dom*) + and filesize < 2000 +} + \ No newline at end of file diff --git a/yara_rules/generic_perl_reverse_shell.yar b/yara_rules/generic_perl_reverse_shell.yar new file mode 100644 index 0000000..5c275c8 --- /dev/null +++ b/yara_rules/generic_perl_reverse_shell.yar @@ -0,0 +1,18 @@ +rule generic_perl_reverse_shell { + meta: + id = "4eb2ef0d-3ada-4566-bd82-8c75d6931acc" + version = "1.0" + description = "Detects simple reverse shell written in Perl" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "open(STDIN,\">&S\");" + $ = "open(STDERR,\">&S\");" + $ = "use Socket;$i=" + + condition: + filesize < 300 and all of them +} + \ No newline at end of file diff --git a/yara_rules/generic_php_webshell.yar b/yara_rules/generic_php_webshell.yar new file mode 100644 index 0000000..68b0c5a --- /dev/null +++ b/yara_rules/generic_php_webshell.yar @@ -0,0 +1,16 @@ +rule generic_php_webshell { + meta: + id = "415a96bd-11a4-40e7-8335-ac1f1a99d17c" + version = "1.0" + description = "Detects generic webshell" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "system($_POST['a']);" + + condition: + all of them and filesize < 500 +} + \ No newline at end of file diff --git a/yara_rules/generic_python_reverse_shell.yar b/yara_rules/generic_python_reverse_shell.yar new file mode 100644 index 0000000..1f41a44 --- /dev/null +++ b/yara_rules/generic_python_reverse_shell.yar @@ -0,0 +1,19 @@ +rule generic_python_reverse_shell { + meta: + id = "ab25f8db-e39d-4aa4-b431-cf5cd2e038e5" + version = "1.0" + description = "Detects simple reverse shell written in Python" + author = "Sekoia.io" + creation_date = "2023-12-08" + classification = "TLP:CLEAR" + + strings: + $ = "import pty" + $ = "lhost =" + $ = "os.dup2(s.fileno(),0)" + $ = "os.putenv(\"HISTFILE\",'/dev/null')" + + condition: + filesize < 1KB and all of them +} + \ No newline at end of file diff --git a/yara_rules/generic_sharpshooter_payload_1.yar b/yara_rules/generic_sharpshooter_payload_1.yar new file mode 100644 index 0000000..9d1d8ed --- /dev/null +++ b/yara_rules/generic_sharpshooter_payload_1.yar @@ -0,0 +1,19 @@ +rule generic_sharpshooter_payload_1 { + meta: + id = "82fd284a-47c2-4d29-9c80-f3affaa61a13" + version = "1.0" + description = "Detects payload created by SharpShooter" + author = "Sekoia.io" + creation_date = "2023-02-03" + classification = "TLP:CLEAR" + + strings: + $ = "rc4 = function(key, str)" + $ = "var e={},i,b=0,c,x,l=0,a,r=" + $ = "var plain = rc4(" + $ = "MZ" - //$hta = "" NOT IN ALL SAMPLES - - condition: - uint16be(0) == 0x4d5a and all of them and $var in (@script1..@script1+2000) and $char in (@var..@var+100) -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_evilnumpayload_fmtstr.yar b/yara_rules/sekoiaio_evilnumpayload_fmtstr.yar deleted file mode 100644 index 0b3f3fb..0000000 --- a/yara_rules/sekoiaio_evilnumpayload_fmtstr.yar +++ /dev/null @@ -1,29 +0,0 @@ -rule sekoiaio_evilnumpayload_fmtstr { - meta: - id = "980c58e4-e04d-4076-a92e-2c04ced19ece" - version = "1.1" - description = "Detect payload of EvilNum" - author = "Sekoia.io" - creation_date = "2022-07-25" - classification = "TLP:CLEAR" - - strings: - - $fmtstr01 = "{\"v\":\"" ascii wide - $fmtstr02 = ",\"u\":\"" ascii wide - $fmtstr03 = ",\"a\":\"" ascii wide - $fmtstr04 = ",\"w\":\"" ascii wide - $fmtstr05 = ",\"d\":\"" ascii wide - $fmtstr06 = ",\"n\":\"" ascii wide - $fmtstr07 = ",\"r\":\"1\"" ascii wide - $fmtstr08 = ",\"r\":\"0\"" ascii wide - $fmtstr09 = ",\"xn\":\"" ascii wide - $fmtstr10 = ",\"s\":0}" ascii wide - $fmtstr11 = "{\"u\":\"" ascii wide - $fmtstr12 = "\",\"sc\":1" ascii wide - $fmtstr13 = ",\"dt\":\"" ascii wide - - condition: - 8 of ($fmtstr*) -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_cve20191458_strings.yar b/yara_rules/sekoiaio_exploit_cve20191458_strings.yar deleted file mode 100644 index e57a9b1..0000000 --- a/yara_rules/sekoiaio_exploit_cve20191458_strings.yar +++ /dev/null @@ -1,22 +0,0 @@ -rule sekoiaio_exploit_cve20191458_strings { - meta: - id = "0be4a550-0f0a-4596-ab32-aafaececf919" - version = "1.0" - description = "Detects compiled exploit for CVE-2019-1458 (Generic)" - author = "Sekoia.io" - creation_date = "2022-08-29" - classification = "TLP:CLEAR" - - strings: - $ = "[-] Failed to create SploitWnd window" - $ = "[+] ProcessCreated with pid %d!" - $ = "[!] Exploit fail, test:0x%p,tagWND:0x%p, error:0x%lx" - $ = "[*] tagWND: 0x%p, tagCLS:0x%p, gap:0x%llx" - $ = "[*] Simulating alt key press" - - condition: - uint16be(0) == 0x4d5a and - filesize < 200KB and - 3 of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_ez_pwnkit_strings.yar b/yara_rules/sekoiaio_exploit_ez_pwnkit_strings.yar deleted file mode 100644 index eb404e7..0000000 --- a/yara_rules/sekoiaio_exploit_ez_pwnkit_strings.yar +++ /dev/null @@ -1,19 +0,0 @@ -rule sekoiaio_exploit_ez_pwnkit_strings { - meta: - id = "24301f35-8174-4e0d-b14a-fc7e45a29b26" - version = "1.0" - description = "Detects ez-pwnkit exploit" - author = "Sekoia.io" - creation_date = "2024-01-22" - classification = "TLP:CLEAR" - - strings: - $s1 = "go.buildid" - $s2 = "github.com/OXDBXKXO/ez-pwnkit" - - condition: - uint32be(0) == 0x7f454c46 and - filesize < 5MB and - $s1 and #s2 > 5 -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_linux_eop_cve20177308_strings.yar b/yara_rules/sekoiaio_exploit_linux_eop_cve20177308_strings.yar deleted file mode 100644 index f24a3f2..0000000 --- a/yara_rules/sekoiaio_exploit_linux_eop_cve20177308_strings.yar +++ /dev/null @@ -1,19 +0,0 @@ -rule sekoiaio_exploit_linux_eop_cve20177308_strings { - meta: - id = "72d225dd-386c-47d5-afb3-c6712c0bdd9a" - version = "1.0" - description = "Detects CVE-2017-7308 exploit" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "[.] SMEP & SMAP bypass enabled, turning them off" - $ = "[.] done, SMEP & SMAP should be off now" - $ = "[.] executing get root payload %p" - $ = "[.] done, should be root now" - - condition: - uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_linux_eop_cve202121974_exploit_strings.yar b/yara_rules/sekoiaio_exploit_linux_eop_cve202121974_exploit_strings.yar deleted file mode 100644 index d452c86..0000000 --- a/yara_rules/sekoiaio_exploit_linux_eop_cve202121974_exploit_strings.yar +++ /dev/null @@ -1,19 +0,0 @@ -rule sekoiaio_exploit_linux_eop_cve202121974_exploit_strings { - meta: - id = "8e1fbbe5-7d51-48b4-80d5-90abff8cab9e" - version = "1.0" - description = "Detects CVE-2021-21974 Local Privesc exploit" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = ".name.replace('Thread','SLP Client'" - $ = "print('[' + name + '] recv: ', d)" - $ = "requests[28].put(connect())" - $ = "[+] stack enviorn address:" - - condition: - uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_linux_eop_dirtyc0w_strings.yar b/yara_rules/sekoiaio_exploit_linux_eop_dirtyc0w_strings.yar deleted file mode 100644 index 310abe6..0000000 --- a/yara_rules/sekoiaio_exploit_linux_eop_dirtyc0w_strings.yar +++ /dev/null @@ -1,18 +0,0 @@ -rule sekoiaio_exploit_linux_eop_dirtyc0w_strings { - meta: - id = "f0551e56-b08f-4f6f-81df-f30fbb8ee7b8" - version = "1.0" - description = "Detects DirtyCow exploit" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "DirtyCow root privilege escalation" - $ = "Backing up %s to /tmp/bak" - $ = "(o o)_____/" - - condition: - uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_linux_eop_dirtypipe_strings.yar b/yara_rules/sekoiaio_exploit_linux_eop_dirtypipe_strings.yar deleted file mode 100644 index bcdf52f..0000000 --- a/yara_rules/sekoiaio_exploit_linux_eop_dirtypipe_strings.yar +++ /dev/null @@ -1,19 +0,0 @@ -rule sekoiaio_exploit_linux_eop_dirtypipe_strings { - meta: - id = "712d8a01-576e-4f43-a930-63dcdc535d93" - version = "1.0" - description = "Detects DirtyPipe Local Privesc exploit" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "[+] hijacking suid binary.." - $ = "[+] dropping suid shell.." - $ = "[+] restoring suid binary.." - $ = "[+] popping root shell.." - - condition: - uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_linux_eop_polkit_pkexec_strings.yar b/yara_rules/sekoiaio_exploit_linux_eop_polkit_pkexec_strings.yar deleted file mode 100644 index aaa972e..0000000 --- a/yara_rules/sekoiaio_exploit_linux_eop_polkit_pkexec_strings.yar +++ /dev/null @@ -1,18 +0,0 @@ -rule sekoiaio_exploit_linux_eop_polkit_pkexec_strings { - meta: - id = "de45c29e-432a-4e4f-b700-a016341d56d2" - version = "1.0" - description = "Detects Polkit Local Privesc exploit" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "[.] Spawning suid process (%s) ..." - $ = "[.] Tracing midpid ..." - $ = "PTRACE_TRACEME local root (CVE-2019-13272)" - - condition: - uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_linux_eop_pwnkit_strings.yar b/yara_rules/sekoiaio_exploit_linux_eop_pwnkit_strings.yar deleted file mode 100644 index b39f20f..0000000 --- a/yara_rules/sekoiaio_exploit_linux_eop_pwnkit_strings.yar +++ /dev/null @@ -1,22 +0,0 @@ -rule sekoiaio_exploit_linux_eop_pwnkit_strings { - meta: - id = "8637c602-62da-4983-bcb7-ba546fb2ed82" - version = "1.0" - description = "Detects Pwnkit Local Privesc exploit" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "CHARSET=PWNKIT" - $ = "i/do/not/exists" - $ = "pwnkit/pwnkit.c" - $ = "/usr/bin/pkexec" - $ = "SHELL=pwnkit" - $ = "pwnkit.so" - $ = "./pwnkit/" - - condition: - uint32be(0) == 0x7f454c46 and filesize < 1MB and 2 of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_linux_eop_rationallove_strings.yar b/yara_rules/sekoiaio_exploit_linux_eop_rationallove_strings.yar deleted file mode 100644 index 2fd1c24..0000000 --- a/yara_rules/sekoiaio_exploit_linux_eop_rationallove_strings.yar +++ /dev/null @@ -1,18 +0,0 @@ -rule sekoiaio_exploit_linux_eop_rationallove_strings { - meta: - id = "e71e026e-ca2c-42b7-b552-b3fd013676db" - version = "1.0" - description = "Detects RationalLove Local Privesc exploit" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "../x/../../AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/" - $ = "Detected OS version: %s" - $ = "Content-Type: text/plain; charset=UTF-8" - - condition: - uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_linux_eop_ubuntu_overlayfs_local_privesc_strings.yar b/yara_rules/sekoiaio_exploit_linux_eop_ubuntu_overlayfs_local_privesc_strings.yar deleted file mode 100644 index 0ac5ed2..0000000 --- a/yara_rules/sekoiaio_exploit_linux_eop_ubuntu_overlayfs_local_privesc_strings.yar +++ /dev/null @@ -1,21 +0,0 @@ -rule sekoiaio_exploit_linux_eop_ubuntu_overlayfs_local_privesc_strings { - meta: - id = "5e0e73f5-4cb3-4a79-adac-578b17ed7660" - version = "1.0" - description = "Detects Ubuntu OverlayFS Local Privesc exploit" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "./ovlcap" - $ = "rm -rf '%s/'" - $ = "./ovlcap/work" - $ = "./ovlcap/lower" - $ = "./ovlcap/upper" - $ = "./ovlcap/merge" - - condition: - uint32be(0) == 0x7f454c46 and filesize < 1MB and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_exploit_win_cloudatlas_cve_2018_0798.yar b/yara_rules/sekoiaio_exploit_win_cloudatlas_cve_2018_0798.yar deleted file mode 100644 index a89d3d1..0000000 --- a/yara_rules/sekoiaio_exploit_win_cloudatlas_cve_2018_0798.yar +++ /dev/null @@ -1,21 +0,0 @@ -rule sekoiaio_exploit_win_cloudatlas_cve_2018_0798 { - meta: - id = "fcff4bc7-fe88-4546-bb5b-f2a1c2f8b0a5" - version = "1.0" - description = "Detect RTF files used by CloudAtlas to exploit CVE-2018-0798" - author = "Sekoia.io" - creation_date = "2022-11-15" - classification = "TLP:CLEAR" - hash1 = "c2064c7f4826c46bc609c472597366fd" - hash2 = "e2281402c63d4b544b81678250d24e61" - hash3 = "a97fa135d7e42886bcfdacca0d96c047" - - strings: - $ = "6060606061616161616161616161616161616161" ascii nocase - $ = "FB0B00004bE8FFFFFFFFC35F83C71B33C966B908" ascii nocase - $ = "010f0d00ddd8d97424f4668137" ascii nocase - - condition: - uint32be(0) == 0x7b5c7274 and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_gen_empire_onedrive_stager.yar b/yara_rules/sekoiaio_gen_empire_onedrive_stager.yar deleted file mode 100644 index 8dc2a87..0000000 --- a/yara_rules/sekoiaio_gen_empire_onedrive_stager.yar +++ /dev/null @@ -1,17 +0,0 @@ -rule sekoiaio_gen_empire_onedrive_stager { - meta: - id = "2053416f-1f53-491e-9c70-787a04362d16" - version = "1.0" - description = "Detects the Empire OneDrive stager" - author = "Sekoia.io" - creation_date = "2022-01-26" - classification = "TLP:CLEAR" - - strings: - $sleep = "Start-Sleep -Seconds $(($PI -as [Int])*2)" wide ascii nocase - $down = "wc.DownloadData" wide ascii nocase - - condition: - $down in (@sleep..@sleep+1000) -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_generic_bat_script_mock_http_services.yar b/yara_rules/sekoiaio_generic_bat_script_mock_http_services.yar deleted file mode 100644 index 21565cf..0000000 --- a/yara_rules/sekoiaio_generic_bat_script_mock_http_services.yar +++ /dev/null @@ -1,24 +0,0 @@ -rule sekoiaio_generic_bat_script_mock_http_services { - meta: - id = "1cfbe5ba-6304-476d-8308-928100a85c16" - version = "1.0" - description = "Generic rule detecting BAT script using mock HTTP services (used by APT28)" - author = "Sekoia.io" - creation_date = "2023-09-07" - classification = "TLP:CLEAR" - - strings: - $bat1 = "@echo off" - $bat2 = "chcp 65001" - $ps1 = "WebClient" - $ps2 = "UploadString" - $dom1 = "mockbin.org" - $dom2 = "webhook.site" - $dom3 = "mocky.io" - $dom4 = "pipedream.com" - - condition: - (1 of ($bat*) or 1 of ($ps*) ) and 1 of ($dom*) - and filesize < 2000 -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_generic_perl_reverse_shell.yar b/yara_rules/sekoiaio_generic_perl_reverse_shell.yar deleted file mode 100644 index 57da06c..0000000 --- a/yara_rules/sekoiaio_generic_perl_reverse_shell.yar +++ /dev/null @@ -1,18 +0,0 @@ -rule sekoiaio_generic_perl_reverse_shell { - meta: - id = "4eb2ef0d-3ada-4566-bd82-8c75d6931acc" - version = "1.0" - description = "Detects simple reverse shell written in Perl" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "open(STDIN,\">&S\");" - $ = "open(STDERR,\">&S\");" - $ = "use Socket;$i=" - - condition: - filesize < 300 and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_generic_php_webshell.yar b/yara_rules/sekoiaio_generic_php_webshell.yar deleted file mode 100644 index d102d5f..0000000 --- a/yara_rules/sekoiaio_generic_php_webshell.yar +++ /dev/null @@ -1,16 +0,0 @@ -rule sekoiaio_generic_php_webshell { - meta: - id = "415a96bd-11a4-40e7-8335-ac1f1a99d17c" - version = "1.0" - description = "Detects generic webshell" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "system($_POST['a']);" - - condition: - all of them and filesize < 500 -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_generic_python_reverse_shell.yar b/yara_rules/sekoiaio_generic_python_reverse_shell.yar deleted file mode 100644 index 4640b15..0000000 --- a/yara_rules/sekoiaio_generic_python_reverse_shell.yar +++ /dev/null @@ -1,19 +0,0 @@ -rule sekoiaio_generic_python_reverse_shell { - meta: - id = "ab25f8db-e39d-4aa4-b431-cf5cd2e038e5" - version = "1.0" - description = "Detects simple reverse shell written in Python" - author = "Sekoia.io" - creation_date = "2023-12-08" - classification = "TLP:CLEAR" - - strings: - $ = "import pty" - $ = "lhost =" - $ = "os.dup2(s.fileno(),0)" - $ = "os.putenv(\"HISTFILE\",'/dev/null')" - - condition: - filesize < 1KB and all of them -} - \ No newline at end of file diff --git a/yara_rules/sekoiaio_generic_sharpshooter_payload_1.yar b/yara_rules/sekoiaio_generic_sharpshooter_payload_1.yar deleted file mode 100644 index a305976..0000000 --- a/yara_rules/sekoiaio_generic_sharpshooter_payload_1.yar +++ /dev/null @@ -1,19 +0,0 @@ -rule sekoiaio_generic_sharpshooter_payload_1 { - meta: - id = "82fd284a-47c2-4d29-9c80-f3affaa61a13" - version = "1.0" - description = "Detects payload created by SharpShooter" - author = "Sekoia.io" - creation_date = "2023-02-03" - classification = "TLP:CLEAR" - - strings: - $ = "rc4 = function(key, str)" - $ = "var e={},i,b=0,c,x,l=0,a,r=" - $ = "var plain = rc4(" - $ = "