exploiting-path-traversal-upload

Confirms path traversal and unsafe file upload vulnerabilities via dynamic payload testing against staging targets.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/bs-koo/gx-security --skill exploiting-path-traversal-upload-bs-koo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: exploiting-path-traversal-upload
Source: https://github.com/bs-koo/gx-security/tree/main/skills/exploiting-path-traversal-upload
Command: npx skills add https://github.com/bs-koo/gx-security --skill exploiting-path-traversal-upload-bs-koo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Static scanners flag potential path traversal (CWE-22) and file upload (CWE-434) weaknesses in Spring Boot and JSP applications, but cannot prove they are actually exploitable. This Skill fires real payloads at a running staging or local target to confirm exploitability, eliminating false positives before remediation work begins. ## Core Features & Use Cases - Path Traversal Verification: Injects ../ variants (plain, URL-encoded, double-encoded, backslash, dotslash, null byte) into file parameters and confirms exploitation by detecting known file content signatures (/etc/passwd, web.xml, win.ini) in responses — read-only, non-destructive. - Upload Acceptance Testing: With an explicit --allow-destructive flag, uploads a harmless code-free marker file (.jsp extension containing only a nonce text) to verify whether dangerous extensions are accepted and retrievable from the webroot; never attempts code execution. - Fail-Closed Safety Gate: Every launch passes tools/scope_guard.py, which blocks production and public targets at the code level; credentials are masked in output and undetermined findings route to human confirmation via evidence_expectation cards. - Use Case: After a static scan flags a suspicious filePath parameter in a download endpoint, run this Skill against the local staging server to confirm whether ../../../etc/passwd actually leaks system file contents, then receive a severity-ranked report with the four-element remediation format. ## Quick Start Ask the AI to dynamically confirm path traversal and file upload vulnerabilities on your local staging app, for example: run the path traversal and upload exploit check against http://localhost:8080 using the flagged endpoints from my last scan.

Frequently Asked Questions about exploiting-path-traversal-upload

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I confirm a path traversal vulnerability is exploitable?▼

Point the script at the suspect endpoint with --traversal-target, and it injects ../ variants across multiple depths and encodings. Exploitation is confirmed only when the response body contains a known file signature like root:.*:0:0: from /etc/passwd or <web-app from web.xml.

How do I test if a file upload endpoint accepts dangerous extensions?▼

Use --upload-target with the --allow-destructive flag to upload a harmless .jsp marker file containing only a nonce text string. A 2xx response confirms dangerous extension acceptance; adding --retrieve-base checks whether the file is retrievable from the webroot, which raises severity to High.

Does this penetration testing script work against production servers?▼

No. The tools/scope_guard.py gate runs fail-closed before any request and blocks production, public, and IP-spoofed targets at the code level, exiting with code 1. Only authorized staging and local environments pass the scope check.

Can I test endpoints that require authentication?▼

Yes. Pass a bearer token directly with --token-a, or provide credentials via --user-a-id and --user-a-pw for automatic login. Cookie-based form login is supported with --auth-mode cookie, and secrets can be supplied through environment variables or stdin to avoid process-list exposure.

What happens when upload succeeds but file retrieval cannot be confirmed?▼

The finding is marked undetermined rather than vulnerable, since server-side quarantine, renaming, or scanning may have neutralized it. An evidence_expectation card is emitted so a human can manually query the marker file URL and make the final determination.

Why does a missing path traversal signature not prove the endpoint is safe?▼

Modern runtimes neutralize some variants like null bytes, and network errors can prevent requests from reaching the target. Absence of a signature means dynamically unconfirmed, so the static suspicion remains and the result is honestly reported as blocked or errored rather than safe.