Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Phonzy

Detects specific downloader agent

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

What this rule detects

Detects specific downloader agent

Associated malware family: Phonzy.

Targets: Windows PE.

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

YARA-X says: warning[unintended_pattern_in_set]: pattern `$s1` may be unintendedly or redundantly included in pattern set `$s*`

Summary generated from the rule's metadata and condition.

Rule source

malware-win-phonzy.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Phonzy : FILE
{
	meta:
		description = "Detects specific downloader agent"
		author = "ditekSHen"
		id = "d35f41e4-4633-5482-9ae4-79354463f1b9"
		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#L6595-L6608"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "924e7674d76594314df1a32d38f19cee12a3ed49cdf5e153f98bb08a7634055c"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$ua1 = "User-Agent: Mozilla/5.0 (X11; Linux" wide
		$s1 = "<meta name=\"keywords\" content=\"([\\w\\d ]*)\">" fullword wide
		$s2 = "WebClient" fullword ascii
		$s3 = "WriteAllText" fullword ascii
		$s4 = "DownloadString" fullword ascii
		$s5 = "WriteByte" fullword ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or ( 1 of ( $ua* ) and ( $s1 ) and 2 of ( $s* ) ) )
}

Strings (6 patterns)

IdentifierTypeValueModifiers
$ua1text"User-Agent: Mozilla/5.0 (X11; Linux"wide
$s1text"<meta name=\"keywords\" content=\"([\\w\\d ]*)\">"fullword wide
$s2text"WebClient"fullword ascii
$s3text"WriteAllText"fullword ascii
$s4text"DownloadString"fullword ascii
$s5text"WriteByte"fullword ascii

Condition

uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or ( 1 of ( $ua* ) and ( $s1 ) and 2 of ( $s* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $s* ) must match.
  • At least 1 patterns in ( $ua* ) must match.
  • At least 2 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: d35f41e4-4633-5482-9ae4-79354463f1b9

Tags:FILE