Press enter or click to view image in full size
As an attacker or a security professional, a file upload endpoint is a prime target. It’s an opportunity to inject malicious code directly onto the server, often within the webroot. Let’s delve into how these vulnerabilities are found, exploited, and ultimately, how to defend against them.
Step 1: Reconnaissance — Knowing Your Target Framework
Before even thinking about what file to upload, the first crucial step is to understand the server’s environment, specifically the web framework it’s built on. The malicious file you want to upload (your “webshell”) needs to be executable by the server, which means it must be written in a language the server understands and is configured to execute.
How to Identify the Framework:
- URL Path Probing: Try appending common file extensions to generic paths or known filenames. For instance, navigate to
/index.php
,/default.asp
,/home.aspx
, etc. If any of these resolve to a page, it strongly indicates the underlying technology. - Web Extensions Wordlist: Tools like Burp Suite’s Intruder can be used with a wordlist of common web extensions (from SecLists, for example) to automate this probing against various directory paths.