Skip to content

Commit c515715

Browse files
authored
Add DCRat V3 and V4 detection rules
Added private rules for DCRat V3 and V4 indicators, including common strings and specific conditions for detection.
1 parent 572e2f5 commit c515715

1 file changed

Lines changed: 117 additions & 0 deletions

File tree

src/rat_king_parser/yara_utils/rules.yar

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,120 @@ rule venomrat {
121121
condition:
122122
5 of them and #patt_config >= 10
123123
}
124+
125+
126+
private rule DCRat_Common_Strings {
127+
meta:
128+
description = "Contains strings shared between DCRat V3 and V4"
129+
strings:
130+
// DCRat Common
131+
$dc_all_1 = "ICBfX18gICAgICAgICAgIF8gICAgICBfX18gICAgICAgICAgICAgXyAgICAgICAgXyAgIF9fXyAgICBfIF9fX19fIA0KIHwgICBcIF9fIF8gXyBffCB8X18gIC8gX198XyBfIF8gIF8gX198IHxfIF9fIF98IHwgfCBfIFwgIC9fXF8gICBffA0KIHwgfCkgLyBfYCB8ICdffCAvIC8gfCAoX198ICdffCB8fCAoXy08ICBfLyBfYCB8IHwgfCAgIC8gLyBfIFx8IHwgIA0KIHxfX18vXF9fLF98X3wgfF9cX1wgIFxfX198X3wgIFxfLCAvX18vXF9fXF9fLF98X3wgfF98X1wvXy8gXF9cX3wgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxfXy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA==" wide
132+
$dc_all_2 = "DCRat-Log#" wide
133+
134+
// GeoIP Common
135+
$geoip_all_1 = "geoplugin_city" wide fullword
136+
$geoip_all_2 = "geoplugin_countryName" wide fullword
137+
$geoip_all_3 = "geoplugin_countryCode" wide fullword
138+
$geoip_all_4 = "geoplugin_latitude" wide fullword
139+
$geoip_all_5 = "geoplugin_longitude" wide fullword
140+
$geoip_all_6 = "geoplugin_request" wide fullword
141+
142+
// Plugins Common
143+
$plugin_all_1 = "Processing other information..." wide fullword
144+
145+
// GUI Common
146+
$gui_all_1 = "Clipboard [Text].txt" wide fullword
147+
$gui_all_2 = "Clipboard [Files].txt" wide fullword
148+
$gui_all_3 = "[Clipboard] Saving information..." wide fullword
149+
$gui_all_4 = "[SystemInfromation] Saving information..." wide fullword
150+
$gui_all_5 = "~Work.log" wide fullword
151+
$gui_all_6 = "Done! Elapsed time: " wide fullword
152+
$gui_all_7 = "[Screenshot] Saving screenshots from " wide fullword
153+
154+
// Steal Common
155+
$steal_all_1 = "SELECT * FROM Win32_PnPEntity WHERE (PNPClass = 'Image' OR PNPClass = 'Camera')" wide fullword
156+
$steal_all_2 = "SOFTWARE\\Valve\\Steam" wide fullword
157+
$steal_all_3 = "SteamPath" wide fullword
158+
$steal_all_4 = "/config/loginusers.vdf" wide fullword
159+
$steal_all_5 = "/steamapps/common" wide fullword
160+
$steal_all_6 = "TelegramPath" wide fullword
161+
$steal_all_7 = "Telegram" wide fullword
162+
$steal_all_8 = "Kotatogram" wide fullword
163+
$steal_all_9 = "Unigram" wide fullword
164+
$steal_all_10 = "Telefuel" wide fullword
165+
$steal_all_11 = "/tdata" wide fullword
166+
$steal_all_12 = "DiscordPath" wide fullword
167+
168+
condition:
169+
uint16(0) == 0x5a4d and
170+
(
171+
(2 of ($dc_all*)) or
172+
(
173+
(3 of ($geoip_all*)) and
174+
(1 of ($plugin_all*)) and
175+
(2 of ($gui_all*)) and
176+
(5 of ($steal_all*))
177+
)
178+
)
179+
}
180+
181+
private rule DCRat_V3_Indicators {
182+
meta:
183+
description = "Indicators specific to V3 (GZIP+B64)"
184+
strings:
185+
$dc_v1_1 = "DCRat.Code" wide
186+
$geoip_v1_1 = "geoplugin_timezone" wide fullword
187+
$geoip_v1_2 = "geoplugin_regionName" wide fullword
188+
$plugin_v1_1 = "Processing stealer plugins [" wide fullword
189+
$plugin_v1_2 = "Unknown command! Maybe a plugin is required?" wide fullword
190+
$steal_v1_1 = "\\discord\\Local Storage\\leveldb\\" wide fullword
191+
condition:
192+
any of them
193+
}
194+
195+
private rule DCRat_V4_Indicators {
196+
meta:
197+
description = "Indicators specific to V4 (AES+PBKDF2)"
198+
strings:
199+
$dc_v2_1 = "DarkCrystal RAT" wide
200+
$geoip_v2_1 = "geoplugin_region" wide fullword
201+
$plugin_v2_1 = "[Plugin] Execute: " wide fullword
202+
$plugin_v2_2 = "Processing plugins [" wide fullword
203+
$steal_v2_1 = "discordcanary" wide fullword
204+
$steal_v2_2 = "Lightcord" wide fullword
205+
$steal_v2_3 = "discordptb" wide fullword
206+
condition:
207+
any of them
208+
}
209+
210+
rule DCRatV3 {
211+
meta:
212+
author = "ClaudioWayne"
213+
description = "DCRat V3 (GZIP+B64 String Decryption) Payload"
214+
cape_type = "DCRatV3 Payload"
215+
condition:
216+
DCRat_Common_Strings
217+
and DCRat_V3_Indicators
218+
and not DCRat_V4_Indicators
219+
}
220+
221+
rule DCRatV4 {
222+
meta:
223+
author = "ClaudioWayne"
224+
description = "DCRat V4 (AES+PBKDF2 String Decryption) Payload"
225+
cape_type = "DCRatV4 Payload"
226+
condition:
227+
DCRat_Common_Strings
228+
and DCRat_V4_Indicators
229+
and not DCRat_V3_Indicators
230+
}
231+
232+
rule DCRat_Generic_V3_V4 {
233+
meta:
234+
author = "ClaudioWayne"
235+
description = "DCRat Generic (V3/V4) Payload - Matches common fingerprint"
236+
cape_type = "DCRatV3V4 Payload"
237+
condition:
238+
DCRat_Common_Strings
239+
and not (DCRatV3 or DCRatV4) // Optional: avoid duplicate alerts if V3 or V4 matched
240+
}

0 commit comments

Comments
 (0)