Giter Site home page Giter Site logo

thewation / cicephpbox Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 7 KB

The command injection sandbox is a tool for testing command injection vulnerabilities in web apps, in a safe environment.

License: MIT License

PHP 81.02% Hack 18.98%
command-injection rce remote-code-execution

cicephpbox's Introduction

Command Injection & Code Execution Sandbox

This project is a sandbox environment that demonstrates the concepts of Command Injection and Remote Code Execution in PHP. It includes several PHP files that showcase different ways in which these vulnerabilities can be exploited.

This application is intended for educational purposes only and should not be used for malicious purposes. It is designed to help developers and security professionals learn about common vulnerabilities and how to protect against them. Users should be aware that executing arbitrary code or commands on a server can be dangerous and can result in security vulnerabilities.

Usage

To use this project, you will need to have Docker installed on your computer.

Open a terminal window and run the following command to pull the Docker image from Docker Hub:

docker pull thewation/cicephpbox:latest

Run the Docker container using the following command:

docker run -p 8000:80 thewation/cicephpbox:latest

This command will start the Docker container and map port 80 of the container to port 8000 of your local machine. You can access the PHP files in the container by opening your web browser and navigating to http://127.0.0.1:8000/.

File Description

/ce/assert.php

This file accepts a name parameter from the query string and uses the assert function somewhere in the code on this input. The file then prints "Hi" to the provided name.

/ce/eval.php

This file accepts a name parameter from the query string and uses the eval function somewhere in the code on this input. The file then prints "Hi" to the provided name.

/ci/cat.php

This file accepts a file parameter from the query string and uses the system function to call the cat command to retrieve the contents of the file. The contents of the file are then printed to the screen.

/ci/ping.php

This file accepts an ip parameter from the query string and uses the system function to call the ping command to ping the target IP. The output of the command is then printed to the screen.

/ci/ping-regex1.php

This file accepts an ip parameter from the query string, verifies the IP structure using a regular expression, and if the IP is valid, uses the system function to call the ping command to ping the target IP. If the IP is invalid, the user is redirected to a /403 page.

/ci/ping-regex2.php

This file accepts an ip parameter from the query string, verifies the IP structure using a regular expression in a more secure way, and if the IP is valid, uses the system function to call the ping command to ping the target IP. If the IP is invalid, the user is redirected to a /403 page.

/ci/ping-regex3.php

This file accepts an ip parameter from the query string, verifies the IP structure using a regular expression in a more secure way, and if the IP is valid, uses the system function to call the ping command to ping the target IP. If the IP is invalid, the user is returned an "Invalid IP Address" message.

/ci/exist.php

This file accepts a file parameter from the query string and uses the system function to call the test binary to check if the file exists or not. If the file exists, the message "The file exists!" is returned, otherwise the message "The file does not exist." is returned.

Usage

To use this sandbox environment, simply download the files and host them on a PHP-enabled server. You can then access the different files through their respective URLs.

Note that these files are intentionally vulnerable and should not be used on a production server or in any situation where security is a concern. They are designed for educational purposes only to demonstrate how command injection and remote code execution vulnerabilities can be exploited.

cicephpbox's People

Contributors

thewation avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.