How inderpreetsinghips/php2shell-audit works
php2shell_audit is a dependency-free defensive scanner for PHP2Shell version and configuration exposure. Its principal workflow dispatches a codebase, authorized host, or authorized fleet scan; gathers version/configuration signals; classifies risk into findings; and presents a ranked text or JSON report. The README documents the scan capabilities, while the excerpt shows the finding model, version parsing, host-header handling, output functions, and CLI dispatch. Internal details not shown in the partial source are represented only where the README documents them.
Main entry points: php2shell_audit.py Codebase scan
Components 16
Scan workflows
- CLI dispatch
php2shell_audit.py - Codebase scan
php2shell_audit.py - Runtime and config files
php2shell_audit.py - Host scan
php2shell_audit.py - Fleet scan
php2shell_audit.py - Host inventory
php2shell_audit.py
Detection and assessment
- Version fingerprint
php2shell_audit.py - Fixed-version rules
php2shell_audit.py - Config risk checks
php2shell_audit.py
Findings and reports
- Finding model
php2shell_audit.py - Finding ranking
php2shell_audit.py - Text report
php2shell_audit.py - JSON report
php2shell_audit.py
Other components
- Operator
- Web target
- Report destination
Connections 21
- Operator → CLI dispatch: runs
README.md - CLI dispatch → Codebase scan: dispatches
php2shell_audit.py - CLI dispatch → Host scan: dispatches
php2shell_audit.py - CLI dispatch → Fleet scan: dispatches
php2shell_audit.py - Codebase scan → Runtime and config files: scans
README.md - Codebase scan → Version fingerprint: checks pins
README.md - Codebase scan → Config risk checks: checks settings
README.md - Host scan → Web target: requests headers
README.md - Host scan → Version fingerprint: fingerprints
php2shell_audit.py - Fleet scan → Host inventory: reads
README.md - Fleet scan → Host scan: scans hosts
README.md - Version fingerprint → Fixed-version rules: classifies
php2shell_audit.py - Codebase scan → Finding model: produces
README.md - Host scan → Finding model: produces
README.md - Fixed-version rules → Finding model: sets verdict
php2shell_audit.py - Config risk checks → Finding model: adds risks
README.md - Finding model → Finding ranking: sorts
php2shell_audit.py - Finding ranking → Text report: renders
php2shell_audit.py - Finding ranking → JSON report: renders
php2shell_audit.py - Text report → Report destination: writes or prints
README.md - JSON report → Report destination: writes or prints
README.md