NSX-Threat-Analysis-Unit / CVEX

CVEX is a framework for the reproducible exploitation of CVE vulnerabilities
0 stars 0 forks source link

Agent for strace #23

Closed olegbck closed 1 month ago

olegbck commented 1 month ago

Please create an agent that would run in the background on Linux VMs and attach strace to every instance of the target process. Example:

#!/bin/bash

# Replace this with the name of the program you want to monitor
PROGRAM_NAME="your_program_name"

# Loop until the process starts
while true; do
    # Check if the process is running
    PID=$(pgrep -x "$PROGRAM_NAME")

    if [ -n "$PID" ]; then
        echo "Process $PROGRAM_NAME with PID $PID started. Attaching strace..."
        # Attach strace to the process
        strace -p "$PID" -o /tmp/strace_output_"$PID".txt &
        break
    fi

    # Wait for a short period before checking again
    sleep 1
olegbck commented 1 month ago

Implemented here: https://github.com/NSX-Threat-Analysis-Unit/CVEX/commit/fb7dc10f6b168da3cea8e7948bee6acc2039aea8