Skip to content

Commit

Permalink
fix scopes for rules with subscopes
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tz committed Oct 26, 2023
1 parent ae84430 commit 409da0b
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: unspecified # TODO upgrade manually, contains subscope
dynamic: thread
mbc:
- Anti-Behavioral Analysis::Debugger Detection::SetHandleInformation [B0001.024]
references:
Expand All @@ -15,8 +15,13 @@ rule:
- al-khaser_x86.exe_:0x430D20
features:
- and:
- basic block:
- and:
- count(number(2)): 2 or more
- api: SetHandleInformation
- or:
- basic block:
- and:
- count(number(2)): 2 or more
- api: SetHandleInformation
- call:
- and:
- count(number(2)): 2 or more
- api: SetHandleInformation
- api: CloseHandle
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,33 @@ rule:
- [email protected]
scopes:
static: function
dynamic: unspecified # TODO upgrade manually, contains subscope
dynamic: thread
mbc:
- Anti-Behavioral Analysis::Debugger Detection [B0001]
references:
- https://github.com/LordNoteworthy/al-khaser/blob/master/al-khaser/AntiDebug/ProcessJob.cpp
examples:
- al-khaser_x86.exe_:0x426730
features:
- and:
- match: contain loop
- basic block:
- and:
- api: kernel32.QueryInformationJobObject
- number: 0x3 = JobObjectBasicProcessIdList
- basic block:
- and:
- api: kernel32.OpenProcess
- number: 0x400 = PROCESS_QUERY_INFORMATION
- or:
# static
- and:
- match: contain loop
- basic block:
- and:
- api: kernel32.QueryInformationJobObject
- number: 0x3 = JobObjectBasicProcessIdList
- basic block:
- and:
- api: kernel32.OpenProcess
- number: 0x400 = PROCESS_QUERY_INFORMATION
# dynamic
- and:
- call:
- and:
- api: kernel32.QueryInformationJobObject
- number: 0x3 = JobObjectBasicProcessIdList
- call:
- and:
- api: kernel32.OpenProcess
- number: 0x400 = PROCESS_QUERY_INFORMATION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: unspecified # TODO upgrade manually, contains subscope
dynamic: thread
att&ck:
- Defense Evasion::Debugger Evasion [T1622]
mbc:
Expand All @@ -26,6 +26,12 @@ rule:
- api: NtSetInformationThread
- api: ZwSetInformationThread
- number: 0x11 = ThreadHideFromDebugger
- call:
- and:
- or:
- api: NtSetInformationThread
- api: ZwSetInformationThread
- number: 0x11 = ThreadHideFromDebugger
- and:
- or:
- string: "NtSetInformationThread"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: unspecified # TODO upgrade manually, contains subscope
dynamic: thread
att&ck:
- Defense Evasion::Indicator Removal::Clear Windows Event Logs [T1070.001]
examples:
Expand All @@ -26,3 +26,6 @@ rule:
- basic block:
- and:
- string: /wevtutil(\.exe)?\s+(clear-log|cl)/i
- call:
- and:
- string: /wevtutil(\.exe)?\s+(clear-log|cl)/i
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- "@_re_fox"
scopes:
static: function
dynamic: unspecified # TODO upgrade manually, contains subscope
dynamic: thread
att&ck:
- Defense Evasion::Virtualization/Sandbox Evasion::System Checks [T1497.001]
mbc:
Expand All @@ -17,10 +17,19 @@ rule:
- 773290480d5445f11d3dc1b800728966:0x140001140
features:
- and:
# static
- basic block:
- and:
- api: SLIsGenuineLocal
- basic block:
- and:
- api: UuidFromString
- string: "55c92734-d682-4d71-983e-d6ec3f16059f"
# dynamic
- call:
- and:
- api: SLIsGenuineLocal
- call:
- and:
- api: UuidFromString
- string: "55c92734-d682-4d71-983e-d6ec3f16059f"
5 changes: 4 additions & 1 deletion collection/screenshot/capture-screenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: unspecified # TODO upgrade manually, contains subscope
dynamic: thread
att&ck:
- Collection::Screen Capture [T1113]
mbc:
Expand Down Expand Up @@ -39,4 +39,7 @@ rule:
- and:
- api: BitBlt
- characteristic: tight loop
- call:
- and:
- api: BitBlt
- api: System.Drawing.Graphics::CopyFromScreen

0 comments on commit 409da0b

Please sign in to comment.