Skip to content

Commit 834cae8

Browse files
committed
Refactor cp
1 parent b6f1947 commit 834cae8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

_gtfobins/cp.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
description: This can be used to copy and then read or write files from a restricted file systems or with elevated privileges.
32
functions:
4-
suid:
3+
file-read:
54
- code: |
5+
LFILE=file_to_read
6+
cp "$LFILE" /dev/stdout
7+
suid:
8+
- description: This can be used to copy and then read or write files from a restricted file systems or with elevated privileges.
9+
code: |
610
LFILE=file_to_write
711
TF=$(mktemp)
812
echo "DATA" > $TF
913
./cp $TF $LFILE
1014
sudo:
11-
- code: |
15+
- description: This can be used to copy and then read or write files from a restricted file systems or with elevated privileges.
16+
code: |
1217
LFILE=file_to_write
1318
TF=$(mktemp)
1419
echo "DATA" > $TF
1520
sudo cp $TF $LFILE
16-
file-read:
17-
- description: It reads data from files, it may be used to do privileged reads or disclose files outside a restricted file system. The path must be absolute.
18-
code: |
19-
LFILE=file_to_read
20-
cp "$LFILE" /dev/stdout
2121
---

0 commit comments

Comments
 (0)