๐ PHP Web Shells
๐ Overview
PHP (Hypertext Preprocessor) is the most widely used server-side language (78.6% of web servers).
PHP processes requests like login forms server-side (e.g.,
login.php
on rConfig).PHP web shells exploit file upload vulnerabilities to achieve remote command execution or reverse shells.
๐งช Hands-On: Gaining a PHP Web Shell (rConfig v3.9.6)
๐ง Objective
Upload a malicious PHP file disguised as an image to exploit rConfig's file upload mechanism, then use it as a browser-accessible shell.
โ
Step 1: Access rConfig and Navigate to Vendor Upload
Login to rConfig
Credentials:
admin:admin

Navigate to:
Devices > Vendors > Add Vendor

Choose File Upload for "Vendor Logo".
โ
Step 2: Prepare Your PHP Web Shell
๐ Tool used: WhiteWinterWolf's PHP Web Shell

๐ก Either download or paste the code into a file:
nano connect.php
๐งผ Best practice:
Remove author comments and ASCII art to avoid detection by AV.
Bypassing Filetype:
โ
Step 3: Launch Burp Suite and Intercept the Upload
Open Burp Suite
Set browser proxy settings:
IP:
127.0.0.1
Port:
8080

Intercept HTTP traffic.

Go back to rConfig, click โBrowseโ and select
connect.php
, then click โSave.โ


โ
Step 4: Modify the Intercepted POST Request in Burp

Once the POST request containing the file upload is intercepted:
Change:
Content-Type: application/x-php
To:
Content-Type: image/gif

๐ This bypasses rConfigโs image file-type filter.
Click โForwardโ twice in Burp Suite to submit the request.
โ
Step 5: Confirm File Upload Was Successful
Look for:
Message: Added new vendor NetVen to Database
๐ผ๏ธ If the file type wasn't recognized, it may display a generic image icon โ thatโs okay.

โ
Step 6: Access the Web Shell
Navigate to or right click on the newly added image
http://<rConfig-IP>/images/vendor/connect.php

๐ง You now have a web shell interface that lets you run system commands via the browser.
๐ Commands entered here execute on the underlying Linux OS.
๐ Additional Notes
This shell is non-interactive (no TTY).
Useful for:
Enumeration
Dropping reverse shells
Uploading more payloads
Last updated