Rust-for-Malware-Development

PPID Spoofing

Overview

PPID (Parent Process ID) spoofing is a technique used to make a newly created process appear as if it was spawned by a specified parent process, rather than the actual process creating it.

PoC_Image

This Rust program uses the Windows API to perform PPID spoofing by leveraging InitializeProcThreadAttributeList and UpdateProcThreadAttribute to set a custom parent process handle for a new process.

Requirements

Usage

  1. Compile:
    cargo build --release
    
  2. Run:
    cargo run --release -- <ppid> <commandline>
    
    • <ppid>: The Process ID of the desired parent process (e.g., explorer.exe).
    • <commandline>: The command to execute (e.g., "notepad.exe" or "cmd.exe /c dir").

    Example:

    cargo run --release -- 1234 "notepad.exe"
    
  3. Find a PPID:
    tasklist | findstr explorer
    
  4. Run as Administrator:
    • The program prompts for elevation if not run as admin.
    • Use an elevated Command Prompt or PowerShell.

How It Works

Download

Download this PoC: Download

Credits / Resources