Skip to content

Commit 1fd0d8e

Browse files
Still34mr-tz
andauthored
Add SysWhispers2 detection & add 0x2e syscall detection (#888)
* Add SysWhisper2 detection & add int 2e to syscall detection --------- Signed-off-by: Still Hsu <[email protected]> Co-authored-by: Moritz <[email protected]>
1 parent 1bf58dc commit 1fd0d8e

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
rule:
2+
meta:
3+
name: populate SysWhispers2 syscall list
4+
namespace: linking/runtime-linking
5+
authors:
6+
7+
scopes:
8+
static: function
9+
dynamic: unsupported
10+
att&ck:
11+
- Execution::Shared Modules [T1129]
12+
- Execution::Native API [T1106]
13+
- Defense Evasion::Obfuscated Files or Information::Indicator Removal from Tools [T1027.005]
14+
references:
15+
- https://github.com/jthuraisamy/SysWhispers2/blob/main/data/base.c#L32
16+
examples:
17+
- 932dab8756ad4ae9a62bde0772d952e4:0x14001BD1E
18+
features:
19+
- and:
20+
- and:
21+
- description: check ntdll.dll
22+
- instruction:
23+
- description: "to lower case"
24+
- mnemonic: or
25+
- operand[1].number: 0x20202020
26+
- or:
27+
- instruction:
28+
- mnemonic: cmp
29+
- operand[1].number: 0x6C64746E = "ldtn"
30+
- instruction:
31+
- mnemonic: cmp
32+
- operand[1].number: 0x6C642E6C = "ld.l"
33+
- and:
34+
- description: check system call starting with 'Zw'
35+
- instruction:
36+
- description: check 'Zw'
37+
- mnemonic: cmp
38+
- operand[1].number: 0x775a = "wZ"
39+
- and: # this is optional but this should reduce false positives if any at all
40+
- description: syscall list sorting
41+
- instruction:
42+
- mnemonic: add
43+
- operand[1].number: 1
44+
- mnemonic: lea
45+
- mnemonic: mov

nursery/execute-syscall.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ rule:
66
- "@kulinacs"
77
- "@mr-tz"
88
9+
910
description: may be used to evade hooks or hinder analysis
1011
scopes:
1112
static: basic block
1213
dynamic: unsupported # requires mnemonic features
1314
references:
1415
- https://github.com/j00ru/windows-syscalls
16+
- https://codemachine.com/articles/system_call_instructions.html
17+
- https://www.felixcloutier.com/x86/sysenter
1518
features:
1619
- or:
1720
- and:
@@ -20,7 +23,12 @@ rule:
2023
- os: android
2124
- api: syscall # https://man7.org/linux/man-pages/man2/syscall.2.html
2225
- and:
23-
- mnemonic: syscall
26+
- or:
27+
- mnemonic: sysenter
28+
- mnemonic: syscall
29+
- instruction:
30+
- mnemonic: int
31+
- operand[0].number: 0x2e
2432
- or:
2533
- mnemonic: ret
2634
- mnemonic: retn

0 commit comments

Comments
 (0)