diff --git a/.gitignore b/.gitignore index d437588..27ee96f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ */* bin/* !*/install -!*/install-root +!*/uninstall +!*/install-root-* !*/upgrade !*/test diff --git a/Dockerfile b/Dockerfile index 5edfec5..a93248d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,11 @@ from ubuntu:trusty maintainer yans@yancomm.net -RUN adduser ctf +RUN apt-get update && apt-get install -y build-essential libtool g++ gcc \ + texinfo curl wget automake autoconf python python-dev git subversion \ + unzip virtualenvwrapper + +RUN useradd -m ctf COPY .git /home/ctf/tools/.git RUN chown -R ctf.ctf /home/ctf/tools @@ -14,9 +18,7 @@ USER ctf WORKDIR /home/ctf/tools RUN git checkout . RUN bin/manage-tools -s setup +RUN echo "workon ctftools" >> /home/ctf/.bashrc WORKDIR /home/ctf -RUN bash -c "source /etc/bash_completion.d/virtualenvwrapper && mkvirtualenv ctf" -RUN echo "workon ctf" >> /home/ctf/.bashrc - ENTRYPOINT bash -i diff --git a/Dockerfile.archlinux b/Dockerfile.archlinux new file mode 100644 index 0000000..f364ae0 --- /dev/null +++ b/Dockerfile.archlinux @@ -0,0 +1,42 @@ +from base/archlinux + +RUN echo 'Server = http://mirror1.htu.tugraz.at/archlinux/$repo/os/$arch' \ + > /etc/pacman.d/mirrorlist +RUN echo "[multilib]" >> /etc/pacman.conf +RUN echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf + +RUN pacman -Syy \ + && pacman -S --noconfirm archlinux-keyring \ + && pacman -Scc --noconfirm +RUN pacman-key --refresh-keys +RUN pacman -Syu --noconfirm \ + && pacman-db-upgrade \ + && pacman -Scc --noconfirm \ + && pacman -Syu --noconfirm \ + && pacman -Scc --noconfirm +RUN trust extract-compat +RUN pacman -Syu --noconfirm --needed \ + curl wget python2 python3 git subversion \ + python2-pip python-pip \ + unzip python-virtualenvwrapper \ + zsh grml-zsh-config \ + sudo \ + && pacman -Scc --noconfirm + +RUN useradd -m ctf +RUN echo "ctf ALL=NOPASSWD: ALL" > /etc/sudoers.d/ctf +RUN chsh -s /usr/bin/zsh ctf + +COPY .git /home/ctf/tools/.git +RUN chown -R ctf.ctf /home/ctf/tools + +USER ctf + +WORKDIR /home/ctf/tools +RUN git checkout . +RUN bin/manage-tools -s setup +RUN echo 'source $(which virtualenvwrapper.sh)' >> ~/.zshrc +RUN echo 'workon ctftools' >> ~/.zshrc + +WORKDIR /home/ctf +CMD ["zsh", "-i"] diff --git a/README.md b/README.md index 8defa8b..08ef4fa 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Installers for the following tools are included: | binary | [angr](http://angr.io) | Next-generation binary analysis engine from Shellphish. | | binary | [barf](https://github.com/programa-stic/barf-project) | Binary Analysis and Reverse-engineering Framework. | | binary | [bindead](https://bitbucket.org/mihaila/bindead/wiki/Home) | A static analysis tool for binaries. | +| binary | [binjitsu](https://github.com/binjitsu/binjitsu) | Useful CTF utilities. pwntools fork. | | binary | [checksec](https://github.com/slimm609/checksec.sh) | Check binary hardening settings. | | binary | [codereason](https://github.com/trailofbits/codereason) | Semantic Binary Code Analysis Framework. | | binary | [crosstool-ng](http://crosstool-ng.org/) | Cross-compilers and cross-architecture tools. | @@ -21,11 +22,13 @@ Installers for the following tools are included: | binary | [elfparser](http://www.elfparser.com/) | Quickly determine the capabilities of an ELF binary through static analysis. | | binary | [evilize](http://www.mathstat.dal.ca/~selinger/md5collision/) | Tool to create MD5 colliding binaries | | binary | [gdb](http://www.gnu.org/software/gdb/) | Up-to-date gdb with python2 bindings. | +| binary | [gef](https://github.com/hugsy/gef) | Enhanced environment for gdb. | | binary | [hongfuzz](https://github.com/google/honggfuzz) | A general-purpose, easy-to-use fuzzer with interesting analysis options. | | binary | [panda](https://github.com/moyix/panda) | Platform for Architecture-Neutral Dynamic Analysis. | | binary | [pathgrind](https://github.com/codelion/pathgrind) | Path-based, symbolically-assisted fuzzer. | | binary | [peda](https://github.com/longld/peda) | Enhanced environment for gdb. | | binary | [preeny](https://github.com/zardus/preeny) | A collection of helpful preloads (compiled for many architectures!). | +| binary | [pwndbg](https://github.com/zachriggle/pwndbg) | Enhanced environment for gdb. Especially for pwning. | | binary | [pwntools](https://github.com/Gallopsled/pwntools) | Useful CTF utilities. | | binary | [python-pin](https://github.com/blankwall/Python_Pin) | Python bindings for pin. | | binary | [qemu](http://qemu.org) | Latest version of qemu! | @@ -67,7 +70,8 @@ Installers for the following tools are included: | web | [burpsuite](http://portswigger.net/burp) | Web proxy to do naughty web stuff. | | web | [commix](https://github.com/stasinopoulos/commix) | Command injection and exploitation tool. | | web | [dirb](http://dirb.sourceforge.net/) | Web path scanner. | -| web | [dirs3arch](https://github.com/maurosoria/dirs3arch) | Web path scanner. | +| web | [dirsearch](https://github.com/maurosoria/dirsearch) | Web path scanner. | +| web | [mitmproxy](https://mitmproxy.org/) | CLI Web proxy and python library. | | web | [sqlmap](http://sqlmap.org/) | SQL injection automation engine. | | web | [subbrute](https://github.com/TheRook/subbrute) | A DNS meta-query spider that enumerates DNS records, and subdomains. | | stego | [sound-visualizer](http://www.sonicvisualiser.org/) | Audio file visualization. | @@ -114,7 +118,10 @@ manage-tools search preload ``` Where possible, the tools keep the installs very self-contained (i.e., in to tool/ directory), and most uninstalls are just calls to `git clean` (**NOTE**, this is **NOT** careful; everything under the tool directory, including whatever you were working on, is blown away during an uninstall). -To support python dependencies, however, make sure to create a virtualenv before installing and using tools (i.e., `mkvirtualenv --system-site-packages ctf`. The `--system-site-packages` is there for easier reuse of apt-gotten python packages where necessary). +One exception to this are python tools, which are installed using the `pip` +package manager if possible. A `ctftools` virtualenv is created during the +`manage-tools setup` command and can be accessed using the command +`workon ctftools`. ## Help! diff --git a/afl/install b/afl/install index db521f7..dd5832d 100755 --- a/afl/install +++ b/afl/install @@ -9,6 +9,11 @@ mv afl-* afl cd afl make -j $(nproc) cd qemu_mode +# try to detect if python2 and 3 are installed +if which python2 >/dev/null; then + sed -i 's/python/python2/' ./build_qemu_support.sh + sed -i 's!configure!configure --python=\$(which python2)!' ./build_qemu_support.sh +fi ./build_qemu_support.sh cd ../../ diff --git a/afl/install-root-archlinux b/afl/install-root-archlinux new file mode 100755 index 0000000..41ce76f --- /dev/null +++ b/afl/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed bison qemu diff --git a/afl/install-root b/afl/install-root-debian similarity index 61% rename from afl/install-root rename to afl/install-root-debian index 82fb914..8ecb18e 100755 --- a/afl/install-root +++ b/afl/install-root-debian @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail apt-get -y build-dep qemu apt-get -y install bison diff --git a/android-sdk/install-root-archlinux b/android-sdk/install-root-archlinux new file mode 100755 index 0000000..72ef27d --- /dev/null +++ b/android-sdk/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed jre7-openjdk jdk7-openjdk diff --git a/android-sdk/install-root b/android-sdk/install-root-debian similarity index 58% rename from android-sdk/install-root rename to android-sdk/install-root-debian index 543a914..e7ef4c5 100755 --- a/android-sdk/install-root +++ b/android-sdk/install-root-debian @@ -1 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + apt-get -y install openjdk-7-jre openjdk-7-jdk diff --git a/angr/install-root b/angr/install-root-debian similarity index 90% rename from angr/install-root rename to angr/install-root-debian index f7ac0b6..9282191 100755 --- a/angr/install-root +++ b/angr/install-root-debian @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail # for angr apt-get -y install virtualenvwrapper python2.7-dev build-essential libxml2-dev libxslt1-dev git libffi-dev cmake libreadline-dev libtool debootstrap debian-archive-keyring libglib2.0-dev libpixman-1-dev diff --git a/apktool/install-root b/apktool/install-root deleted file mode 100644 index ee9ef42..0000000 --- a/apktool/install-root +++ /dev/null @@ -1,2 +0,0 @@ -apt-get update -apt-get install -y default-jre diff --git a/apktool/install-root-archlinux b/apktool/install-root-archlinux new file mode 100644 index 0000000..07e5ef1 --- /dev/null +++ b/apktool/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed jre8-openjdk diff --git a/apktool/install-root-debian b/apktool/install-root-debian new file mode 100755 index 0000000..a37d5e1 --- /dev/null +++ b/apktool/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get install -y default-jre diff --git a/barf/install-root b/barf/install-root-debian similarity index 73% rename from barf/install-root rename to barf/install-root-debian index ee4aee2..6696d43 100755 --- a/barf/install-root +++ b/barf/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail apt-get -y install binutils-multiarch-dev diff --git a/beef/install b/beef/install new file mode 100755 index 0000000..acd7f52 --- /dev/null +++ b/beef/install @@ -0,0 +1,6 @@ +#!/bin/bash + +git clone --depth 1 https://github.com/beefproject/beef + +cd beef +bundle diff --git a/beef/install-root-archlinux b/beef/install-root-archlinux new file mode 100755 index 0000000..f0e09bc --- /dev/null +++ b/beef/install-root-archlinux @@ -0,0 +1,7 @@ +#!/bin/bash -e + +pacman -Syu --noconfirm --needed \ + ruby python2 ruby-bundler \ + git make gcc openssl patch readline \ + zlib libyaml libffi bzip2 autoconf automake \ + libtool bison sqlite diff --git a/beef/install-root-debian b/beef/install-root-debian new file mode 100755 index 0000000..dd185e4 --- /dev/null +++ b/beef/install-root-debian @@ -0,0 +1,9 @@ +#!/bin/bash -e + +echo "Need to get ruby with RVM... Unsupported for now" +exit 1 +apt-get install build-essential openssl libreadline6 \ + libreadline6-dev zlib1g zlib1g-dev libssl-dev \ + libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 \ + libxml2-dev libxslt1-dev autoconf libc6-dev \ + libncurses5-dev automake libtool bison subversion diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip new file mode 100755 index 0000000..a55c6be --- /dev/null +++ b/bin/ctf-tools-pip @@ -0,0 +1,43 @@ +#!/bin/bash +set -e -o pipefail +#set -x + +# let's stick with python 2 as default +PY_VERSION=2 +# check this scripts file ending +if [[ "$0" =~ pip3 ]]; then + PY_VERSION=3 +fi +if [[ "$0" =~ pip2 ]]; then + PY_VERSION=2 +fi + +PY_INTERPRETER=$(which "python$PY_VERSION" || which python) + +CTF_TOOLS_VE="ctftools" +if [[ $PY_VERSION -eq 3 ]]; then + CTF_TOOLS_VE="${CTF_TOOLS_VE}3" +fi + +if [[ -z "${WORKON_HOME+x}" ]]; then + export WORKON_HOME="$HOME/.virtualenvs" +fi +if [[ ! -d "$WORKON_HOME" ]]; then + mkdir -p "$WORKON_HOME" +fi + +VE_DIR="$WORKON_HOME/$CTF_TOOLS_VE" + +if [[ ! -d "$VE_DIR" || ! -e "$VE_DIR/bin/activate" ]]; then + echo "#### Creating python$PY_VERSION virtualenv '$CTF_TOOLS_VE' ####" >&2 + virtualenv --system-site-packages -p "$PY_INTERPRETER" "$VE_DIR" +fi + +if [[ -z "${VIRTUAL_ENV+x}" || "$VIRTUAL_ENV" != "$VE_DIR" ]]; then + if [[ -n "${VIRTUAL_ENV+x}" ]]; then + deactivate + fi + source "$VE_DIR/bin/activate" +fi + +exec pip "$@" diff --git a/bin/ctf-tools-pip3 b/bin/ctf-tools-pip3 new file mode 120000 index 0000000..1f63be9 --- /dev/null +++ b/bin/ctf-tools-pip3 @@ -0,0 +1 @@ +ctf-tools-pip \ No newline at end of file diff --git a/bin/manage-tools b/bin/manage-tools index 3f1166d..6ad811f 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -1,4 +1,6 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail +# set -x function usage() { @@ -6,21 +8,18 @@ function usage() Usage: $(basename $0) [-s] (list|setup|install|uninstall|bin|search) tool Where: - -s allow running things with sudo (i.e., to install debs) - tool the name of the tool. if "all", does the action on all - tools + -s allow running things with sudo (i.e., to install debs) + tool the name of the tool. if "all", does the action on all tools Actions: - setup set up the environment (adds ctf-tools/bin to your - \$PATH in .bashrc) - list list all tools (-i: only installed, -u: only - uninstalled) - install installs a tool - uninstall uninstalls a tool - reinstall reinstalls a tool - upgrade upgrades a tool - bin re-links tool binaries into ctf-tools/bin - search search description and name of tools + setup set up the environment (adds ctf-tools/bin to your \$PATH in .bashrc) + list list all tools (-i: only installed, -u: only uninstalled) + install installs a tool + uninstall uninstalls a tool + reinstall reinstalls a tool + upgrade upgrades a tool + bin re-links tool binaries into ctf-tools/bin + search search description and name of tools END } @@ -30,6 +29,126 @@ function tool_log() echo "$(tput setaf 4 2>/dev/null)TOOLS | $TOOL |$(tput sgr0 2>/dev/null) $@" } + +function detect_distribution() +{ + if which pacman 2>&1 >/dev/null; then + echo "archlinux" + elif which apt-get 2>&1 >/dev/null; then + if lsb_release -a | grep -i ubuntu 2>&1 >/dev/null; then + echo "ubuntu" + else + echo "debian" + fi + else + echo "" + fi +} + + +function base_build_setup_debian() +{ + PACKAGE_REQS="build-essential libtool g++ gcc texinfo curl wget automake autoconf python python-dev git subversion unzip virtualenvwrapper" + PACKAGE_COUNT=$(echo $PACKAGE_REQS | tr ' ' '\n' | wc -l) + if [ $(dpkg -l $PACKAGE_REQS | grep "^ii" | wc -l) -ne $PACKAGE_COUNT ] + then + if [ "$ALLOW_SUDO" -eq 1 ]; then + sudo apt-get -y install $PACKAGE_REQS + else + TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS" + fi + fi + + if ! dpkg --print-foreign-architectures | grep -q i386 + then + if [ "$ALLOW_SUDO" -eq 1 ] + then + sudo dpkg --add-architecture i386 + sudo apt-get update + else + TOOL=SETUP tool_log "Certain tools need i386 libraries (enable with 'dpkg --add-architecture i386; apt-get update')." + fi + fi +} + + +function base_build_setup_arch() +{ + PACKAGE_REQS="curl wget python2 python3 git subversion unzip python-virtualenvwrapper" + if [ "$ALLOW_SUDO" -eq 1 ]; then + sudo pacman -Syu --noconfirm --needed $PACKAGE_REQS + sudo pacman -Syu --noconfirm --needed base-devel || true + else + TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS" + fi + + if ! grep "^\[multilib\]$" /etc/pacman.conf >/dev/null; then + if [ "$ALLOW_SUDO" -eq 1 ]; then + sudo sh -c 'cat >> /etc/pacman.conf' </dev/null \ + && ! sudo pacman -Qk gcc-multilib >/dev/null + then + sudo pacman -Syy --noconfirm + #sudo pacman -Syu --noconfirm multilib-devel + # unfortunately we cannot do --noconfirm if we might choose to replace + # a package such as gcc with gcc-multilib, therefore this workaround + printf "\ny\ny\ny\n" | sudo pacman -Syu multilib-devel + fi +} + + +function base_build_setup() +{ + case "$1" in + "ubuntu") + ;& # fallthrough + "debian") + base_build_setup_debian + ;; + "archlinux") + base_build_setup_arch + export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 + ;; + *) + TOOL=SETUP tool_log "Cannot detect or unsupported distribution" + esac + + ## setup PATH for several shells + + echo "export PATH=\"$PWD/bin:\$PATH\"" >> ~/.bashrc + + if [ -e ~/.zshrc ] + then + echo "export PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc + fi + + if [ -e ~/.config/fish/config.fish ]; then + echo "set -x PATH $PWD/bin \$PATH " >> ~/.config/fish/config.fish + fi + + # create the py2 virtualenv + "$PWD/bin/ctf-tools-pip" freeze 2>&1 >/dev/null +} + + +if [[ $# -eq 0 ]]; then + usage + exit 1 +fi + +DISTRI=$(detect_distribution) + while [[ $1 == -* ]] do case $1 in @@ -44,10 +163,16 @@ do shift done -[ -z "$ALLOW_SUDO" ] && export ALLOW_SUDO=0 +[[ -z ${ALLOW_SUDO+x} ]] && export ALLOW_SUDO=0 -ACTION=$1 -TOOL=$2 +if [[ $# -ge 1 ]]; then + ACTION="$1" +fi +if [[ $# -eq 2 ]]; then + TOOL="$2" +else + TOOL="" +fi if [ "$TOOL" == "all" ] then @@ -65,35 +190,8 @@ cd $(dirname "${BASH_SOURCE[0]}")/.. case $ACTION in setup) - PACKAGE_REQS="build-essential libtool g++ gcc texinfo curl wget automake autoconf python-dev git subversion unzip" - PACKAGE_COUNT=$(echo $PACKAGE_REQS | tr ' ' '\n' | wc -l) - if [ $(dpkg -l $PACKAGE_REQS | grep "^ii" | wc -l) -ne $PACKAGE_COUNT ] - then - if [ "$ALLOW_SUDO" -eq 1 ] - then - sudo apt-get -y install $PACKAGE_REQS - else - TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS" - fi - fi - - if ! dpkg --print-foreign-architectures | grep -q i386 - then - if [ "$ALLOW_SUDO" -eq 1 ] - then - sudo dpkg --add-architecture i386 - sudo apt-get update || true - else - TOOL=SETUP tool_log "Certain tools need i386 libraries (enable with 'dpkg --add-architecture i386; apt-get update')." - fi - fi - - echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.bashrc - if [ -e ~/.zshrc ] - then - echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc - fi + base_build_setup "$DISTRI" ;; list) for t in * @@ -118,8 +216,32 @@ case $ACTION in tool_log "starting install, logging to $PWD/install.log" rm -f install.log - [ -x ./install-root -a "$ALLOW_SUDO" -eq 1 ] && sudo ./install-root >> install.log 2>&1 - if ./install >>install.log 2>&1 + + # first get distri specific dependencies + if [[ $(find . -name 'install-root*' | wc -l) -ge 1 ]]; then + INSTALL_ROOT_SCRIPT="./install-root-$DISTRI" + # use debian install script if we are on ubuntu and no ubuntu + # specific install script exists + if [[ "$DISTRI" == "ubuntu" \ + && ! -x "$INSTALL_ROOT_SCRIPT" \ + && -x "./install-root-debian" ]] + then + INSTALL_ROOT_SCRIPT="./install-root-debian" + fi + if [[ -x "$INSTALL_ROOT_SCRIPT" && "$ALLOW_SUDO" -eq 1 ]]; then + if ! sudo env DISTRI=$DISTRI "$INSTALL_ROOT_SCRIPT" >> install.log 2>&1; + then + tool_log "INSTALL FAILED" + cat install.log >&2 + exit 1 + fi + else + tool_log "Warning: make sure build dependencies are installed!" + fi + fi + + # execute install script + if env DISTRI=$DISTRI ./install >>install.log 2>&1 then tool_log "install finished" else @@ -134,8 +256,9 @@ case $ACTION in uninstall) cd $TOOL - [ -x ./uninstall ] && ./uninstall - git clean -dffx . + tool_log "starting uninstall, logging to $PWD/uninstall.log" + [ -x ./uninstall ] && ./uninstall >> uninstall.log 2>&1 + git clean -dffx . >/dev/null 2>&1 tool_log "uninstall finished" cd .. diff --git a/bindead/install-root b/bindead/install-root-debian similarity index 80% rename from bindead/install-root rename to bindead/install-root-debian index cdb4468..09c3f63 100755 --- a/bindead/install-root +++ b/bindead/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail apt-get -y install maven libprotobuf-dev openjdk-7-jre openjdk-7-jdk diff --git a/binjitsu/install b/binjitsu/install new file mode 100755 index 0000000..f75c139 --- /dev/null +++ b/binjitsu/install @@ -0,0 +1,5 @@ +#!/bin/bash -e + +#ctf-tools-pip install --upgrade 'git+https://github.com/binjitsu/binjitsu.git' +git clone --depth=1 'https://github.com/binjitsu/binjitsu.git' +ctf-tools-pip install --upgrade -e binjitsu diff --git a/binjitsu/install-root-archlinux b/binjitsu/install-root-archlinux new file mode 100755 index 0000000..24665a9 --- /dev/null +++ b/binjitsu/install-root-archlinux @@ -0,0 +1,3 @@ +#!/bin/bash -e + +pacman -Syu --noconfirm --needed binutils openssl libffi diff --git a/pwntools/install-root b/binjitsu/install-root-ubuntu similarity index 75% rename from pwntools/install-root rename to binjitsu/install-root-ubuntu index 05fdf99..50ac55e 100755 --- a/pwntools/install-root +++ b/binjitsu/install-root-ubuntu @@ -1,5 +1,6 @@ #!/bin/bash -e +apt-get -y install software-properties-common apt-add-repository -y ppa:pwntools/binutils apt-get update apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev diff --git a/binjitsu/uninstall b/binjitsu/uninstall new file mode 100755 index 0000000..81cc9b9 --- /dev/null +++ b/binjitsu/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall -y binjitsu || true diff --git a/burpsuite/install-root-archlinux b/burpsuite/install-root-archlinux new file mode 100755 index 0000000..5a77a79 --- /dev/null +++ b/burpsuite/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed jre7-openjdk diff --git a/burpsuite/install-root b/burpsuite/install-root-debian similarity index 69% rename from burpsuite/install-root rename to burpsuite/install-root-debian index 91c2df5..78b0902 100755 --- a/burpsuite/install-root +++ b/burpsuite/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail apt-get -y install openjdk-7-jre diff --git a/codereason/install-root b/codereason/install-root-debian similarity index 88% rename from codereason/install-root rename to codereason/install-root-debian index 162c938..ecf98f4 100755 --- a/codereason/install-root +++ b/codereason/install-root-debian @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail apt-get -y install build-essential gcc g++ make cmake libboost-dev libprotobuf-dev protobuf-compiler libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-date-time-dev libboost-regex-dev diff --git a/crosstool/install-root-archlinux b/crosstool/install-root-archlinux new file mode 100755 index 0000000..b071db2 --- /dev/null +++ b/crosstool/install-root-archlinux @@ -0,0 +1,3 @@ +#!/bin/bash -e + +pacman -Syu --noconfirm gperf flex bison help2man gawk ncurses diff --git a/crosstool/install-root b/crosstool/install-root-debian similarity index 100% rename from crosstool/install-root rename to crosstool/install-root-debian diff --git a/df/install-root b/df/install-root-debian similarity index 96% rename from df/install-root rename to df/install-root-debian index a312999..4b5294d 100755 --- a/df/install-root +++ b/df/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install libasound2:i386 libasyncns0:i386 libatk1.0-0:i386 libc6:i386 libcaca0:i386 libcairo2:i386 libdatrie1:i386 libdbus-1-3:i386 libdrm2:i386 libexpat1:i386 libffi6:i386 libflac8:i386 libfontconfig1:i386 libfreetype6:i386 libgdk-pixbuf2.0-0:i386 libgl1-mesa-glx:i386 libglapi-mesa:i386 libglib2.0-0:i386 libglu1-mesa:i386 libgraphite2-3:i386 libgtk2.0-0:i386 libharfbuzz0b:i386 libjbig0:i386 libjpeg-turbo8:i386 libjson-c2:i386 liblzma5:i386 libncursesw5:i386 libogg0:i386 libpango-1.0-0:i386 libpangocairo-1.0-0:i386 libpangoft2-1.0-0:i386 libpcre3:i386 libpixman-1-0:i386 libpng12-0:i386 libpulse0:i386 libsdl1.2debian:i386 libsdl-image1.2:i386 libsdl-ttf2.0-0:i386 libselinux1:i386 libslang2:i386 libsndfile1:i386 libthai0:i386 libtiff5:i386 libtinfo5:i386 libvorbis0a:i386 libvorbisenc2:i386 libwebp5:i386 libwrap0:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb1:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-render0:i386 libxcb-shm0:i386 libxcb-sync1:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxinerama1:i386 libxrandr2:i386 libxrender1:i386 libxshmfence1:i386 libxxf86vm1:i386 zlib1g:i386 +apt-get -y install libasound2:i386 libasyncns0:i386 libatk1.0-0:i386 libc6:i386 libcaca0:i386 libcairo2:i386 libdatrie1:i386 libdbus-1-3:i386 libdrm2:i386 libexpat1:i386 libffi6:i386 libflac8:i386 libfontconfig1:i386 libfreetype6:i386 libgdk-pixbuf2.0-0:i386 libgl1-mesa-glx:i386 libglapi-mesa:i386 libglib2.0-0:i386 libglu1-mesa:i386 libgraphite2-3:i386 libgtk2.0-0:i386 libharfbuzz0b:i386 libjbig0:i386 libjpeg-turbo8:i386 libjson-c2:i386 liblzma5:i386 libncursesw5:i386 libogg0:i386 libpango-1.0-0:i386 libpangocairo-1.0-0:i386 libpangoft2-1.0-0:i386 libpcre3:i386 libpixman-1-0:i386 libpng12-0:i386 libpulse0:i386 libsdl1.2debian:i386 libsdl-image1.2:i386 libsdl-ttf2.0-0:i386 libselinux1:i386 libslang2:i386 libsndfile1:i386 libthai0:i386 libtiff5:i386 libtinfo5:i386 libvorbis0a:i386 libvorbisenc2:i386 libwebp5:i386 libwrap0:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb1:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-render0:i386 libxcb-shm0:i386 libxcb-sync1:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxinerama1:i386 libxrandr2:i386 libxrender1:i386 libxshmfence1:i386 libxxf86vm1:i386 zlib1g:i386 diff --git a/dirb/install-root-archlinux b/dirb/install-root-archlinux new file mode 100755 index 0000000..c9eddd1 --- /dev/null +++ b/dirb/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed curl gnutls diff --git a/dirb/install-root b/dirb/install-root-debian similarity index 55% rename from dirb/install-root rename to dirb/install-root-debian index a86ca60..86c573c 100755 --- a/dirb/install-root +++ b/dirb/install-root-debian @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail apt-get -y install libcurl4-gnutls-dev diff --git a/dirs3arch/install b/dirs3arch/install deleted file mode 100755 index 57c0505..0000000 --- a/dirs3arch/install +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -mkdir bin -git clone --depth 1 https://github.com/maurosoria/dirs3arch.git - -cd bin -ln -s ../dirs3arch/dirs3arch.py . diff --git a/dirsearch/install b/dirsearch/install new file mode 100755 index 0000000..6a3a5c0 --- /dev/null +++ b/dirsearch/install @@ -0,0 +1,7 @@ +#!/bin/bash + +mkdir bin +git clone --depth 1 https://github.com/maurosoria/dirsearch.git + +cd bin +ln -s ../dirsearch/dirsearch.py . diff --git a/dislocker/install-root-archlinux b/dislocker/install-root-archlinux new file mode 100755 index 0000000..57c736c --- /dev/null +++ b/dislocker/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed mbedtls fuse diff --git a/dislocker/install-root b/dislocker/install-root-debian similarity index 75% rename from dislocker/install-root rename to dislocker/install-root-debian index 3b9ff3f..5836fd3 100755 --- a/dislocker/install-root +++ b/dislocker/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail apt-get -y install libfuse-dev libpolarssl-dev diff --git a/elfparser/install-root b/elfparser/install-root-debian similarity index 52% rename from elfparser/install-root rename to elfparser/install-root-debian index 49755cb..4d5cad2 100755 --- a/elfparser/install-root +++ b/elfparser/install-root-debian @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail apt-get install -y libqt5widgets5 diff --git a/firmware-mod-kit/install-root-archlinux b/firmware-mod-kit/install-root-archlinux new file mode 100755 index 0000000..98639df --- /dev/null +++ b/firmware-mod-kit/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed zlib xz python2-magic diff --git a/firmware-mod-kit/install-root b/firmware-mod-kit/install-root-debian similarity index 77% rename from firmware-mod-kit/install-root rename to firmware-mod-kit/install-root-debian index c38d2f4..3bcd4b2 100755 --- a/firmware-mod-kit/install-root +++ b/firmware-mod-kit/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail apt-get -y install liblzma-dev python-magic zlib1g-dev diff --git a/foresight/install b/foresight/install index 497d341..4e796d3 100755 --- a/foresight/install +++ b/foresight/install @@ -1,13 +1,3 @@ #!/bin/bash -e -git clone --depth 1 https://github.com/ALSchwalm/foresight.git - -# python3 virtualenv -virtualenv -p $(which python3) python3 -source python3/bin/activate -pip install -e foresight - -mkdir -p bin -cd bin -ln -s ../python3/bin/foresee . -cd .. +ctf-tools-pip3 install --upgrade 'git+https://github.com/ALSchwalm/foresight.git' diff --git a/foresight/uninstall b/foresight/uninstall new file mode 100755 index 0000000..2849572 --- /dev/null +++ b/foresight/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip3 uninstall -y foresight || true diff --git a/gdb/install-root-archlinux b/gdb/install-root-archlinux new file mode 100755 index 0000000..e5e7959 --- /dev/null +++ b/gdb/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --needed --noconfirm texinfo diff --git a/gdb/install-root b/gdb/install-root-debian similarity index 66% rename from gdb/install-root rename to gdb/install-root-debian index 2b3ebf2..76cf84c 100755 --- a/gdb/install-root +++ b/gdb/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail apt-get -y install texinfo diff --git a/gef/install b/gef/install new file mode 100755 index 0000000..1e42513 --- /dev/null +++ b/gef/install @@ -0,0 +1,28 @@ +#!/bin/bash +set -eu -o pipefail + +git clone --depth 1 https://github.com/hugsy/gef.git + +mkdir bin +cat > bin/gdb-gef <> ~/.gdbinit < bin/gdb-peda <> ~/.gdbinit +#echo "source $PWD/peda.py" >> ~/.gdbinit +if ! grep "init-peda" ~/.gdbinit; then + cat >> ~/.gdbinit <> bin/pwndbg <> ~/.gdbinit < $(basename $i) -#!/bin/bash -PATH=/usr/bin:\$PATH $PWD/$(basename $i).real "\$@" -END - chmod 755 $(basename $i) -done -cd .. +git clone --depth=1 https://github.com/Gallopsled/pwntools.git +ctf-tools-pip install --upgrade -e pwntools diff --git a/pwntools/install-root-archlinux b/pwntools/install-root-archlinux new file mode 100755 index 0000000..24665a9 --- /dev/null +++ b/pwntools/install-root-archlinux @@ -0,0 +1,3 @@ +#!/bin/bash -e + +pacman -Syu --noconfirm --needed binutils openssl libffi diff --git a/pwntools/install-root-ubuntu b/pwntools/install-root-ubuntu new file mode 100755 index 0000000..50ac55e --- /dev/null +++ b/pwntools/install-root-ubuntu @@ -0,0 +1,6 @@ +#!/bin/bash -e + +apt-get -y install software-properties-common +apt-add-repository -y ppa:pwntools/binutils +apt-get update +apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev diff --git a/pwntools/uninstall b/pwntools/uninstall new file mode 100755 index 0000000..a54b1fd --- /dev/null +++ b/pwntools/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall -y pwntools || true diff --git a/python-paddingoracle/install b/python-paddingoracle/install index 8ef3fe4..7af3e3a 100755 --- a/python-paddingoracle/install +++ b/python-paddingoracle/install @@ -1,4 +1,4 @@ #!/bin/bash -e git clone --depth 1 https://github.com/mwielgoszewski/python-paddingoracle.git -pip install -e python-paddingoracle +ctf-tools-pip install -e python-paddingoracle diff --git a/python-paddingoracle/uninstall b/python-paddingoracle/uninstall new file mode 100755 index 0000000..7ba7ec6 --- /dev/null +++ b/python-paddingoracle/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall -y python-paddingoracle || true diff --git a/qemu/install b/qemu/install index d481869..c0803c7 100755 --- a/qemu/install +++ b/qemu/install @@ -2,6 +2,10 @@ curl http://wiki.qemu-project.org/download/qemu-2.4.1.tar.bz2 | tar xvj cd qemu-2.4.1 -./configure --prefix=$(dirname $PWD) +if [[ "$(python --version 2>&1)" =~ Python\ 3 ]]; then + ./configure "--prefix=$(dirname $PWD)" "--python=$(which python2)" +else + ./configure "--prefix=$(dirname $PWD)" +fi make -j $(nproc) make install diff --git a/qemu/install-root-archlinux b/qemu/install-root-archlinux new file mode 100755 index 0000000..dc6ba02 --- /dev/null +++ b/qemu/install-root-archlinux @@ -0,0 +1,3 @@ +#!/bin/bash -e + +pacman -Syu --noconfirm --needed python2 diff --git a/qemu/install-root-debian b/qemu/install-root-debian new file mode 100755 index 0000000..6d0eb02 --- /dev/null +++ b/qemu/install-root-debian @@ -0,0 +1,3 @@ +#!/bin/bash -e + +apt-get install -y python diff --git a/qira/install-root-archlinux b/qira/install-root-archlinux new file mode 100755 index 0000000..c9bc049 --- /dev/null +++ b/qira/install-root-archlinux @@ -0,0 +1,6 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed python2-pip openssl libjpeg-turbo zlib \ + unzip wget graphviz gmp llvm clang ocaml llvm-ocaml python2-virtualenv \ + wget flex bison libtool automake autoconf pkg-config libevent glib2 diff --git a/qira/install-root b/qira/install-root-debian similarity index 93% rename from qira/install-root rename to qira/install-root-debian index fb7c208..4d822d1 100755 --- a/qira/install-root +++ b/qira/install-root-debian @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail apt-get -y install python-pip libssl-dev build-essential python-dev python-pip debootstrap libjpeg-dev zlib1g-dev unzip wget graphviz software-properties-common libgmp-dev llvm-3.4-dev time clang-3.4 ocaml ocaml-native-compilers camlp4-extra opam clang python-virtualenv wget flex bison libtool automake autoconf autotools-dev pkg-config libglib2.0-dev libevent-2.0-5 apt-get -y build-dep qemu diff --git a/snowman/install-root-archlinux b/snowman/install-root-archlinux new file mode 100755 index 0000000..453cf15 --- /dev/null +++ b/snowman/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --needed --noconfirm boost boost-libs cmake diff --git a/snowman/install-root b/snowman/install-root-debian similarity index 75% rename from snowman/install-root rename to snowman/install-root-debian index 90a3e8b..9a92121 100755 --- a/snowman/install-root +++ b/snowman/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail apt-get -y install libboost-dev cmake libqt4-dev diff --git a/sonic-visualizer/install-root-archlinux b/sonic-visualizer/install-root-archlinux new file mode 100755 index 0000000..73a440f --- /dev/null +++ b/sonic-visualizer/install-root-archlinux @@ -0,0 +1,6 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed bzip2 fftw libsndfile libsamplerate \ + vamp-plugin-sdk rubberband sord liblo liblrdf liboggz libfishsound \ + libid3tag portaudio libmad qt5-base diff --git a/sonic-visualizer/install-root b/sonic-visualizer/install-root-debian similarity index 87% rename from sonic-visualizer/install-root rename to sonic-visualizer/install-root-debian index 7508acd..1f38931 100755 --- a/sonic-visualizer/install-root +++ b/sonic-visualizer/install-root-debian @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail apt-get -y install libbz2-dev libfftw3-dev libsndfile1-dev libsamplerate0-dev vamp-plugin-sdk librubberband-dev libsord-dev liblo-dev liblrdf0-dev liboggz2-dev libfishsound1-dev libid3tag0-dev libportaudio-dev libmad0-dev qt5-qmake diff --git a/sqlmap/install-root-archlinux b/sqlmap/install-root-archlinux new file mode 100755 index 0000000..6f4f7f2 --- /dev/null +++ b/sqlmap/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed sqlite diff --git a/sqlmap/install-root b/sqlmap/install-root-debian similarity index 70% rename from sqlmap/install-root rename to sqlmap/install-root-debian index eeac131..2ff2b0e 100755 --- a/sqlmap/install-root +++ b/sqlmap/install-root-debian @@ -1,3 +1,4 @@ #!/bin/bash +set -eu -o pipefail apt-get -y install libsqlite3-dev diff --git a/sslsplit/install-root-archlinux b/sslsplit/install-root-archlinux new file mode 100755 index 0000000..dd0b5bb --- /dev/null +++ b/sslsplit/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed libevent diff --git a/sslsplit/install-root b/sslsplit/install-root-debian similarity index 50% rename from sslsplit/install-root rename to sslsplit/install-root-debian index 2ac2936..3e352e1 100755 --- a/sslsplit/install-root +++ b/sslsplit/install-root-debian @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail apt-get -y install libevent-dev diff --git a/stegdetect/install-root b/stegdetect/install-root-debian similarity index 50% rename from stegdetect/install-root rename to stegdetect/install-root-debian index f4dd360..6852027 100755 --- a/stegdetect/install-root +++ b/stegdetect/install-root-debian @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail apt-get -y install automake1.4 diff --git a/xortool/install b/xortool/install index d1c992d..d7f733c 100755 --- a/xortool/install +++ b/xortool/install @@ -1,9 +1,3 @@ #!/bin/bash -e -git clone --depth 1 https://github.com/hellman/xortool.git -pip install -e ./xortool - -mkdir -p bin -cd bin -ln -s ../xortool/xortool/{xortool,xortool-xor} . -cd .. +ctf-tools-pip install --upgrade 'git+https://github.com/hellman/xortool.git' diff --git a/xortool/uninstall b/xortool/uninstall index 799175e..fae39d7 100755 --- a/xortool/uninstall +++ b/xortool/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -pip uninstall -y xortool +ctf-tools-pip uninstall -y xortool || true