Skip to content

Commit 7e396a9

Browse files
committed
Added new yara rules 2024-06-21
1 parent 0722a93 commit 7e396a9

File tree

4 files changed

+179
-0
lines changed

4 files changed

+179
-0
lines changed

APT29/apt29.yara

+27
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,31 @@ rule APT29_csloader_code {
5757
uint32(uint32(0x3c)) == 0x00004550 and
5858
((#size >= 4 and $process and 1 of ($command*) and 1 of ($resource*)) or
5959
$pdb)
60+
}
61+
62+
rule malware_cobaltstrike_workersdevloader {
63+
meta:
64+
description = "CobaltStrike loader using workers.dev"
65+
author = "JPCERT/CC Incident Response Group"
66+
hash = "a7e5080067751ef41254ec4c9f3b6e3ac7cdeca703bdddfc9afb194afee3c124"
67+
hash = "fc7eba3306463b091066b51dc7a890233710b2755b9526f5c1a8365c478caa16"
68+
69+
strings:
70+
$xorcode = { 41 8A 0C 10 80 F1 ?? 88 0A 48 FF C2 49 83 E9 01 }
71+
$jnk = { 48 3B 15 ?? ?? ?? 00 48 8D 05 ?? ?? FF FF 48 89 45 10 74 16 48 89 02 }
72+
$str = "root\\cimv2" ascii
73+
$folder = "{80C23C0F-1FE2-45D3-ACA0-4936A6875179}" ascii wide
74+
$pdb = "G:\\viewer\\bin\\viewerlib.pdb" ascii wide
75+
$opt1 = "--is_ready=" ascii wide
76+
$opt2 = "--doc_path=" ascii wide
77+
$opt3 = "--parent_path=" ascii wide
78+
$opt4 = "--parent_id=" ascii wide
79+
$opt5 = "--auto=" ascii wide
80+
81+
condition:
82+
uint16(0) == 0x5A4D and
83+
uint32(uint32(0x3c)) == 0x00004550 and
84+
(
85+
$pdb or $folder or 3 of ($opt*) or ($str and $xorcode and #jnk > 10)
86+
)
6087
}

Kimsuky/Kimsuky.yara

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
rule Kimsuky_downloader_vbs
2+
{
3+
meta:
4+
description = "VBS file to download Powershell used by Kimsuky"
5+
author = "JPCERT/CC Incident Response Group"
6+
hash = "36997232fc97040b099fedc4f0c5bf7aed5d468533a27924dc981b94ca208d71"
7+
8+
strings:
9+
$s1 = "PokDoc -Slyer 'xxx'" ascii
10+
$s2 = "InfoKey -ur 'xxx'" ascii
11+
$s3 = "iex (wget xxx" ascii
12+
$s4 = "pow_cmd = Replace(pow_cmd, \"xxx\", uri)" ascii
13+
14+
condition:
15+
3 of them
16+
}
17+
18+
rule Kimsuky_PokDoc_ps1
19+
{
20+
meta:
21+
description = "Powershell file to collect device information used by Kimsuky"
22+
author = "JPCERT/CC Incident Response Group"
23+
hash = "82dbc9cb6bf046846046497334c9cc28082f151e4cb9290ef192a85bdb7cc6c8"
24+
25+
strings:
26+
$s1 = "Function PokDoc {" ascii
27+
$s2 = "Param ([string] $Slyer)" ascii
28+
$s3 = "boundary`r`nContent-Disposition: form-data; name=\";" ascii
29+
$s4 = "$conDisp`\"file`\"; filename=`\"" ascii
30+
31+
condition:
32+
3 of them
33+
}
34+
35+
rule Kimsuky_InfoKey_ps1
36+
{
37+
meta:
38+
description = "Powershell file with keylogger functionality used by Kimsuky"
39+
author = "JPCERT/CC Incident Response Group"
40+
hash = "cc2355edb2e2888bae37925ec3ddce2c4c7a91973e89ee385074c337107175ca"
41+
42+
strings:
43+
$s1 = "Global\\AlreadyRunning19122345" ascii
44+
$s2 = "if(($upTick -eq 0) -or (($curTick - $upTick) -gt $tickGap)){" ascii
45+
$s3 = "`n----- [Clipboard] -----`n\" + [Windows.Clipboard]::GetText()"
46+
$s4 = "`n----- [\" + $t + \"] [\" + $curWnd.ToString() + \"] -----`n"
47+
48+
condition:
49+
3 of them
50+
}

other/doplugs.yara

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
rule malware_DOPLUGS {
2+
meta:
3+
description = "DOPLUGS"
4+
author = "JPCERT/CC Incident Response Group"
5+
hash = "2a6015505c83113ff89d8a4be66301a3e6245a41"
6+
7+
strings:
8+
$data1 = "CLSID" ascii wide
9+
/* Decode API Name
10+
8b 14 24: MOV EDX,dword ptr [ESP]
11+
8a 5c 14 10: MOV BL,byte ptr [ESP + EDX*0x1 + 0x10]
12+
8b 0c 24: MOV ECX,dword ptr [ESP]
13+
88 df: MOV BH,BL
14+
f6 d7: NOT BH
15+
20 cf: AND BH,CL
16+
f6 d1: NOT CL
17+
20 d9: AND CL,BL
18+
08 f9: OR CL,BH
19+
88 4c 14 10: MOV byte ptr [ESP + EDX*0x1 + 0x10],CL
20+
*/
21+
$enc1 = {8B 14 24 8A 5C 14 10 8B 0C 24 88 DF F6 D7 20 CF F6 D1 20 D9 08 F9 88 4C 14 10 8B 0C 24 41 EB}
22+
23+
/* Decode API Name
24+
8b 14 24: MOV EDX, dword ptr [ESP]
25+
89 d0: MOV EAX, EDX
26+
80 e2 7c: AND DL , ??
27+
f6 d0: NOT AL
28+
24 83: AND AL , ??
29+
08 c2: OR DL , ??
30+
*/
31+
$enc2 = {8B 14 24 89 D0 80 E2 ?? F6 D0 24 ?? 08 ??}
32+
33+
condition:
34+
uint16(0) == 0x5A4D and all of them
35+
}
36+
37+
rule malware_DOPLUGSLoader {
38+
meta:
39+
description = "DOPLUGS Loader"
40+
author = "JPCERT/CC Incident Response Group"
41+
hash = "c7e9c45b18c8ab355f1c07879cce5a3e58620dd7"
42+
43+
strings:
44+
$data1 = "NimMain" ascii wide
45+
/* RC4 Decrypt
46+
8b b4 b5 e8 fb ff ff: MOV ESI, dword ptr [EBP+ESI*0x4 + 0xfffffbe8]
47+
0f b6 44 3b 08: MOVZX EAX, byte ptr[EBX + EDI*0x1 + 0x8]
48+
31 f0: XOR EAX, ESI
49+
3d ff 00 00 00: CMP EAX, 0xff
50+
*/
51+
$enc = {8b b4 b5 e8 fb ff ff 0f b6 44 3b 08 31 f0 3d ff 00 00 00}
52+
53+
condition:
54+
uint16(0) == 0x5A4D and all of them
55+
}

other/webrcs.yara

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import "pe"
2+
3+
rule malware_webrcs_lnk {
4+
meta:
5+
description = "lnk used to execute webrcs"
6+
author = "JPCERT/CC Incident Response Group"
7+
hash = "405b2933f2638767980171f3cb09e3f3ee598965d74dd5a041cac97e4e1b893d"
8+
9+
strings:
10+
$s1 = "'+$pid+'.dll';ni " ascii wide
11+
$s2 = "-I D;saps $f;cp desktop.ini " ascii wide
12+
$s3 = ";if(Test-Path $n){saps $" ascii wide
13+
14+
condition:
15+
(uint32(0) == 0x0000004C) and
16+
2 of them
17+
}
18+
19+
rule malware_webrcs {
20+
meta:
21+
description = "webrcs malware"
22+
author = "JPCERT/CC Incident Response Group"
23+
hash = "74aa2eedaa6594efa2075ea2f4617ed3206d228b8fae5fc54382630764bdb5ad"
24+
25+
strings:
26+
$s1 = "C:\\boringssl_x86\\ssl\\encrypted_client_hello.cc" ascii
27+
$s2 = "_rloader@4" ascii
28+
$s3 = "shell" wide
29+
$s4 = {
30+
83 3A 10
31+
0F 85 ?? ?? ?? ??
32+
83 39 0F
33+
75 ??
34+
83 38 0F
35+
75 ??
36+
83 78 ?? 41
37+
}
38+
$s5 = "cqWKroElukZpUd7X2FRJhAC3IS05j6efzDmaVwv4igGtTY89sOx1QHPNBMLybn+-" ascii
39+
40+
condition:
41+
uint16(0) == 0x5A4D and
42+
uint32(uint32(0x3c)) == 0x00004550 and
43+
(pe.overlay.size > 512000 and
44+
uint8(pe.overlay.offset) == 0xBF and
45+
uint32(pe.overlay.offset + 4) == 0x09E8006A) or
46+
3 of them
47+
}

0 commit comments

Comments
 (0)