Skip to content

Commit ce6036d

Browse files
committed
Create apt_cn_brickstorm_sep25.yar
1 parent 982f08e commit ce6036d

File tree

1 file changed

+182
-0
lines changed

1 file changed

+182
-0
lines changed

yara/apt_cn_brickstorm_sep25.yar

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
rule MAL_G_APT_Backdoor_BRICKSTORM_3 {
2+
meta:
3+
description = "Detects BRICKSTORM backdoor used by APT group UNC5221 (China Nexus)"
4+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
5+
date = "2025-09-25"
6+
score = 75
7+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
8+
strings:
9+
$str1 = { 48 8B 05 ?? ?? ?? ?? 48 89 04 24 E8 ?? ?? ?? ?? 48 B8 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 04 24 [0-5] E8 ?? ?? ?? ?? EB ?? }
10+
$str4 = "decompress" ascii // wide nocase
11+
$str5 = "MIMEHeader" ascii // wide nocase
12+
$str6 = "ResolveReference" ascii // wide nocase
13+
$str7 = "115792089210356248762697446949407573529996955224135760342422259061068512044369115792089210356248762697446949407573530086143415290314195533631308867097853951" ascii // wide nocase
14+
condition:
15+
uint16(0) == 0x457F and all of them
16+
}
17+
18+
rule MAL_G_Backdoor_BRICKSTORM_2 {
19+
meta:
20+
description = "Detects BRICKSTORM backdoor used by APT group UNC5221 (China Nexus)"
21+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
22+
date = "2025-09-25"
23+
score = 75
24+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
25+
strings:
26+
// $obf_func = /[a-z]{20}\/[a-z]{20}\/[a-z]{20}\/[a-z]{20}.go/
27+
$decr1 = { 0F B6 4C 04 ?? 0F B6 54 04 ?? 31 D1 88 4C 04 ?? 48 FF C0 [0-4] 48 83 F8 ?? 7C }
28+
$decr2 = { 40 88 7C 34 34 48 FF C3 48 FF C6 48 39 D6 7D 18 0F B6 3B 48 39 CE 73 63 44 0F B6 04 30 44 31 C7 48 83 FE 04 72 DA }
29+
$decr3 = { 0F B6 54 0C ?? 0F B6 5C 0C ?? 31 DA 88 14 08 48 FF C1 48 83 F9 ?? 7C E8 }
30+
31+
$str1 = "main.selfWatcher"
32+
$str2 = "main.copyFile"
33+
$str3 = "main.startNew"
34+
35+
$str4 = "WRITE_LOG=true"
36+
$str5 = "WRITE_LOGWednesday"
37+
$str6 = "vami-httpdvideo/webm"
38+
$str7 = "/opt/vmware/sbin/"
39+
$str8 = "/home/vsphere-ui/"
40+
$str9 = "/opt/vmware/sbin/vami-http"
41+
$str10 = "main.getVFromEnv"
42+
condition:
43+
uint32(0) == 0x464c457f
44+
and filesize < 10MB
45+
and (
46+
1 of ($decr*)
47+
and 1 of ($str*)
48+
or 5 of ($str*)
49+
)
50+
}
51+
52+
rule MAL_G_APT_Backdoor_BRICKSTORM_1 {
53+
meta:
54+
description = "Detects BRICKSTORM backdoor used by APT group UNC5221 (China Nexus)"
55+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
56+
date = "2025-09-25"
57+
score = 75
58+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
59+
strings:
60+
$ = "WRITE_LOGWednesday"
61+
$ = "/home/vsphere-ui/"
62+
$ = "WRITE_LOG=true"
63+
$ = "dns rcode: %v"
64+
$ = "/libs/doh.createDnsMessage"
65+
$ = "/libs/func1.(*Client).BackgroundRun"
66+
$ = "/libs/func1.CreateClient"
67+
$ = "/core/extends/command.CommandNoContext"
68+
$ = "/core/extends/command.ExecuteCmd"
69+
$ = "/core/extends/command.RunShell"
70+
$ = "/libs/fs.(*RemoteDriver).DeleteFile"
71+
$ = "/libs/fs.(*RemoteDriver).GetFile"
72+
$ = "/libs/fs.(*RemoteDriver).PutFile"
73+
$ = "/libs/doh/doh.go"
74+
condition:
75+
uint32(0) == 0x464c457f and 5 of them
76+
}
77+
78+
rule MAL_G_APT_Backdoor_BRICKSTORM_2 {
79+
meta:
80+
description = "Detects BRICKSTORM backdoor used by APT group UNC5221 (China Nexus)"
81+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
82+
date = "2025-09-25"
83+
score = 75
84+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
85+
strings:
86+
$str1 = { 0F 57 C0 0F 11 84 ?? ?? ?? ?? ?? C6 44 ?? ?? 00 4? C7 84 ?? ?? ?? ?? ?? 00 00 00 00 0F 57 C0 0F 11 84 ?? ?? ?? ?? ?? 0F 11 84 ?? ?? ?? ?? ?? 4? 8B 84 ?? ?? ?? ?? ?? 4? 89 04 ?? 4? 8B 8C ?? ?? ?? ?? ?? 4? 89 4C ?? ?? E8 ?? ?? ?? ?? 4? 83 7C ?? ?? 00 0F 84 ?? ?? ?? ?? 4? 8D 05 ?? ?? ?? ?? 4? 89 ?? ?? E8 ?? ?? ?? ?? 4? 8B 7C ?? ?? 4? 8B 84 ?? ?? ?? ?? ?? 4? 89 47 08 83 3D ?? ?? ?? ?? 00 75 ?? 4? 8B 84 ?? ?? ?? ?? ?? 4? 89 07 4? 89 BC ?? ?? ?? ?? ?? 4? C7 84 ?? ?? ?? ?? ?? 01 00 00 00 4? C7 84 ?? ?? ?? ?? ?? 01 00 00 00 0F 57 C0 0F 11 84 ?? ?? ?? ?? ?? 4? 8B ?? ?? ?? ?? ?? ?? 4? 81 C4 ?? ?? ?? ?? C3 }
87+
$str2 = { 4? C7 84 ?? ?? ?? ?? ?? 00 00 00 00 4? C7 84 ?? ?? ?? ?? ?? 00 00 00 00 4? C7 84 ?? ?? ?? ?? ?? 00 00 00 00 4? C7 84 ?? ?? ?? ?? ?? 00 00 00 00 4? C7 84 ?? ?? ?? ?? ?? 00 00 00 00 4? 8B 84 ?? ?? ?? ?? ?? 4? 89 04 ?? 4? 8B 8C ?? ?? ?? ?? ?? 4? 89 4C ?? ?? E8 ?? ?? ?? ?? 4? 8B 44 ?? ?? 4? 85 C0 0F 84 ?? ?? ?? ?? 4? 8D 05 ?? ?? ?? ?? 4? 89 ?? ?? E8 ?? ?? ?? ?? 4? 8B 44 ?? ?? 4? 8B 8C ?? ?? ?? ?? ?? 4? 89 48 08 8B 0D ?? ?? ?? ?? 85 C9 75 ?? 4? 8B 8C ?? ?? ?? ?? ?? 4? 89 08 84 00 4? 89 84 ?? ?? ?? ?? ?? 4? C7 84 ?? ?? ?? ?? ?? 01 00 00 00 4? C7 84 ?? ?? ?? ?? ?? 01 00 00 00 4? C7 84 ?? ?? ?? ?? ?? 00 00 00 00 4? C7 84 ?? ?? ?? ?? ?? 00 00 00 00 90 E8 ?? ?? ?? ?? 4? 8B ?? ?4 D8 00 00 00 4? 81 C4 E0 00 00 00 C3 }
88+
condition:
89+
uint32be(0) == 0x7F454C46 and any of them
90+
}
91+
92+
rule WEBSHELL_G_APT_BackdoorWebshell_SLAYSTYLE_1 {
93+
meta:
94+
description = "Detects webshell used by APT group UNC5221 (China Nexus)"
95+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
96+
date = "2025-09-25"
97+
score = 75
98+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
99+
strings:
100+
//$str1 = /String \w{1,10}=request\.getParameter\(\"\w{1,15}\"\);/ ascii wide nocase
101+
$str1_alt = "=request.getParameter(\""
102+
$str2 = "=new String(java.util.Base64.getDecoder().decode(" ascii wide nocase
103+
//$str21 = /String\[\]\s\w{1,10}=\{\"\/bin\/sh\",\"-c\",\w{1,10}\+\"\s2>&1\"\};/ ascii wide nocase
104+
$str21_alt = "={\"/bin/sh\",\"-c\"," ascii
105+
$str3 = "= Runtime.getRuntime().exec(" ascii
106+
$str4 = "java.io.InputStream" ascii
107+
$str5 = "java.util.Base64.getEncoder().encodeToString(org.apache.commons.io.IOUtils.toByteArray(" ascii
108+
condition:
109+
filesize < 5MB and all of them
110+
}
111+
112+
rule WEBSHELL_G_APT_BackdoorWebshell_SLAYSTYLE_2 {
113+
meta:
114+
description = "Detects webshell used by APT group UNC5221 (China Nexus)"
115+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
116+
date = "2025-09-25"
117+
score = 75
118+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
119+
strings:
120+
$str1 = "request.getParameter"
121+
$str2 = "/bin/sh"
122+
$str3 = "java.io.InputStream"
123+
$str4 = "Runtime.getRuntime().exec("
124+
$str5 = "2>&1"
125+
condition:
126+
(uint16(0) != 0x5A4D and uint32(0) != 0x464C457F) and filesize < 7KB and all of them and @str4 > @str2
127+
}
128+
129+
rule MAL_G_Backdoor_BRICKSTEAL_1 {
130+
meta:
131+
description = "Detects backdoor BRICKSTEAL used by APT group UNC5221 (China Nexus)"
132+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
133+
date = "2025-09-25"
134+
score = 75
135+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
136+
strings:
137+
$str1 = "comvmware"
138+
$str2 = "abcdABCD1234!@#$"
139+
$str3 = "ads.png"
140+
$str4 = "User-Agent"
141+
$str5 = "com/vmware/"
142+
condition:
143+
all of them and filesize < 10KB
144+
}
145+
146+
rule MAL_G_Dropper_BRICKSTEAL_1 {
147+
meta:
148+
description = "Detects backdoor BRICKSTEAL dropper used by APT group UNC5221 (China Nexus)"
149+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
150+
date = "2025-09-25"
151+
score = 75
152+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
153+
strings:
154+
$str1 = "Base64.getDecoder().decode"
155+
$str2 = "Thread.currentThread().getContextClassLoader()"
156+
$str3 = ".class.getDeclaredMethod"
157+
$str4 = "byte[].class"
158+
$str5 = "method.invoke"
159+
$str6 = "filterClass.newInstance()"
160+
$str7 = "/websso/SAML2/SSO/*"
161+
condition:
162+
all of them
163+
}
164+
165+
rule MAL_G_Dropper_BRICKSTEAL_2 {
166+
meta:
167+
description = "Detects backdoor BRICKSTEAL dropper used by APT group UNC5221 (China Nexus)"
168+
author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
169+
date = "2025-09-25"
170+
score = 75
171+
reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
172+
strings:
173+
// $str1 = /\(Class<\?>\)\smethod\.invoke\(\w{1,20},\s\w{1,20},\s0,\s\w{1,20}\.length\);/i ascii wide
174+
$str1_alt = "(Class<?>) method.invoke(" ascii wide
175+
$str2 = "(\"yv66vg" ascii wide
176+
$str3 = "request.getSession().getServletContext" ascii wide
177+
$str4 = ".getClass().getDeclaredField(" ascii wide
178+
$str5 = "new FilterDef();" ascii wide
179+
$str6 = "new FilterMap();" ascii wide
180+
condition:
181+
all of them
182+
}

0 commit comments

Comments
 (0)