Skip to content

Commit

Permalink
Add SysWhisper2 detection & add int 2e to syscall detection
Browse files Browse the repository at this point in the history
Signed-off-by: Still Hsu <dev@stillu.cc>
  • Loading branch information
Still34 committed Mar 12, 2024
1 parent ec36656 commit a5f7657
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nursery/execute-syscall-instruction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ rule:
authors:
- "@kulinacs"
- "@mr-tz"
- still@teamt5.org
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
features:
- and:
- mnemonic: syscall
- or:
- mnemonic: syscall
- instruction:
- mnemonic: int
- operand[0].number: 0x2e
- or:
- mnemonic: ret
- mnemonic: retn
44 changes: 44 additions & 0 deletions nursery/populate-syswhisper2-syscall-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
rule:
meta:
name: populate syswhisper2 syscall list
namespace: linking/runtime-linking
authors:
- still@teamt5.org
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:
- mnemonic: or
- operand[1].number: 0x20202020
- or:
- instruction:
- mnemonic: cmp
- operand[1].number: 0x6C64746E
- instruction:
- mnemonic: cmp
- operand[1].number: 0x6C642E6C
- and:
- description: check system call starting with 'Zw'
- instruction:
- description: check 'Zw'
- mnemonic: cmp
- operand[1].number: 0x775a
- 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

0 comments on commit a5f7657

Please sign in to comment.