Skip to content

dynamic: emit complete features for A/W APIs - #2409

Merged
mr-tz merged 6 commits into
masterfrom
fix/2408
Sep 27, 2024
Merged

dynamic: emit complete features for A/W APIs#2409
mr-tz merged 6 commits into
masterfrom
fix/2408

Conversation

@mike-hunhoff

Copy link
Copy Markdown
Collaborator

closes #2408

This fixes A/W API detection for CAPE, VMRay, and drakvuf where capa rules that specified A/W APIs without the A/W could not be matched e.g. https://github.com/mandiant/capa-rules/blob/627395d6f19dc76894bbf7d365d28d083fab67cf/lib/create-or-open-registry-key.yml#L4

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed

@github-actions
github-actions Bot dismissed their stale review September 26, 2024 20:43

CHANGELOG updated or no update needed, thanks! 😄

@mike-hunhoff mike-hunhoff changed the title dynamic: fix A/W API detection for all dynamic extractors dynamic: emit complete features for A/W APIs Sep 26, 2024

@yelhamer yelhamer left a comment

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.

Awesome. LGTM!

assert_never(value)

yield API(call.api), ch.address
for name in capa.features.extractors.helpers.generate_symbols("", call.api):

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.

we should update this API to accept None when the dll isn't present, not the empty string. But that can happen in another PR.

("0000a657", "process=(1180:3052)", capa.features.common.String("nope"), False),
# thread/api calls
("0000a657", "process=(2900:2852),thread=2904", capa.features.insn.API("RegQueryValueExA"), True),
("0000a657", "process=(2900:2852),thread=2904", capa.features.insn.API("RegQueryValueEx"), True),

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.

perfect, thanks for adding tests

@mr-tz
mr-tz merged commit 00d2bb0 into master Sep 27, 2024
@mr-tz
mr-tz deleted the fix/2408 branch September 27, 2024 09:26
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.

dynamic: complete features not emitted for A/W APIs

4 participants