YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_Cookiestealer
Detects generic cookie stealer
- 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:
= "Detects generic cookie stealer"
= "ditekSHen"
= "64c6c59d-4046-5949-bf71-22a5f6bfa209"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L5841-L5857"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "9cc406ae078e37430b3cf10954c02014b9760bc887344842e724df735d1d9808"
= 75
= 75
= "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)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $s1 | text | "([\\S]+?)=([^;|^\\r|^\\n]+)" | fullword ascii |
| $s2 | text | "(.+?): ([^;|^\\r|^\\n]+)" | fullword ascii |
| $s3 | text | "Set-Cookie: ([^\\r|^\\n]+)" | fullword ascii |
| $s4 | text | "cmd.exe /c taskkill /f /im chrome.exe" | fullword ascii |
| $s5 | text | "FIREFOX.EXE|Google Chrome|IEXPLORE.EXE" | ascii |
| $pdb1 | text | "F:\\facebook_svn\\trunk\\database\\Release\\DiskScan.pdb" | fullword ascii |
| $pdb2 | text | "D:\\Projects\\crxinstall\\trunk\\Release\\spoofpref.pdb" | fullword ascii |
| $ua1 | text | "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 | text | "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.
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).
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
Related rules
- MalwareditekSHen detection· ditekSHen· 2034-02-17
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06