Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWRE_Win_Darkgate

Detects DarkGate infostealer and coinminer

MalwareCoinminerditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-11-01
Score / Quality
75 / 75

What this rule detects

Detects DarkGate infostealer and coinminer

Associated malware family: Coinminer.

Targets: Windows PE.

It defines 17 patterns (15 text, 0 hex, 2 regex).

Summary generated from the rule's metadata and condition.

Rule source

malwre-win-darkgate.yarBSD 2-Clause License
rule DITEKSHEN_MALWRE_Win_Darkgate : FILE
{
	meta:
		description = "Detects DarkGate infostealer and coinminer"
		author = "ditekSHen"
		id = "4488e1e6-daac-5832-8326-3151c834daf1"
		date = "2020-11-06"
		modified = "2024-11-01"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L10747-L10771"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "805a04bbb3915d539e76927393384a2786c25490e8b9fc151d5b12415247578b"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$x1 = "SYSTEM Elevation: Completed, new DarkGate connection with SYSTEM privileges" ascii
		$x2 = "-u 0xDark" ascii
		$x3 = "DarkGate" ascii
		$x4 = "/c cmdkey /generic:\"127.0.0.2\" /user:\"SafeMode\" /pass:\"darkgatepassword0\"" ascii
		$s1 = "c:\\temp\\crash.txt" ascii
		$s2 = "/cookiesfile \"" ascii
		$s3 = "/c rmdir /s /q \"" ascii
		$s4 = "/c xcopy /E /I /Y \"%s\" \"%s\" && exit" ascii
		$s5 = "U_MemScan" ascii
		$s6 = "U_Google_AD" ascii
		$s7 = "untBotUtils" ascii
		$s8 = "____padoru____" ascii
		$s9 = "u_SysHook" ascii
		$s10 = "zLAxuU0kQKf3sWE7ePRO2imyg9GSpVoYC6rhlX48ZHnvjJDBNFtMd1I5acwbqT+=" ascii
		$s11 = "C:\\Windows\\System32\\ntdll.dll" fullword ascii
		$s12 = /(SYSTEM )?Elevation: (Cannot|I already|AT RAW|FAILURE)/ ascii
		$s13 = /Stub: (WARNING:|Configuration updated:|Global Ping Invoked)/ ascii

	condition:
		( uint16( 0 ) == 0x5a4d and ( ( 3 of ( $x* ) ) or ( 2 of ( $x* ) and 3 of ( $s* ) ) or ( 1 of ( $x* ) and 5 of ( $s* ) ) or ( 6 of ( $s* ) ) ) ) or ( 10 of them )
}

Strings (17 patterns)

IdentifierTypeValueModifiers
$x1text"SYSTEM Elevation: Completed, new DarkGate connection with SYSTEM privileges"ascii
$x2text"-u 0xDark"ascii
$x3text"DarkGate"ascii
$x4text"/c cmdkey /generic:\"127.0.0.2\" /user:\"SafeMode\" /pass:\"darkgatepassword0\""ascii
$s1text"c:\\temp\\crash.txt"ascii
$s2text"/cookiesfile \""ascii
$s3text"/c rmdir /s /q \""ascii
$s4text"/c xcopy /E /I /Y \"%s\" \"%s\" && exit"ascii
$s5text"U_MemScan"ascii
$s6text"U_Google_AD"ascii
$s7text"untBotUtils"ascii
$s8text"____padoru____"ascii
$s9text"u_SysHook"ascii
$s10text"zLAxuU0kQKf3sWE7ePRO2imyg9GSpVoYC6rhlX48ZHnvjJDBNFtMd1I5acwbqT+="ascii
$s11text"C:\\Windows\\System32\\ntdll.dll"fullword ascii
$s12regex/(SYSTEM )?Elevation: (Cannot|I already|AT RAW|FAILURE)/ascii
$s13regex/Stub: (WARNING:|Configuration updated:|Global Ping Invoked)/ascii

Condition

( uint16( 0 ) == 0x5a4d and ( ( 3 of ( $x* ) ) or ( 2 of ( $x* ) and 3 of ( $s* ) ) or ( 1 of ( $x* ) and 5 of ( $s* ) ) or ( 6 of ( $s* ) ) ) ) or ( 10 of them )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 3 patterns in ( $x* ) must match.
  • At least 2 patterns in ( $x* ) must match.
  • At least 3 patterns in ( $s* ) must match.
  • At least 1 patterns in ( $x* ) must match.
  • At least 5 patterns in ( $s* ) must match.
  • At least 6 patterns in ( $s* ) must match.
  • At least 10 patterns in the rule must match.

Test this rule in your browser

Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.

Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.

Open in editor

References

Licence & attribution

Author: ditekSHen

Source repository: ditekSHen detection @ e76c93dcde

Licence: BSD 2-Clause License (repository licence)

Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: 4488e1e6-daac-5832-8326-3151c834daf1

Tags:FILE

More Coinminer rules