Threats Add Upload_Bypass To Your Pentesting Arsenal
Would you like to learn more?
Download our Pentest Sourcing Guide to learn everything you need to know to successfully plan, scope, and execute your penetration testing projects.
Let's be clear, Penetration Testing should not only consist of automated scans. That's not how real world hackers conduct their operations, and therefore, automated scans are not a realistic simulation of a high-risk cyber attack. However, security researchers, ethical hackers, and professional penetration testers can rely on automated tools to help find the "low-hanging fruit" so to speak - basic vulnerabilities and misconfiguration errors. Pentesting tools can significantly reduce workload, remove the need for repetitive work, and check for a wide spectrum of common attack scenarios.
A new tool, Upload_Bypass, provided by Sagiv Michael (sAjibuu), can offer such benefits. This tool is comparable to other tools such as SQLMap for hunting SQL injections or Dirbuster for finding exposed files on a web server. In this article, we shall review the risk posed by unauthorized file upload, especially when dangerous file types can be uploaded and also, review this new tool, Upload_Bypass, and discuss its features and use cases.
CWE-434: Unrestricted Upload of File with Dangerous Type
The Common Weakness Enumeration (CWE) is a community-developed catalog of software and hardware security flaws. Maintained by MITRE, CWE provides a standardized language and framework for known types of flaw in software and hardware. CWE helps developers and security professionals understand common coding and design issues that lead to exploitable conditions.
CWE-434 is the "Unrestricted Upload of File with Dangerous Type". As its name suggests, the flaw occurs when a system allows users to upload files without properly validating their content or file type. This flaw can lead to serious security consequences if an attacker uploads a malicious file, such as a script or executable, which is then processed or executed by the server. CWE-434 is also a Top 25 CWE item, and a Top Hardware CWE item. CWE-434 can be exploited by an adversary to upload a web-shell, rouge configuration file, or malicious script or compiled executable to the target server.
In some cases, once uploaded, the attacker may execute the payload remotely, potentially gaining full control of the system. For example, an attacker might upload a .php file, which, when accessed, can execute arbitrary code on the server. This form of exploitation can lead to Remote Code Execution (RCE), data theft, lateral movement, or the deployment of ransomware.
In other cases, the file may be processed by some internal function. For example, an attacker could upload a malicious configuration file, image with embedded code, or script intended for a background parser or scheduler. If the backend system automatically reads or executes these files—such as a YAML or JSON config file that is interpreted without proper sanitization, or a cron job script stored in a writable directory—the attacker can trigger unauthorized behaviors without direct user interaction.
Several MITRE ATT&CK techniques are relevant to CWE-434-based attacks:
Command and Scripting Interpreter [T1059]: Execution of scripts uploaded via the vulnerability
Server Software Component: Web Shell [T1505.003]: Deployment of web shells to maintain access
Ingress Tool Transfer [T1105]: Uploading tools to the compromised system
Exploitation for Client Execution [T1203]: Triggering the uploaded file for execution
Event-Triggered Execution: Change Default File Association [T1546.001]: Modifying default handlers in configuration so that a file type opens a malicious binary
Upload Bypass - A New Tool for the Automated Pentesting Arsenal
Upload_Bypass is a command-line tool designed to automate the process of evading file upload restrictions during penetration testing. Developed in Python, this tool is especially useful for red teamers, bug bounty hunters, and CTF participants who regularly encounter web applications that may be vulnerable to uploading arbitrary filetypes. The tool eliminates the need for manual trial-and-error by generating a range of modified payloads to probe for weak points in upload filters, similar to how SQLMap supports the automated discovery of SQL Injection [CWE-89] vulnerabilities.
Upload_Bypass supports multiple file extension types (such as .php, .asp, .jsp, and .html), and attack techniques such as smart payload renaming (altering a file's name or extension during uploading to evade file upload filters) and MIME type spoofing (faking its declared type in the Content-Type header of an HTTP request or in the file's "magic bytes" signature). Upload_Bypass can also generate polyglot files (files that can function as multiple formats simultaneously) to sneak malicious code past defensive filters. The tool also uses a variety of modules that can be toggled on or off, including bypass techniques like multiple extension appending (.jpg;.php) and double extensions (shell.jpg.php).
Upload_Bypass also allows users to select a target file to upload, and supports proxy settings for Burp Suite, attack rate limiting, various HTTP methods (e.g., POST, PUT, PATCH), and advanced response analysis including an interactive web-shell.
The basic modes of Upload_Bypass are:
Detection Mode: This mode is intended for use during legitimate penetration testing engagements. It uploads harmless files to the target server without performing any actual exploitation. If the user provides the path where the files are uploaded, the tool checks whether the uploaded file is executed or rendered by the server—for example, verifying that a PHP echo command runs as expected. If it detects successful execution, it will recommend initiating an interactive web-shell.
Exploitation Mode: This mode is used when exploitation is the goal. If the upload directory is known, the tool will attempt to upload an interactive web-shell. The uploaded file is given a randomly generated UUID as its name to make it more difficult for security tools or fuzzers to detect or guess its location.
Anti-Malware Testing Mode: This mode tests for the presence of anti-malware mechanisms on the target system. It uploads an EICAR test file and, if a destination path is specified, checks whether the file remains accessible. If the file has been removed or blocked, it may indicate that anti-malware protections are active.
Using Upload Bypass
Upload_Bypass is designed to streamline the process of testing file upload protections, and it can be invoked with a variety of options depending on your testing objectives. Here are three examples to demonstrate practical use during penetration tests:
1. Basic Detection Scan with Status Code Matching: initiates Detection Mode to safely test if .php file uploads are accepted. It checks for a 200 OK HTTP status to confirm successful uploads, without attempting to execute any payload.
$ python3 Upload_Bypass.py -r request.txt -E php -S 200 -d
2. Upload Web Shell in Exploitation Mode with Upload Path Provided: In this example, the tool runs in Exploitation Mode, targeting .php uploads. It attempts to upload a web shell and uses the provided upload path to verify if the payload lands in an executable location.
$ python3 Upload_Bypass.py -r request.txt -E php -d /var/www/html/uploads -e
3. Test for Anti-Malware Detection Using EICAR File: This command enables Anti-Malware Testing Mode, where the tool uploads an EICAR test file to the specified directory and checks whether it remains accessible—indicating that server-side anti-malware is not intercepting malicious content.
$ python3 Upload_Bypass.py -r request.txt --upload_dir /uploads/malware-tests/ -S 200 -a
Conclusion
Pentesters cannot only rely on automated tools in order to realistically simulate advanced cyber attacks. However, an ethical hackers toolkit needs to be a diverse arsenal to optimize time constraints and conduct more tests faster.
Upload_Bypass is a powerful and flexible Python tool that automates bypassing file upload restrictions, a common vector for remote code execution. With detection, exploitation, and anti-malware testing modes, it helps pentesters uncover dangerous misconfigurations quickly and safely. Ideal for bug bounty hunters and red teamers, it's a practical addition to any offensive security toolkit.
Contact Us
Speak with an Account Executive
Interested in Pentesting?

Penetration Testing Methodology
Our Penetration Security Testing methodology is derived from the SANS Pentest Methodology, the MITRE ATT&CK framework, and the NIST SP800-115 to uncover security gaps.
Download Methodology
Pentest Sourcing Guide
Download our Pentest Sourcing Guide to learn everything you need to know to successfully plan, scope, and execute your penetration testing projects.
Download GuideExplore in-depth resources from our ethical hackers to assist you and your team’s cyber-related decisions.

September 13 - Blog
Why Multi-Factor Authentication is Not Enough
Knowing is half the battle, and the use and abuse of common frameworks shed insight into what defenders need to do to build defense in depth.

November 19 - Blog
The Top Cybersecurity Statistics for 2024
The top cybersecurity statistics for 2024 can help inform your organization's security strategies for 2025 and beyond. Learn more today.

October 24 - Blog
Packetlabs at SecTor 2024
Packetlabs is thrilled to have been a part of SecTor 2024. Learn more about our top takeaway's from this year's Black Hat event.