Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Heracles

Detects Heracles infostealer

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

What this rule detects

Detects Heracles infostealer

Associated malware family: Heracles.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-heracles.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Heracles : FILE
{
	meta:
		description = "Detects Heracles infostealer"
		author = "ditekSHen"
		id = "36cb9366-c70b-5117-955f-402f87f3a88c"
		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#L8833-L8861"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "1d5c80c084f9d6e4692a18f74574179095ecdd5eaadd70b5d16c19702761d74f"
		score = 75
		quality = 73
		tags = "FILE"

	strings:
		$x1 = "aHR0cHM6Ly9uYWNrZXIudG9hbnNlY3UuY29tL3VwbG9hZHM/a2V5PX" wide
		$b1 = "XEdvb2dsZVxDaHJvbWVc" wide
		$b2 = "XEJyYXZlU29mdHdhcmVcQnJhdmUtQnJvd3Nlcl" wide
		$b3 = "XENvY0NvY1xCcm93c2VyX" wide
		$b4 = "VXNlciBEYXRh" wide
		$b5 = "RGVmYXVsdA" wide
		$b6 = "UHJvZmlsZQ" wide
		$b7 = "Q29va2llcw" wide
		$b8 = "TG9naW4gRGF0YQ" wide
		$b9 = "TG9jYWwgU3RhdGU" wide
		$b10 = "bG9jYWxzdGF0ZQ" wide
		$b11 = "bG9naW5kYXRh" wide
		$s1 = "encrypted_key" fullword wide
		$s2 = "<GetIpInfoAsync>d__" ascii
		$s3 = "<reqHTML>5__" ascii
		$s4 = "<idHardware>5__" ascii
		$s5 = "<profilePaths>5__" ascii
		$s6 = "<cookieFile>5__" ascii
		$s7 = "<loginDataFile>5__" ascii
		$s8 = "<localStateFile>5__" ascii
		$s9 = "<postData>5__" ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( 1 of ( $x* ) or 8 of ( $s* ) or ( 4 of ( $b* ) and 4 of ( $s* ) ) )
}

Strings (21 patterns)

IdentifierTypeValueModifiers
$x1text"aHR0cHM6Ly9uYWNrZXIudG9hbnNlY3UuY29tL3VwbG9hZHM/a2V5PX"wide
$b1text"XEdvb2dsZVxDaHJvbWVc"wide
$b2text"XEJyYXZlU29mdHdhcmVcQnJhdmUtQnJvd3Nlcl"wide
$b3text"XENvY0NvY1xCcm93c2VyX"wide
$b4text"VXNlciBEYXRh"wide
$b5text"RGVmYXVsdA"wide
$b6text"UHJvZmlsZQ"wide
$b7text"Q29va2llcw"wide
$b8text"TG9naW4gRGF0YQ"wide
$b9text"TG9jYWwgU3RhdGU"wide
$b10text"bG9jYWxzdGF0ZQ"wide
$b11text"bG9naW5kYXRh"wide
$s1text"encrypted_key"fullword wide
$s2text"<GetIpInfoAsync>d__"ascii
$s3text"<reqHTML>5__"ascii
$s4text"<idHardware>5__"ascii
$s5text"<profilePaths>5__"ascii
$s6text"<cookieFile>5__"ascii
$s7text"<loginDataFile>5__"ascii
$s8text"<localStateFile>5__"ascii
$s9text"<postData>5__"ascii

Condition

uint16( 0 ) == 0x5a4d and ( 1 of ( $x* ) or 8 of ( $s* ) or ( 4 of ( $b* ) and 4 of ( $s* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 1 patterns in ( $x* ) must match.
  • At least 8 patterns in ( $s* ) must match.
  • At least 4 patterns in ( $b* ) must match.
  • At least 4 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: 36cb9366-c70b-5117-955f-402f87f3a88c

Tags:FILE