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

improve debug detection features #721

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ rule:
- al-khaser_x86.exe_:0x420000
features:
- or:
# We're not including kernel32.IsDebuggerPresent here because some exception handlers and other compiler-inserted
# code may add calls to it, especially in debug builds. So, likely even with pretty good library code detection
# this feature could result in many false positives.
Comment on lines +18 to +20
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

- api: kernel32.CheckRemoteDebuggerPresent
- api: WUDFPlatform.WudfIsAnyDebuggerPresent
- api: WUDFPlatform.WudfIsKernelDebuggerPresent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ rule:
features:
- and:
- number: 0x5 = SYSTEM_PROCESS_INFORMATION
- api: NtQuerySystemInformation
- or:
- api: NtQuerySystemInformation
- api: NtQuerySystemInformationEx
- api: ZwQuerySystemInformation
- api: ZwQuerySystemInformationEx
Comment on lines +17 to +20
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #720

8 changes: 6 additions & 2 deletions nursery/check-for-process-debug-object.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ rule:
- https://github.com/LordNoteworthy/al-khaser/blob/master/al-khaser/AntiDebug/NtQueryInformationProcess_ProcessDebugObject.cpp
features:
- and:
- api: kernel32.GetCurrentProcess
- or:
- api: kernel32.GetCurrentProcess
- api: System.Diagnostics.Process::GetCurrentProcess
- basic block:
- and:
- api: NtQueryInformationProcess
- or:
- api: NtQueryInformationProcess
- api: ZwQueryInformationProcess
- number: 0x1E = ProcessDebugObjectHandle
8 changes: 6 additions & 2 deletions nursery/check-systemkerneldebuggerinformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ rule:
- [email protected]
scope: basic block
mbc:
- Anti-Behavioral Analysis::Debugger Detection::NtQueryInformationProcess [B0001.012]
- Anti-Behavioral Analysis::Debugger Detection [B0001]
references:
- https://github.com/LordNoteworthy/al-khaser/blob/master/al-khaser/AntiDebug/NtQuerySystemInformation_SystemKernelDebuggerInformation.cpp
features:
- and:
- api: NtQueryInformationProcess
- or:
- api: NtQuerySystemInformation
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix: ...SystemInformation (see al-khaser and Anti-DebugNet source)

- api: NtQuerySystemInformationEx
- api: ZwQuerySystemInformation
- api: ZwQuerySystemInformationEx
- number: 0x23 = SystemKernelDebuggerInformation