Skip to content

vmray: loosen file checks to enable processing of additional file types - #2571

Merged
mike-hunhoff merged 9 commits into
masterfrom
fix/2403
Jan 23, 2025
Merged

vmray: loosen file checks to enable processing of additional file types#2571
mike-hunhoff merged 9 commits into
masterfrom
fix/2403

Conversation

@mike-hunhoff

@mike-hunhoff mike-hunhoff commented Jan 22, 2025

Copy link
Copy Markdown
Collaborator

closes #2403

This PR addresses two issues:

  1. Loosen file checks to enable processing of additional file types, e.g. PS1 and MSI. We handle this by largely ignoring file and global feature extraction because we care most about the dynamic trace analysis anyways. This accepts that capa's results may be incomplete but still useful.
  2. Handle VMRay analysis archives that may have more than one file marked as the submission, e.g. compound ZIP files. Unfortunately, I have not identified a sure way of differentiating which of the files is the actual submission. Instead, we rely on the ordering of the files and use the last file marked as the submission file. This appears to hold true for compound ZIP files.

@mike-hunhoff
mike-hunhoff marked this pull request as draft January 22, 2025 18:31

@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 January 22, 2025 18:43

CHANGELOG updated or no update needed, thanks! 😄

@mike-hunhoff
mike-hunhoff marked this pull request as ready for review January 22, 2025 20:32
@mike-hunhoff
mike-hunhoff requested a review from a team January 22, 2025 20:32

@williballenthin williballenthin 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.

i think we should add a test case for this setup, because we don't want future code to accidentally start relying on things that might not be present. is this reasonably possible @mike-hunhoff ?

Comment thread CHANGELOG.md
Comment thread capa/features/extractors/vmray/extractor.py Outdated
Comment thread capa/features/extractors/vmray/extractor.py
@mike-hunhoff

mike-hunhoff commented Jan 23, 2025

Copy link
Copy Markdown
Collaborator Author

i think we should add a test case for this setup, because we don't want future code to accidentally start relying on things that might not be present. is this reasonably possible @mike-hunhoff ?

I've added a test in 438d911 for a minimized PowerShell script trace. Because this is PowerShell trace there is no static data so any future code that assumes static data is present should cause this test to fail.

@williballenthin

Copy link
Copy Markdown
Collaborator

send it!

@mike-hunhoff
mike-hunhoff merged commit 160ce73 into master Jan 23, 2025
@mike-hunhoff
mike-hunhoff deleted the fix/2403 branch January 23, 2025 19:47
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.

vmray: Input file is not a valid VMRay analysis archive: VMRay archive does not contain static data (file_type: MSI Setup)

2 participants