Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Netwire

Detects NetWire RAT

MalwareNetwireditekSHen 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 NetWire RAT

Associated malware family: Netwire.

Targets: Windows PE.

It defines 15 patterns (14 text, 1 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

malware-win-netwire.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Netwire : FILE
{
	meta:
		description = "Detects NetWire RAT"
		author = "ditekSHen"
		id = "c215f449-c725-51da-8f5b-2619bc282b22"
		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#L4783-L4805"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "bae4f0cd7a431336bd784ba95f6ba3396e6f0f12c081e62482ad37ff859c1f1c"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$x1 = "SOFTWARE\\NetWire" fullword ascii
		$x2 = { 4e 65 74 57 69 72 65 00 53 4f 46 54 57 41 52 45 5c 00 }
		$s1 = "User-Agent: Mozilla/4.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" fullword ascii
		$s2 = "filenames.txt" fullword ascii
		$s3 = "GET %s HTTP/1.1" fullword ascii
		$s4 = "[%.2d/%.2d/%d %.2d:%.2d:%.2d]" fullword ascii
		$s5 = "Host.exe" fullword ascii
		$s6 = "-m \"%s\"" fullword ascii
		$g1 = "HostId" fullword ascii
		$g2 = "History" fullword ascii
		$g3 = "encrypted_key" fullword ascii
		$g4 = "Install Date" fullword ascii
		$g5 = "hostname" fullword ascii
		$g6 = "encryptedUsername" fullword ascii
		$g7 = "encryptedPassword" fullword ascii

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

Strings (15 patterns)

IdentifierTypeValueModifiers
$x1text"SOFTWARE\\NetWire"fullword ascii
$x2hex{ 4e 65 74 57 69 72 65 00 53 4f 46 54 57 41 52 45 5c 00 }
$s1text"User-Agent: Mozilla/4.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"fullword ascii
$s2text"filenames.txt"fullword ascii
$s3text"GET %s HTTP/1.1"fullword ascii
$s4text"[%.2d/%.2d/%d %.2d:%.2d:%.2d]"fullword ascii
$s5text"Host.exe"fullword ascii
$s6text"-m \"%s\""fullword ascii
$g1text"HostId"fullword ascii
$g2text"History"fullword ascii
$g3text"encrypted_key"fullword ascii
$g4text"Install Date"fullword ascii
$g5text"hostname"fullword ascii
$g6text"encryptedUsername"fullword ascii
$g7text"encryptedPassword"fullword ascii

Condition

uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or all of ( $x* ) or ( 1 of ( $x* ) and 2 of ( $s* ) ) or ( all of ( $g* ) and ( 2 of ( $s* ) or 1 of ( $x* ) ) ) )

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.
  • All patterns in ( $g* ) must match.
  • At least 1 patterns in ( $x* ) 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: c215f449-c725-51da-8f5b-2619bc282b22

Tags:FILE