Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SysWhispers2 detection & add 0x2e syscall detection #888

Merged
merged 9 commits into from
Sep 24, 2024
45 changes: 45 additions & 0 deletions linking/runtime-linking/populate-syswhispers2-syscall-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
rule:
meta:
name: populate SysWhispers2 syscall list
namespace: linking/runtime-linking
authors:
- [email protected]
scopes:
static: function
dynamic: unsupported
att&ck:
- Execution::Shared Modules [T1129]
- Execution::Native API [T1106]
- Defense Evasion::Obfuscated Files or Information::Indicator Removal from Tools [T1027.005]
references:
- https://github.com/jthuraisamy/SysWhispers2/blob/main/data/base.c#L32
examples:
- 932dab8756ad4ae9a62bde0772d952e4:0x14001BD1E
features:
- and:
- and:
- description: check ntdll.dll
- instruction:
- description: "to lower case"
- mnemonic: or
- operand[1].number: 0x20202020
- or:
- instruction:
- mnemonic: cmp
- operand[1].number: 0x6C64746E = "ldtn"
- instruction:
- mnemonic: cmp
- operand[1].number: 0x6C642E6C = "ld.l"
- and:
- description: check system call starting with 'Zw'
- instruction:
- description: check 'Zw'
- mnemonic: cmp
- operand[1].number: 0x775a = "wZ"
- and: # this is optional but this should reduce false positives if any at all
- description: syscall list sorting
- instruction:
- mnemonic: add
- operand[1].number: 1
- mnemonic: lea
- mnemonic: mov
10 changes: 9 additions & 1 deletion nursery/execute-syscall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ rule:
- "@kulinacs"
- "@mr-tz"
- [email protected]
- [email protected]
description: may be used to evade hooks or hinder analysis
scopes:
static: basic block
dynamic: unsupported # requires mnemonic features
references:
- https://github.com/j00ru/windows-syscalls
- https://codemachine.com/articles/system_call_instructions.html
- https://www.felixcloutier.com/x86/sysenter
features:
- or:
- and:
Expand All @@ -20,7 +23,12 @@ rule:
- os: android
- api: syscall # https://man7.org/linux/man-pages/man2/syscall.2.html
- and:
- mnemonic: syscall
- or:
- mnemonic: sysenter
- mnemonic: syscall
- instruction:
- mnemonic: int
- operand[0].number: 0x2e
- or:
- mnemonic: ret
- mnemonic: retn
Loading