reduce false positives in credential manager, credit-card parsing, an…#1123
reduce false positives in credential manager, credit-card parsing, an…#1123akshat4703 wants to merge 3 commits intomandiant:masterfrom
Conversation
|
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. |
…card parsing, and PE section enumeration reduce false positives in credential manager, credit-card parsing, and PE section enumeration#
1c6ba00 to
8f85ff8
Compare
|
@akshat4703 i'm not comfortable considering these changes without references/test files that show this behavior works better than what we had before. please try to find some cases and help demonstrate how this PR improves the situation. |
|
Thank you for the feedback — I’ve incorporated the suggestions. Updates:
Key Improvements (Validated Locally)
|
Summary
This PR reduces false positives across three capa rules while preserving existing positive detections.
The changes tighten matching logic and add structural gating to better distinguish malicious behavior from benign patterns.
Issues
Closes #1030
Closes #1088
Closes #897
Closes #1090
Changes
1. Tighten
vaultcmdmatchingRule:
collection/acquire-credentials-from-windows-credential-manager.ymlChange:
string: /vaultcmd(\.exe)?/string: /\bvaultcmd(\.exe)?\b/iRationale:
Adds word-boundary anchoring to prevent substring false positives (e.g.,
security-vaultcmd_...) while maintaining case-insensitive matching.2. Strengthen credit card sentinel logic
Rule:
collection/credit-card/parse-credit-card-information.ymlChange:
'^'or';') plus two or more additional credit-card sentinels.Rationale:
Reduces delimiter-only matches and prevents generic pattern false positives (including the mimikatz case) while preserving valid track-style detections.
3. Add PE-header structural gate
Rule:
load-code/pe/enumerate-pe-sections.ymlChange:
match: parse PE headerRationale:
Ensures section-offset logic only applies to confirmed PE files, reducing struct-pattern false positives (including the mimikatz case).
Validation
Formatting
capafmt.pyLinting
lint.py --thoroughPositive Coverage Retained
acquire credentials from Windows Credential Managerparse credit card informationenumerate PE sectionsAll previously matching test samples continue to match.
False Positive Improvements
parse credit card informationno longer matchesmimikatz.exeenumerate PE sectionsno longer matchesmimikatz.exePlease let me know if you'd prefer alternative gating logic or additional sample coverage.