A dockerized PHP application containing some file upload vulnerability challenges (scenarios)

Overview

File Upload Vulnerability Scenarios (Challenges)

This repository is a dockerized PHP application containing some file upload vulnerability challenges (scenarios).

OWASP References:

  • Classification: Web Application Security Testing > 10-Business Logic Testing
  • WSTG: WSTG-BUSL-09

Bypass Techniques

The ideas behind challenges are:

  • Bypassing client-side file extension validations.
  • Bypassing client-side file size validations.
  • Injecting PHP code into a gif file
  • Run any extensions with the PHP engine (using .htaccess file)
  • Black-list extension validation bypass
  • White-list extension validation bypass
  • Double extension bypass
  • Server-side file size validation bypass
  • Server-side file extension validation bypass
  • Content-type validation bypass of file upload
  • Finding renamed file names and locations after upload process
  • Removing force download (using "Content-Disposition" header) to run the php file by use of htaccess

Quick Start Using Docker

Using docker hub (Quickest):

  1. To access the challenges, you need docker installed.
  2. Run this command to pull and run the image from docker hub:
    sudo docker run -d -p 9001:80 moeinfatehi/file_upload_vulnerabilities
  3. Access the challenges with this URL: http://localhost:9001

Using docker-compose:

  1. To access the challenges, you need docker and docker-compose installed.
  2. Clone the repository
    git clone https://github.com/moeinfatehi/file_upload_vulnerability_scenarios.git
  3. Open the main directory of the project (where docker-compose.yml file exists) and run: docker-compose up
  4. Access the challenges with this URL: http://localhost:9001

Attention

  • Do not host these challenges without docker on your main operating system and web server, because any of these challenges are critically dangerous ones, if any hacker can access these challenges on your host webserver, your main OS can be attacked in different ways.
  • Using docker-compose which is described above will not have these type of impacts.

Disclaimer

This project is for educational purposes ONLY. The usual disclaimer applies, especially the fact that I'm not liable for any damages caused by the direct or indirect use of the information or functionality provided by these programs. The author or any Internet provider bears NO responsibility for content or misuse of these programs or any derivatives thereof. By using these projects you accept the fact that any damage (data loss, system crash, system compromise, etc.) caused by the use of this program is not my responsibility.

Hack And Have Fun!

If you have any further questions, please don't hesitate to contact me via my twitter account.

You might also like...
This is a small piece of code to steal firefox's cookies and upload to server (Written in VBA)
This is a small piece of code to steal firefox's cookies and upload to server (Written in VBA)

Steal-firefox-cookies-VBA-macro This is a small piece of code to steal firefox's cookies and upload to server (Written in VBA) Please note For educati

PHP exercises from my course at ETEC and some of my own play-around with PHP

etec-php-exercises PHP exercises from my course at ETEC and some of my own play-around with PHP Translations: Português (BR) Projects Project Descript

PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects.

📢 Yell PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects. Requirement

Cheatsheet for some Php knowledge you will frequently encounter in modern projects.
Cheatsheet for some Php knowledge you will frequently encounter in modern projects.

Cheatsheet for some Php knowledge you will frequently encounter in modern projects.

the repository uses some of the code from php-meminfo to simplify integration

the repository uses some of the code from php-meminfo to simplify integration

Some exercises to practice whiteboard interview questions in PHP.
Some exercises to practice whiteboard interview questions in PHP.

PHP Interview Exercises · A number of exercises to practice whiteboard interview questions in PHP. Inside exercises directory, you can find folders co

Small library providing some functional programming tools for PHP, based on Rambda

Functional library for PHP. Features: set of useful functions helpful in functional programming all functions are automatically curried every array ca

This project backports features found in the latest PHP versions and provides compatibility layers for some extensions and functions

This project backports features found in the latest PHP versions and provides compatibility layers for some extensions and functions. It is intended to be used when portability across PHP versions and extensions is desired.

Examples of some common design patterns implemented in php

What is a Design Pattern? Design patterns are typical solutions to common problems in software design. Each pattern is like a blueprint that you can c

Owner
Moein Fatehi
award‑winning application security specialist · blockchain security researcher
Moein Fatehi
File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery

File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.

Sebastian Tschan 31.1k Dec 30, 2022
Public solutions and challenges from sinf ctf 2021

SINFCTF2021 CTF Challenges (and official solutions) created for SINFCTF2021, a companion CTF for Semana de Informática 2021. There's a folder for each

NIAEFEUP 5 Sep 30, 2022
Repository containing all the PHPStan rules from the book "Recipes for Decoupling"

PHPStan rules from the book "Recipes for Decoupling" by Matthias Noback In the book "Recipes for Decoupling" we discuss how to decouple from web and C

Matthias Noback 19 Sep 21, 2022
Application with SQL Injection vulnerability and possible privilege escalation

Application with SQL Injection vulnerability and possible privilege escalation. Free vulnerable app for ethical hacking / penetration testing training.

Filip Karczewski 56 Nov 18, 2022
A dockerized magento 2 community environment ready for development or production.

Painless Magento 2 & 1 A dockerized magento 2 community environment ready for development or production. It supports magento 1.9.x for development Ins

Cocoa Web Studio 10 Apr 23, 2022
Fully covered with tests, documented by Swagger and dockerized API based on enterprise-level framework with optional queue worker.

symfony-api Fully covered with tests, documented by Swagger and dockerized API based on enterprise-level framework with optional queue worker. ⚙️ Depl

Oleksii Velychko 1 Nov 20, 2022
Major Security Vulnerability on PrestaShop Websites - CVE-2022-31101

Fix Major Security Vulnerability on PrestaShop Websites ?? CVE-2022-31101 detector and fixer! A newly found exploit could allow remote attackers to ta

Mathias Reker ⚡️ 25 Nov 22, 2022
Upload attachments to content storage platform like Aliyun OSS, Tencent COS

Overview Yun storage provides a layer that mediates between a user or configured storage frontend and one or several storage backends. Note: jichangfe

Changfeng Ji 2 Oct 13, 2021
Add information about PGP public keys on upload in Kirby v3

Kirby3 GnuPG This plugin adds information about PGP public keys on upload, using gpg binary (which needs to be installed for this to work). Getting st

Fundevogel 2 Oct 11, 2021
I create this code to upload CSV in database in packets of 100.

PHP-CSV-Upload I create this code to upload CSV in the database in packets of 100 elements in one for loop. Hi, This is Anmol Singh. To reach our Goal

Anmol Singh 2 Feb 12, 2022