Skip to content

feat(rules): detect ReadDirectoryChanges shellcode via callback and APC (#1095)#1143

Closed
sherkhanz wants to merge 1 commit intomandiant:masterfrom
sherkhanz:feat-issue-1095-readdirectorychanges-callback
Closed

feat(rules): detect ReadDirectoryChanges shellcode via callback and APC (#1095)#1143
sherkhanz wants to merge 1 commit intomandiant:masterfrom
sherkhanz:feat-issue-1095-readdirectorychanges-callback

Conversation

@sherkhanz
Copy link
Copy Markdown

This PR resolves #1095.

  • Updated callback rule to include ReadDirectoryChanges.
  • Added a new standalone rule for APC-based execution (targeting the provided PoC).

References

image

Rule validation against the standalone YAML file

image

Validation within the full ruleset context

Fixes #1095

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 15, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

mbc:
- Defense Evasion::Hijack Execution Flow::Abuse Windows Function Calls [F0015.006]
references:
- https://github.com/mandiant/capa-rules/issues/1095
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- https://github.com/mandiant/capa-rules/issues/1095

Comment on lines +22 to +25
- api: ReadDirectoryChangesW
- api: ReadDirectoryChangesA
- api: ReadDirectoryChangesExW
- api: ReadDirectoryChangesExA
Copy link
Copy Markdown
Collaborator

@mike-hunhoff mike-hunhoff Mar 19, 2026

Choose a reason for hiding this comment

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

Please review the rule documentation to understand how capa handles APIs with A/W variants and update accordingly.

Comment on lines +86 to +89
- api: ReadDirectoryChangesA
- api: ReadDirectoryChangesW
- api: ReadDirectoryChangesExA
- api: ReadDirectoryChangesExW
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please review the rule documentation to understand how capa handles APIs with A/W variants and update accordingly.

@mike-hunhoff
Copy link
Copy Markdown
Collaborator

@sherkhanz lints are failing. Please ensure all lints and tests pass locally before requesting another review.

@mike-hunhoff
Copy link
Copy Markdown
Collaborator

Actually, this is a dup of #1140

@sherkhanz
Copy link
Copy Markdown
Author

Thanks for the review and for pointing this out. Understood on the A/W handling, lint requirements, and the duplicate with #1140. I’ll review the rule documentation more carefully and use this in my next contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document shellcode execution via ReadDirectoryChanges

2 participants