Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Bandook

Detects Bandook backdoor

MalwareBandookditekSHen 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 Bandook backdoor

Associated malware family: Bandook.

Targets: Windows PE.

It defines 19 patterns (19 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

malware-win-bandook.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Bandook : FILE
{
	meta:
		description = "Detects Bandook backdoor"
		author = "ditekshen"
		id = "c74bd688-c79e-5939-93a8-c2cd9f2cd60e"
		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#L2676-L2705"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "bff09f769aae890d81efe9926cc8ce85c1caa4eeeb6bc7d2321d2d906ac8d6cf"
		score = 75
		quality = 75
		tags = "FILE"
		clamav_sig = "MALWARE.Win.Trojan.Bandook"

	strings:
		$s1 = "\"%sLib\\dpx.pyc\" \"%ws\" \"%ws\" \"%ws\" \"%ws\" \"%ws\"" fullword wide
		$s2 = "%s\\usd\\dv-%s.dat" fullword ascii
		$s3 = "%sprd.dat" fullword ascii
		$s4 = "%sfile\\shell\\open\\command" fullword ascii
		$s5 = "explorer.exe , %s" fullword ascii
		$f1 = "CaptureScreen" fullword ascii
		$f2 = "StartShell" fullword ascii
		$f3 = "ClearCred" fullword ascii
		$f4 = "GrabFileFromDevice" fullword ascii
		$f5 = "PutFileOnDevice" fullword ascii
		$f6 = "ChromeInject" fullword ascii
		$f7 = "StartFileMonitor" fullword ascii
		$f8 = "DisableMouseCapture" fullword ascii
		$f9 = "StealUSB" fullword ascii
		$f10 = "DDOSON" fullword ascii
		$f11 = "InstallMac" fullword ascii
		$f12 = "SendCam" fullword ascii
		$x1 = "RTC-TGUBP" fullword ascii
		$x2 = "AVE_MARIA" fullword ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or 6 of ( $f* ) or ( 2 of ( $s* ) and 3 of ( $f* ) ) or ( all of ( $x* ) and ( 2 of ( $f* ) or 3 of ( $s* ) ) ) )
}

Strings (19 patterns)

IdentifierTypeValueModifiers
$s1text"\"%sLib\\dpx.pyc\" \"%ws\" \"%ws\" \"%ws\" \"%ws\" \"%ws\""fullword wide
$s2text"%s\\usd\\dv-%s.dat"fullword ascii
$s3text"%sprd.dat"fullword ascii
$s4text"%sfile\\shell\\open\\command"fullword ascii
$s5text"explorer.exe , %s"fullword ascii
$f1text"CaptureScreen"fullword ascii
$f2text"StartShell"fullword ascii
$f3text"ClearCred"fullword ascii
$f4text"GrabFileFromDevice"fullword ascii
$f5text"PutFileOnDevice"fullword ascii
$f6text"ChromeInject"fullword ascii
$f7text"StartFileMonitor"fullword ascii
$f8text"DisableMouseCapture"fullword ascii
$f9text"StealUSB"fullword ascii
$f10text"DDOSON"fullword ascii
$f11text"InstallMac"fullword ascii
$f12text"SendCam"fullword ascii
$x1text"RTC-TGUBP"fullword ascii
$x2text"AVE_MARIA"fullword ascii

Condition

uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or 6 of ( $f* ) or ( 2 of ( $s* ) and 3 of ( $f* ) ) or ( all of ( $x* ) and ( 2 of ( $f* ) or 3 of ( $s* ) ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $s* ) must match.
  • All patterns in ( $x* ) must match.
  • At least 6 patterns in ( $f* ) must match.
  • At least 2 patterns in ( $s* ) must match.
  • At least 3 patterns in ( $f* ) must match.
  • At least 2 patterns in ( $f* ) must match.
  • At least 3 patterns in ( $s* ) 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: c74bd688-c79e-5939-93a8-c2cd9f2cd60e

Metadata

clamav_sigMALWARE.Win.Trojan.Bandook

Tags:FILE