Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Cookiestealer

Detects generic cookie stealer

MalwareCookiestealerditekSHen 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 generic cookie stealer

Associated malware family: Cookiestealer.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-cookiestealer.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Cookiestealer : FILE
{
	meta:
		description = "Detects generic cookie stealer"
		author = "ditekSHen"
		id = "64c6c59d-4046-5949-bf71-22a5f6bfa209"
		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#L5841-L5857"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "9cc406ae078e37430b3cf10954c02014b9760bc887344842e724df735d1d9808"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "([\\S]+?)=([^;|^\\r|^\\n]+)" fullword ascii
		$s2 = "(.+?): ([^;|^\\r|^\\n]+)" fullword ascii
		$s3 = "Set-Cookie: ([^\\r|^\\n]+)" fullword ascii
		$s4 = "cmd.exe /c taskkill /f /im chrome.exe" fullword ascii
		$s5 = "FIREFOX.EXE|Google Chrome|IEXPLORE.EXE" ascii
		$pdb1 = "F:\\facebook_svn\\trunk\\database\\Release\\DiskScan.pdb" fullword ascii
		$pdb2 = "D:\\Projects\\crxinstall\\trunk\\Release\\spoofpref.pdb" fullword ascii
		$ua1 = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36" fullword ascii
		$ua2 = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36" fullword ascii

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

Strings (9 patterns)

IdentifierTypeValueModifiers
$s1text"([\\S]+?)=([^;|^\\r|^\\n]+)"fullword ascii
$s2text"(.+?): ([^;|^\\r|^\\n]+)"fullword ascii
$s3text"Set-Cookie: ([^\\r|^\\n]+)"fullword ascii
$s4text"cmd.exe /c taskkill /f /im chrome.exe"fullword ascii
$s5text"FIREFOX.EXE|Google Chrome|IEXPLORE.EXE"ascii
$pdb1text"F:\\facebook_svn\\trunk\\database\\Release\\DiskScan.pdb"fullword ascii
$pdb2text"D:\\Projects\\crxinstall\\trunk\\Release\\spoofpref.pdb"fullword ascii
$ua1text"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36"fullword ascii
$ua2text"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36"fullword ascii

Condition

uint16( 0 ) == 0x5a4d and ( ( all of ( $s* ) and 1 of ( $pdb* ) and 1 of ( $ua* ) ) or ( all of ( $ua* ) and 1 of ( $pdb* ) and 2 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 ( $ua* ) must match.
  • At least 1 patterns in ( $pdb* ) 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: 64c6c59d-4046-5949-bf71-22a5f6bfa209

Tags:FILE