YARA · SEKOIA.IO Community
SEKOIA_Tool_Impersonate_Strings
Detects Impersonate
- Author
- Sekoia.io
- Date
- 2024-07-24
- Modified
- 2024-12-19
- Score / Quality
- 75 / 80
What this rule detects
Detects Impersonate
Targets: Windows PE.
It defines 9 patterns (9 text, 0 hex, 0 regex). YARA modules used: pe.
Summary generated from the rule's metadata and condition.
Rule source
Includes the imports needed to compile it on its own.
tool-impersonate-strings.yarDetection Rule License 1.1
import "pe"
rule SEKOIA_Tool_Impersonate_Strings : FILE
{
meta:
= "Detects Impersonate"
= "Sekoia.io"
= "2ab345a2-9366-4673-b398-a59ba6954af5"
= "2024-07-24"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/tool_impersonate_strings.yar#L3-L26"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "63c46a2d97d0a8360351b8906665186c5ad2dcaa6f2edba6da7bf4de2ce00241"
= 75
= 80
= "FILE"
= "1.0"
= "TLP:CLEAR"
strings:
$ = "[*] Listing available tokens"
$ = "[ID: %2d][SESSION: %d][INTEGRITY: %-6ws][%-18ws][%-22ws] User: %ws"
$ = "[*] Impersonating %ws"
$ = "[!] Impersonation failed error: %d"
$ = "[*] Adding user %ls on %ls"
$ = "[!] Add user failed with error: %d"
$ = "[*] Adding user %ws to domain group %ws"
$ = "[!] Add user in domain %ws failed with error: %d"
$ = "[!] Couldn't change token session id (error: %d)"
condition:
uint16be( 0 ) == 0x4d5a and 3 of them or pe.imphash ( ) == "e14ce763114276674e22b7b8b637bd4b"
}
Strings (9 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $ | text | "[*] Listing available tokens" | |
| $ | text | "[ID: %2d][SESSION: %d][INTEGRITY: %-6ws][%-18ws][%-22ws] User: %ws" | |
| $ | text | "[*] Impersonating %ws" | |
| $ | text | "[!] Impersonation failed error: %d" | |
| $ | text | "[*] Adding user %ls on %ls" | |
| $ | text | "[!] Add user failed with error: %d" | |
| $ | text | "[*] Adding user %ws to domain group %ws" | |
| $ | text | "[!] Add user in domain %ws failed with error: %d" | |
| $ | text | "[!] Couldn't change token session id (error: %d)" |
Condition
uint16be( 0 ) == 0x4d5a and 3 of them or pe.imphash ( ) == "e14ce763114276674e22b7b8b637bd4b"In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- At least 3 patterns in the rule must match.
- Uses the pe module.
- Checks the PE import hash (imphash).
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: Sekoia.io
Source repository: SEKOIA.IO Community @ a438a5901a
Licence: Detection Rule License 1.1 (repository licence)
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 2ab345a2-9366-4673-b398-a59ba6954af5
Metadata
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Tags:FILE
Related rules
- Hack toolSEKOIA.IO Community· Sekoia.io· 2024-09-06
- Hack toolSEKOIA.IO Community· Sekoia.io· 2024-02-29
- Hack toolSEKOIA.IO Community· Sekoia.io· 2023-12-05
- Hack toolSEKOIA.IO Community· Sekoia.io· 2023-11-15
- Hack toolSEKOIA.IO Community· Sekoia.io· 2023-08-23
- Hack toolSEKOIA.IO Community· Sekoia.io· 2022-02-08
- Hack toolSEKOIA.IO Community· Sekoia.io· 2022-07-22
- Hack toolSEKOIA.IO Community· Sekoia.io· 2022-09-09