Follow every thread: catch exploits that fire from worker threads#2
Merged
Conversation
Wraith previously traced only the main thread — it waited on a single pid and never set PTRACE_O_TRACECLONE — so any syscall issued from a thread the target spawned was invisible. For a sensor aimed at network daemons, request handlers, and fuzz harnesses (almost always multithreaded), that was the biggest real blind spot and the stated next milestone. The tracer now follows every clone/fork/vfork and reaps the whole tree with waitpid(-1). Each thread keeps its own syscall entry/exit phase, while threads that share an address space (same thread-group id) share one cached memory map and one exploitation-chain accumulator — so a payload staged on one thread and fired from another is still correlated into a single verdict, and distinct processes keep distinct state. New tracees are registered lazily on their first stop, which sidesteps the parent/child wait-ordering race. - detect.rs: chain state is now per-process (keyed by tgid) instead of a single accumulator, so cross-thread staging correlates and separate processes don't bleed evidence together. - tracer.rs: PTRACE_O_TRACECLONE/FORK/VFORK, waitpid(-1) reap loop, per-thread state, per-address-space map cache with cross-thread dirtying. - New targets: benign-threads (multithreaded false-positive control) and mt-shellcode-sim (payload detonated from a worker thread). - Two end-to-end tests cover both; the e2e suite serializes through a lock since two ptrace engines can't share one process. - README, demo.sh, and roadmap updated to reflect thread-following. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WS9djsh9BpTKXGgYBJET5u
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wraith previously traced only the main thread — it waited on a single pid
and never set PTRACE_O_TRACECLONE — so any syscall issued from a thread the
target spawned was invisible. For a sensor aimed at network daemons, request
handlers, and fuzz harnesses (almost always multithreaded), that was the
biggest real blind spot and the stated next milestone.
The tracer now follows every clone/fork/vfork and reaps the whole tree with
waitpid(-1). Each thread keeps its own syscall entry/exit phase, while threads
that share an address space (same thread-group id) share one cached memory map
and one exploitation-chain accumulator — so a payload staged on one thread and
fired from another is still correlated into a single verdict, and distinct
processes keep distinct state. New tracees are registered lazily on their first
stop, which sidesteps the parent/child wait-ordering race.
accumulator, so cross-thread staging correlates and separate processes don't
bleed evidence together.
state, per-address-space map cache with cross-thread dirtying.
mt-shellcode-sim (payload detonated from a worker thread).
since two ptrace engines can't share one process.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01WS9djsh9BpTKXGgYBJET5u