YARA · Signature Base (Florian Roth / Nextron)
SIGNATURE_BASE_MAL_LNX_Redmenshen_Bpfdoor_May23_1
Detects BPFDoor malware
- Author
- Florian Roth
- Date
- 2023-05-11
- Modified
- 2023-12-05
- Score / Quality
- 80 / 85
What this rule detects
Detects BPFDoor malware
It defines 9 patterns (3 text, 6 hex, 0 regex).
YARA-X says: warning[unintended_pattern_in_set]: pattern `$sc1` may be unintendedly or redundantly included in pattern set `$sc*`
Summary generated from the rule's metadata and condition.
Rule source
rule SIGNATURE_BASE_MAL_LNX_Redmenshen_Bpfdoor_May23_1 : FILE
{
meta:
= "Detects BPFDoor malware"
= "Florian Roth"
= "25df4dba-ec6e-5999-b6be-56fe933cb0d0"
= "2023-05-11"
= "2023-12-05"
= "https://www.deepinstinct.com/blog/bpfdoor-malware-evolves-stealthy-sniffing-backdoor-ups-its-game"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/mal_lnx_implant_may22.yar#L3-L42"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
= "afa8a32ec29a31f152ba20a30eb483520fe50f2dce6c9aa9135d88f7c9c511d7"
= "c58971a43443800256e791b4f9fe7c3221518b0050e5f2964b6c843ddb4549ac"
= 80
= 85
= "FILE"
strings:
$x1 = "[-] Execute command failed" ascii fullword
$x2 = "/var/run/initd.lock" ascii fullword
$xc1 = { 2F 00 3E 3E 00 65 78 69 74 00 72 00 }
$sc1 = { 9F CD 30 44 }
$sc2 = { 66 27 14 5E }
$sa1 = "TLS-CHACHA20-POLY1305-SHA256" ascii fullword
$sop1 = { 48 83 c0 01 4c 39 f8 75 ea 4c 89 7c 24 68 48 69 c3 d0 00 00 00 48 8b 5c 24 50 48 8b 54 24 78 48 c7 44 24 38 00 00 00 00 }
$sop2 = { 48 89 de f3 a5 89 03 8b 44 24 2c 39 44 24 28 44 89 4b 04 48 89 53 10 0f 95 c0 }
$sop3 = { 49 d3 cd 4d 31 cd b1 29 49 89 e9 49 d3 c8 4d 31 c5 4c 03 68 10 48 89 f9 }
condition:
uint16( 0 ) == 0x457f and filesize < 900KB and ( ( 1 of ( $x* ) and 1 of ( $s* ) ) or 4 of them or ( all of ( $sc* ) and $sc1 in ( @sc2 [ 1 ] -50 .. @sc2 [ 1 ] + 50 ) ) ) or ( 2 of ( $x* ) or 5 of them )
}
Strings (9 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $x1 | text | "[-] Execute command failed" | ascii fullword |
| $x2 | text | "/var/run/initd.lock" | ascii fullword |
| $xc1 | hex | { 2F 00 3E 3E 00 65 78 69 74 00 72 00 } | |
| $sc1 | hex | { 9F CD 30 44 } | |
| $sc2 | hex | { 66 27 14 5E } | |
| $sa1 | text | "TLS-CHACHA20-POLY1305-SHA256" | ascii fullword |
| $sop1 | hex | { 48 83 c0 01 4c 39 f8 75 ea 4c 89 7c 24 68 48 69 c3 d0 00 00 00 48 8b 5c 24 50 48 8b 54 24 78 48 c7 44 24 38 00 00 00 00 } | |
| $sop2 | hex | { 48 89 de f3 a5 89 03 8b 44 24 2c 39 44 24 28 44 89 4b 04 48 89 53 10 0f 95 c0 } | |
| $sop3 | hex | { 49 d3 cd 4d 31 cd b1 29 49 89 e9 49 d3 c8 4d 31 c5 4c 03 68 10 48 89 f9 } |
Condition
uint16( 0 ) == 0x457f and filesize < 900KB and ( ( 1 of ( $x* ) and 1 of ( $s* ) ) or 4 of them or ( all of ( $sc* ) and $sc1 in ( @sc2 [ 1 ] -50 .. @sc2 [ 1 ] + 50 ) ) ) or ( 2 of ( $x* ) or 5 of them )In plain words (Heuristic)
- The file must be smaller than 900KB (a cheap guard that skips large files).
- All patterns in ( $sc* ) must match.
- At least 1 patterns in ( $x* ) must match.
- At least 1 patterns in ( $s* ) must match.
- At least 4 patterns in the rule must match.
- At least 2 patterns in ( $x* ) must match.
- At least 5 patterns in the rule must match.
- Pattern $sc1 must be found within the range @sc2 [ 1 ] -50 .. @sc2 [ 1 ] + 50.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
References
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- afa8a32ec29a31f152ba20a30eb483520fe50f2dce6c9aa9135d88f7c9c511d7
Licence & attribution
Author: Florian Roth
Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a
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: 25df4dba-ec6e-5999-b6be-56fe933cb0d0
Tags:FILE
Related rules
- MalwareSignature Base (Florian Roth / Nextron)· Florian Roth· 2023-04-15
- MalwareSignature Base (Florian Roth / Nextron)· Florian Roth· 2024-02-23
- MalwareSignature Base (Florian Roth / Nextron)· Florian Roth· 2024-02-23
- MalwareSignature Base (Florian Roth / Nextron)· Florian Roth· 2023-02-13
- MalwareSignature Base (Florian Roth / Nextron)· Florian Roth· 2023-02-13
- MalwareSignature Base (Florian Roth / Nextron)· Florian Roth· 2023-04-17
- MalwareSignature Base (Florian Roth / Nextron)· Florian Roth· 2023-04-17
- MalwareSignature Base (Florian Roth / Nextron)· Florian Roth· 2023-11-01