feat: strengthen spoof parent PID rule with full PPID spoofing flow - #1167
feat: strengthen spoof parent PID rule with full PPID spoofing flow#1167itxsamad1 wants to merge 4 commits into
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. |
|
please provide a test sample that demonstrates this behavior |
Point the rule example at the minimal test binary that demonstrates the full PPID spoofing API flow matched by the strengthened rule.
|
Hi @williballenthin — added a minimal test sample that demonstrates the full PPID spoofing flow matched by this rule. Test sample
The PoC is a small C program that:
capa v9.4.0 verificationATT&CK: Defense Evasion::Access Token Manipulation::Parent PID Spoofing [T1134.004] The rule examples field has been updated to |
Add capa-testfiles sample 6538c46d... at function 0x140001450 that matches the strengthened rule.
|
Thanks @williballenthin — added a minimal test sample that demonstrates the full PPID spoofing flow. Test sample
The sample is a small C PoC that calls:
capa verification (v9.4.0)Verbose output shows the match at Updated |
Replace placeholder example with capa-tested hash and function offset from minimal PPID spoof test binary (PR mandiant#1167).
Test sample demonstrating full PPID spoof flowPer @williballenthin request, here is a minimal Windows PE that exercises the complete parent-PID spoofing API sequence in one function (spoof_parent_and_spawn @ 0x140001760):
capa-testfiles PRSample uploaded in: mandiant/capa-testfiles#315 capa verification (capa v9.4.0)The PoC uses InitializeProcThreadAttributeList, UpdateProcThreadAttribute with PROC_THREAD_ATTRIBUTE_PARENT_PROCESS (0x20000), and CreateProcessW with EXTENDED_STARTUPINFO_PRESENT (spawns notepad.exe suspended with explorer.exe as spoofed parent, then terminates the child). capa-rules updatespoof-parent-pid.yml examples updated on branch enhance/spoof-parent-pid-detection with the verified hash/offset above. python scripts/lint.py --thorough -t "spoof parent PID" passes with the sample. Related: #1145 |
|
@itxsamad1 please explain why these changes are needed to strengthen the rule. Do you have examples of false positives? |
Summary
Fixes #1145
Test plan