YARA · elceef yara-rulz
ELCEEF_BAT_Begin_Substring_Env
Detects suspicious substring syntax at the begining of batch script
- Author
- marcin@ulikowski.pl
- Date
- 2023-06-02
- Modified
- 2024-04-10
- Score / Quality
- 65 / 75
What this rule detects
Detects suspicious substring syntax at the begining of batch script
It defines 2 patterns (1 text, 1 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
rule ELCEEF_BAT_Begin_Substring_Env
{
meta:
= "Detects suspicious substring syntax at the begining of batch script"
= "marcin@ulikowski.pl"
= "3fca187b-d2e7-595c-9330-25141a54285b"
= "2023-06-02"
= "2024-04-10"
= "https://cybersecurity.att.com/blogs/labs-research/seroxen-rat-for-sale"
= "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/Suspicious_BAT.yara#L39-L55"
= "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
= "8ace121fae472cc7ce896c91a3f1743d5ccc8a389bc3152578c4782171c69e87"
= "cc5e6e511bbc0a5cbb277ed0cbac1f2b21db8e21c4cdc802b6a1c3313d3b55cc"
= 65
= 75
= ""
strings:
$echo = "@echo off"
$substr = { 3a 7e ( 3? 2c 3? | 2d 3? 2c 3? | 3? 2c 2d 3? | 3? 3? 2c 3? | 2d 3? 3? 2c 3? | 3? 3? 2c 2d 3? ) 25 }
condition:
$echo in ( 0 .. 4 ) and $substr in ( 10 .. 100 )
}
Strings (2 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $echo | text | "@echo off" | |
| $substr | hex | { 3a 7e ( 3? 2c 3? | 2d 3? 2c 3? | 3? 2c 2d 3? | 3? 3? 2c 3? | 2d 3? 3? 2c 3? | 3? 3? 2c 2d 3? ) 25 } |
Condition
$echo in ( 0 .. 4 ) and $substr in ( 10 .. 100 )In plain words (Heuristic)
- Pattern $echo must be found within the range 0 .. 4.
- Pattern $substr must be found within the range 10 .. 100.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- 8ace121fae472cc7ce896c91a3f1743d5ccc8a389bc3152578c4782171c69e87
Licence & attribution
Author: marcin@ulikowski.pl
Source repository: elceef yara-rulz @ 5683b294a1
Licence: MIT License (repository licence)
Copyright notice: Copyright (c) 2022 Marcin Ulikowski
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 3fca187b-d2e7-595c-9330-25141a54285b
Related rules
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-05-01
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-02-01
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-01-22
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-04-04
- Exploitelceef yara-rulz· marcin@ulikowski.pl· 2025-08-18
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2024-04-10
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2023-05-05
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2023-04-17