From ab4e4406642f120e3bd0e764c495007307b7db77 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:10:59 +0100 Subject: [PATCH 01/57] First step to support running on archlinux manage-tools now supports setting up archlinux and passes distribution name to install scripts. modified some of the install-root scripts to work on archlinux --- afl/install | 5 ++ afl/install-root | 16 +++- bin/manage-tools | 153 ++++++++++++++++++++++++++--------- crosstool/install-root | 12 ++- hash-identifier/install-root | 10 ++- 5 files changed, 152 insertions(+), 44 deletions(-) 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 b/afl/install-root index 82fb914..62cc64b 100755 --- a/afl/install-root +++ b/afl/install-root @@ -1,4 +1,16 @@ #!/bin/bash -e -apt-get -y build-dep qemu -apt-get -y install bison +case "$DISTRI" in + "debian") + apt-get -y build-dep qemu + apt-get -y install bison + ;; + "archlinux") + pacman -Syu --noconfirm bison + pacman -Syu --noconfirm qemu + ;; + *) + echo "Unkown distribution" + exit 1 + ;; +esac diff --git a/bin/manage-tools b/bin/manage-tools index be80f03..1da2d9a 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -1,4 +1,5 @@ #!/bin/bash -e +# set -evx function usage() { @@ -6,21 +7,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 +28,99 @@ 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 + echo "debian" + else + echo "" + fi +} + + +function base_build_setup_ubuntu() +{ + PACKAGE_REQS="build-essential libtool g++ gcc linuxtexinfo 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 + 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" + if [ "$ALLOW_SUDO" -eq 1 ]; then + sudo pacman -Syu --noconfirm $PACKAGE_REQS + sudo pacman -Syu --noconfirm 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() +{ + if which apt-get; then + base_build_setup_ubuntu + elif which pacman; then + base_build_setup_arch + else + TOOL=SETUP tool_log "Cannot detect or unsupported distribution" + fi +} + + + +DISTRI=$(detect_distribution) + while [[ $1 == -* ]] do case $1 in @@ -65,34 +156,14 @@ 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 - else - TOOL=SETUP tool_log "Certain tools need i386 libraries (enable with 'dpkg --add-architecture i386; apt-get update')." - fi - fi + base_build_setup echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.bashrc - if [ -e ~/.zshrc ] - then - echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc - fi + if [ -e ~/.zshrc ] + then + echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc + fi ;; list) @@ -118,8 +189,10 @@ 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 + if [ -x ./install-root -a "$ALLOW_SUDO" -eq 1 ]; then + sudo env DISTRI=$DISTRI ./install-root >> install.log 2>&1 + fi + if env DISTRI=$DISTRI ./install >>install.log 2>&1 then tool_log "install finished" else diff --git a/crosstool/install-root b/crosstool/install-root index b9e870d..cbb84a3 100755 --- a/crosstool/install-root +++ b/crosstool/install-root @@ -1,3 +1,13 @@ #!/bin/bash -e -apt-get install -y gperf flex bison help2man gawk libncurses5-dev +case "$DISTRI" in + debian) + apt-get install -y gperf flex bison help2man gawk libncurses5-dev + ;; + archlinux) + pacman -Syu --noconfirm gperf flex bison help2man gawk ncurses + ;; + *) + echo "Unsupported distro" + ;; +esac diff --git a/hash-identifier/install-root b/hash-identifier/install-root index c9cd9b3..4f93a7f 100755 --- a/hash-identifier/install-root +++ b/hash-identifier/install-root @@ -1,3 +1,11 @@ #!/bin/bash -e -apt-get -y install tofrodos +case "$DISTRI" in + debian) + apt-get -y install tofrodos + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac From d5f9c8ac0c01603f932c80148b3c65b700596ce6 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:15:28 +0100 Subject: [PATCH 02/57] Added pwndbg gdb plugin. Adapted peda install to allow switching. gdb now doesn't automatically load peda or pwndbg, instead provide init-X function and provide wrapper scripts --- peda/install | 26 +++++++++++++++++++++++++- pwndbg/install | 29 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 pwndbg/install diff --git a/peda/install b/peda/install index 8a0c4a5..daf4987 100755 --- a/peda/install +++ b/peda/install @@ -1,5 +1,29 @@ #!/bin/bash +set -eu -o pipefail git clone --depth 1 https://github.com/longld/peda.git + +mkdir bin +cat > bin/gdb-peda <> ~/.gdbinit +#echo "source $PWD/peda.py" >> ~/.gdbinit +if ! grep "init-peda" ~/.gdbinit; then + cat >> ~/.gdbinit <> bin/pwndbg <> ~/.gdbinit < Date: Thu, 18 Feb 2016 16:33:31 +0100 Subject: [PATCH 03/57] Introduced install possibility via python virtualenv and pip and switched pwntools and binjitsu to it --- bin/ctf-tools-pip | 34 ++++++++++++++++++++++++++++++++++ bin/ctf-tools-pip3 | 1 + binjitsu/install | 3 +++ binjitsu/install-root | 17 +++++++++++++++++ binjitsu/uninstall | 3 +++ pwntools/install | 28 +--------------------------- pwntools/install-root | 17 ++++++++++++++--- pwntools/uninstall | 3 +++ 8 files changed, 76 insertions(+), 30 deletions(-) create mode 100755 bin/ctf-tools-pip create mode 120000 bin/ctf-tools-pip3 create mode 100755 binjitsu/install create mode 100755 binjitsu/install-root create mode 100755 binjitsu/uninstall create mode 100755 pwntools/uninstall diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip new file mode 100755 index 0000000..7e038ef --- /dev/null +++ b/bin/ctf-tools-pip @@ -0,0 +1,34 @@ +#!/bin/bash +set -e -o pipefail + +PY_VERSION=2 +if [[ "$0" =~ \.+pip3 ]]; then + PY_VERSION=3 +fi +if [[ "$0" =~ \.+pip2 ]]; then + PY_VERSION=2 +fi + +CTF_TOOLS_VE="ctftools" +if [[ "PY_VERSION" -eq 3 ]]; then + CTF_TOOLS_VE="${CTF_TOOLS_VE}3" +fi + +export WORKON_HOME=~/.virtualenvs +if [[ ! -d "$WORKON_HOME" ]]; then + mkdir -p "$WORKON_HOME" +fi +export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 + +source $(which virtualenvwrapper.sh) + +if ! workon "$CTF_TOOLS_VE" 2>&1 1>/dev/null; then + echo "#### Creating python#PY_VERSION virtualenv '$CTF_TOOLS_VE' ####" >&2 + # for some reason mkvirtualenv returns non-zero even if it + # succeeds? + mkvirtualenv -p $(which "python$PY_VERSION") "$CTF_TOOLS_VE" || true + echo "#### Switching to '$CTF_TOOLS_VE' virtualenv" >&2 + workon "$CTF_TOOLS_VE" || (deactivate && workon "$CTF_TOOLS_VE") +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/binjitsu/install b/binjitsu/install new file mode 100755 index 0000000..3b52a09 --- /dev/null +++ b/binjitsu/install @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip install --upgrade 'git+https://github.com/binjitsu/binjitsu.git' diff --git a/binjitsu/install-root b/binjitsu/install-root new file mode 100755 index 0000000..a6e5448 --- /dev/null +++ b/binjitsu/install-root @@ -0,0 +1,17 @@ +#!/bin/bash -e + +case "$DISTRI" in + "debian") + apt-add-repository -y ppa:pwntools/binutils + apt-get update + apt-get -y install binutils-.*-linux-gnu + ;; + "archlinux") + pacman -Syu --noconfirm binutils + ;; + *) + echo "Unknown distribution" + exit 1 + ;; +esac + diff --git a/binjitsu/uninstall b/binjitsu/uninstall new file mode 100755 index 0000000..f54f29d --- /dev/null +++ b/binjitsu/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall binjitsu diff --git a/pwntools/install b/pwntools/install index 4ca2f02..aa8ca1f 100755 --- a/pwntools/install +++ b/pwntools/install @@ -1,30 +1,4 @@ #!/bin/bash -e # pwnutils -git clone --depth 1 https://github.com/Gallopsled/pwntools.git -cd pwntools -pip install -r requirements.txt -cd .. - -# binutils -#curl https://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.gz | tar xz -#mkdir binutils-build -#cd binutils-build -#export AR=ar -#export AS=as -#../binutils-2.25/configure --prefix=$(dirname $PWD)/binutils-inst --enable-multilib -#make -j $(nproc) -#make install - -mkdir -p bin -cd bin -for i in $(yes n | pip uninstall pwntools | grep bin) -do - mv $i $(basename $i).real - cat < $(basename $i) -#!/bin/bash -PATH=/usr/bin:\$PATH $PWD/$(basename $i).real "\$@" -END - chmod 755 $(basename $i) -done -cd .. +ctf-tools-pip install --upgrade 'git+https://github.com/Gallopsled/pwntools.git' diff --git a/pwntools/install-root b/pwntools/install-root index fe5aa41..a6e5448 100755 --- a/pwntools/install-root +++ b/pwntools/install-root @@ -1,6 +1,17 @@ #!/bin/bash -e -apt-add-repository -y ppa:pwntools/binutils -apt-get update -apt-get -y install binutils-.*-linux-gnu +case "$DISTRI" in + "debian") + apt-add-repository -y ppa:pwntools/binutils + apt-get update + apt-get -y install binutils-.*-linux-gnu + ;; + "archlinux") + pacman -Syu --noconfirm binutils + ;; + *) + echo "Unknown distribution" + exit 1 + ;; +esac diff --git a/pwntools/uninstall b/pwntools/uninstall new file mode 100755 index 0000000..0bd6a4b --- /dev/null +++ b/pwntools/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall pwntools || true From 74af81a7798a4b44cee42d25b4546077a9a007c9 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:35:43 +0100 Subject: [PATCH 04/57] uninstall scripts should also be allowed in gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d437588..c0af44d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ */* bin/* !*/install +!*/uninstall !*/install-root !*/upgrade !*/test From 8ed86826ae3bb9511aabfa4e28e41f39176490fd Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:51:25 +0100 Subject: [PATCH 05/57] hashpump arch support --- hashpump/install-root | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hashpump/install-root b/hashpump/install-root index 3db9f51..0642294 100755 --- a/hashpump/install-root +++ b/hashpump/install-root @@ -1,3 +1,14 @@ #!/bin/bash -e -apt-get -y install libssl-dev +case "$DISTRI" in + debian) + apt-get -y install libssl-dev + ;; + archlinux) + pacman -Syu --noconfirm openssl + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac From c207776205fbaf9f7d38723033bbf968061e4f97 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:51:42 +0100 Subject: [PATCH 06/57] switches to ctf-pip tool --- hashpump/install | 2 +- python-paddingoracle/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hashpump/install b/hashpump/install index 94b164f..8db51db 100755 --- a/hashpump/install +++ b/hashpump/install @@ -5,7 +5,7 @@ cd HashPump make -j $(nproc) cd .. -pip install -e HashPump +ctf-tools-pip install --upgrade -e HashPump mkdir bin cd bin 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 From 063f092cf156c734dae67b8b2d7633c9769c7f00 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:55:34 +0100 Subject: [PATCH 07/57] mitmproxy installation --- mitmproxy/install | 3 +++ mitmproxy/uninstall | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 mitmproxy/install create mode 100755 mitmproxy/uninstall diff --git a/mitmproxy/install b/mitmproxy/install new file mode 100755 index 0000000..e9a0c83 --- /dev/null +++ b/mitmproxy/install @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip install --upgrade mitmproxy diff --git a/mitmproxy/uninstall b/mitmproxy/uninstall new file mode 100755 index 0000000..22f45db --- /dev/null +++ b/mitmproxy/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall mitmproxy || true From 407375ce0524ac1581734963aac74e09e5f592fd Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 17:09:37 +0100 Subject: [PATCH 08/57] fixed python3 virtualenv support in pip wrapper, foresight via pip/virtualenv install --- bin/ctf-tools-pip | 7 +++++-- foresight/install | 12 +----------- foresight/uninstall | 3 +++ 3 files changed, 9 insertions(+), 13 deletions(-) create mode 100755 foresight/uninstall diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip index 7e038ef..c9b3f95 100755 --- a/bin/ctf-tools-pip +++ b/bin/ctf-tools-pip @@ -1,11 +1,14 @@ #!/bin/bash set -e -o pipefail +#set -x +# let's stick with python 2 as default PY_VERSION=2 -if [[ "$0" =~ \.+pip3 ]]; then +# check this scripts file ending +if [[ "$0" =~ pip3 ]]; then PY_VERSION=3 fi -if [[ "$0" =~ \.+pip2 ]]; then +if [[ "$0" =~ pip2 ]]; then PY_VERSION=2 fi 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..a558926 --- /dev/null +++ b/foresight/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip3 uninstall foresight || true From 2bb8f6a05a420e200892c0fc05cc8c53bfe07a8f Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 17:15:44 +0100 Subject: [PATCH 09/57] added -y switches to uninstall --- binjitsu/uninstall | 2 +- foresight/uninstall | 2 +- mitmproxy/uninstall | 2 +- pwntools/uninstall | 2 +- xortool/install | 8 +------- xortool/uninstall | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/binjitsu/uninstall b/binjitsu/uninstall index f54f29d..81cc9b9 100755 --- a/binjitsu/uninstall +++ b/binjitsu/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -ctf-tools-pip uninstall binjitsu +ctf-tools-pip uninstall -y binjitsu || true diff --git a/foresight/uninstall b/foresight/uninstall index a558926..2849572 100755 --- a/foresight/uninstall +++ b/foresight/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -ctf-tools-pip3 uninstall foresight || true +ctf-tools-pip3 uninstall -y foresight || true diff --git a/mitmproxy/uninstall b/mitmproxy/uninstall index 22f45db..3ca4c72 100755 --- a/mitmproxy/uninstall +++ b/mitmproxy/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -ctf-tools-pip uninstall mitmproxy || true +ctf-tools-pip uninstall -y mitmproxy || true diff --git a/pwntools/uninstall b/pwntools/uninstall index 0bd6a4b..a54b1fd 100755 --- a/pwntools/uninstall +++ b/pwntools/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -ctf-tools-pip uninstall pwntools || true +ctf-tools-pip uninstall -y pwntools || true 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 From e2e1f89dd65e84282d97cdaadea754009f72fd71 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Fri, 1 Apr 2016 10:46:58 +0200 Subject: [PATCH 10/57] base_build_setup has distribution as argument now --- bin/manage-tools | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/bin/manage-tools b/bin/manage-tools index 1da2d9a..d9dead2 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -108,13 +108,16 @@ EOF function base_build_setup() { - if which apt-get; then - base_build_setup_ubuntu - elif which pacman; then - base_build_setup_arch - else - TOOL=SETUP tool_log "Cannot detect or unsupported distribution" - fi + case "$1" in + "ubuntu") + base_build_setup_ubuntu + ;; + "archlinux") + base_build_setup_arch + ;; + *) + TOOL=SETUP tool_log "Cannot detect or unsupported distribution" + esac } @@ -157,13 +160,17 @@ cd $(dirname "${BASH_SOURCE[0]}")/.. case $ACTION in setup) - base_build_setup + base_build_setup "$DISTRI" echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.bashrc - if [ -e ~/.zshrc ] - then - echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc - fi + if [ -e ~/.zshrc ] + then + echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc + fi + + if [ -e ~/.config/fish/config.fish ]; then + echo "set -x PATH $PATH $PWD/bin" >> ~/.config/fish/config.fish + fi ;; list) From 6a58c9cecd7ae20238f5dc09dd72ab79e35b15d4 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Fri, 1 Apr 2016 10:47:02 +0200 Subject: [PATCH 11/57] added "" to "$@" --- peda/install | 2 +- pwndbg/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 pwndbg/install diff --git a/peda/install b/peda/install index daf4987..a030946 100755 --- a/peda/install +++ b/peda/install @@ -6,7 +6,7 @@ git clone --depth 1 https://github.com/longld/peda.git mkdir bin cat > bin/gdb-peda <> bin/pwndbg < Date: Fri, 1 Apr 2016 11:18:36 +0200 Subject: [PATCH 12/57] Added GEF (GDB Enhanced Features) for debugging non x86 binaries --- gef/install | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 gef/install 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 < Date: Wed, 4 May 2016 19:55:11 +0200 Subject: [PATCH 13/57] fixed QEMU install on systems where python -> python3 --- qemu/install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu/install b/qemu/install index d4f8db4..4ea9b2b 100755 --- a/qemu/install +++ b/qemu/install @@ -2,6 +2,10 @@ curl http://wiki.qemu-project.org/download/qemu-2.4.0.1.tar.bz2 | tar xj cd qemu-2.4.0.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 From 3283c5861500207e430c3a71e76b7ec8b88c2a0c Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 4 May 2016 19:56:08 +0200 Subject: [PATCH 14/57] Added beef installation --- beef/install | 6 ++++++ beef/install-root | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 beef/install create mode 100644 beef/install-root diff --git a/beef/install b/beef/install new file mode 100644 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 b/beef/install-root new file mode 100644 index 0000000..c0f6bff --- /dev/null +++ b/beef/install-root @@ -0,0 +1,24 @@ +#!/bin/bash -e + +case "$DISTRI" in + debian) + 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 + ;; + archlinux) + pacman -Syu --noconfirm --needed \ + ruby python2 ruby-bundler \ + git make gcc openssl patch readline \ + zlib libyaml libffi bzip2 autoconf automake \ + libtool bison sqlite + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac From d3c525dadae899172a3efdabc12079bf8bcdb498 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 4 May 2016 19:56:30 +0200 Subject: [PATCH 15/57] Added QEMU install-root for python2 dependency --- qemu/install-root | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 qemu/install-root diff --git a/qemu/install-root b/qemu/install-root new file mode 100755 index 0000000..a6dd7df --- /dev/null +++ b/qemu/install-root @@ -0,0 +1,13 @@ +#!/bin/bash -e + +case "$DISTRI" in + debian) + ;; + archlinux) + pacman -Syu --noconfirm --needed python2 + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac From 82571b6917b6dbb212e722d35c6f7d2d99b7e0cb Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 4 May 2016 19:56:51 +0200 Subject: [PATCH 16/57] updated binjitsu install --- binjitsu/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/binjitsu/install b/binjitsu/install index 3b52a09..f75c139 100755 --- a/binjitsu/install +++ b/binjitsu/install @@ -1,3 +1,5 @@ #!/bin/bash -e -ctf-tools-pip install --upgrade 'git+https://github.com/binjitsu/binjitsu.git' +#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 From 84da02786cdba25ed63f3841b3f0f7d856ce3544 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:10:59 +0100 Subject: [PATCH 17/57] First step to support running on archlinux manage-tools now supports setting up archlinux and passes distribution name to install scripts. modified some of the install-root scripts to work on archlinux --- afl/install | 5 ++ afl/install-root | 16 +++- bin/manage-tools | 145 ++++++++++++++++++++++++++--------- crosstool/install-root | 12 ++- hash-identifier/install-root | 10 ++- 5 files changed, 148 insertions(+), 40 deletions(-) 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 b/afl/install-root index 82fb914..62cc64b 100755 --- a/afl/install-root +++ b/afl/install-root @@ -1,4 +1,16 @@ #!/bin/bash -e -apt-get -y build-dep qemu -apt-get -y install bison +case "$DISTRI" in + "debian") + apt-get -y build-dep qemu + apt-get -y install bison + ;; + "archlinux") + pacman -Syu --noconfirm bison + pacman -Syu --noconfirm qemu + ;; + *) + echo "Unkown distribution" + exit 1 + ;; +esac diff --git a/bin/manage-tools b/bin/manage-tools index 3f1166d..5d98a73 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -1,4 +1,5 @@ #!/bin/bash -e +# set -evx function usage() { @@ -6,21 +7,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 +28,99 @@ 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 + echo "debian" + else + echo "" + fi +} + + +function base_build_setup_ubuntu() +{ + PACKAGE_REQS="build-essential libtool g++ gcc linuxtexinfo 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 + 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" + if [ "$ALLOW_SUDO" -eq 1 ]; then + sudo pacman -Syu --noconfirm $PACKAGE_REQS + sudo pacman -Syu --noconfirm 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() +{ + if which apt-get; then + base_build_setup_ubuntu + elif which pacman; then + base_build_setup_arch + else + TOOL=SETUP tool_log "Cannot detect or unsupported distribution" + fi +} + + + +DISTRI=$(detect_distribution) + while [[ $1 == -* ]] do case $1 in @@ -65,28 +156,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 + base_build_setup echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.bashrc if [ -e ~/.zshrc ] @@ -118,8 +189,10 @@ 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 + if [ -x ./install-root -a "$ALLOW_SUDO" -eq 1 ]; then + sudo env DISTRI=$DISTRI ./install-root >> install.log 2>&1 + fi + if env DISTRI=$DISTRI ./install >>install.log 2>&1 then tool_log "install finished" else diff --git a/crosstool/install-root b/crosstool/install-root index b9e870d..cbb84a3 100755 --- a/crosstool/install-root +++ b/crosstool/install-root @@ -1,3 +1,13 @@ #!/bin/bash -e -apt-get install -y gperf flex bison help2man gawk libncurses5-dev +case "$DISTRI" in + debian) + apt-get install -y gperf flex bison help2man gawk libncurses5-dev + ;; + archlinux) + pacman -Syu --noconfirm gperf flex bison help2man gawk ncurses + ;; + *) + echo "Unsupported distro" + ;; +esac diff --git a/hash-identifier/install-root b/hash-identifier/install-root index c9cd9b3..4f93a7f 100755 --- a/hash-identifier/install-root +++ b/hash-identifier/install-root @@ -1,3 +1,11 @@ #!/bin/bash -e -apt-get -y install tofrodos +case "$DISTRI" in + debian) + apt-get -y install tofrodos + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac From b84c8f9b06b578f7ff2bfe032d3db0a4254aed0b Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:15:28 +0100 Subject: [PATCH 18/57] Added pwndbg gdb plugin. Adapted peda install to allow switching. gdb now doesn't automatically load peda or pwndbg, instead provide init-X function and provide wrapper scripts --- peda/install | 26 +++++++++++++++++++++++++- pwndbg/install | 29 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 pwndbg/install diff --git a/peda/install b/peda/install index 8a0c4a5..daf4987 100755 --- a/peda/install +++ b/peda/install @@ -1,5 +1,29 @@ #!/bin/bash +set -eu -o pipefail git clone --depth 1 https://github.com/longld/peda.git + +mkdir bin +cat > bin/gdb-peda <> ~/.gdbinit +#echo "source $PWD/peda.py" >> ~/.gdbinit +if ! grep "init-peda" ~/.gdbinit; then + cat >> ~/.gdbinit <> bin/pwndbg <> ~/.gdbinit < Date: Thu, 18 Feb 2016 16:33:31 +0100 Subject: [PATCH 19/57] Introduced install possibility via python virtualenv and pip and switched pwntools and binjitsu to it --- bin/ctf-tools-pip | 34 ++++++++++++++++++++++++++++++++++ bin/ctf-tools-pip3 | 1 + binjitsu/install | 3 +++ binjitsu/install-root | 17 +++++++++++++++++ binjitsu/uninstall | 3 +++ pwntools/install | 28 +--------------------------- pwntools/install-root | 17 ++++++++++++++--- pwntools/uninstall | 3 +++ 8 files changed, 76 insertions(+), 30 deletions(-) create mode 100755 bin/ctf-tools-pip create mode 120000 bin/ctf-tools-pip3 create mode 100755 binjitsu/install create mode 100755 binjitsu/install-root create mode 100755 binjitsu/uninstall create mode 100755 pwntools/uninstall diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip new file mode 100755 index 0000000..7e038ef --- /dev/null +++ b/bin/ctf-tools-pip @@ -0,0 +1,34 @@ +#!/bin/bash +set -e -o pipefail + +PY_VERSION=2 +if [[ "$0" =~ \.+pip3 ]]; then + PY_VERSION=3 +fi +if [[ "$0" =~ \.+pip2 ]]; then + PY_VERSION=2 +fi + +CTF_TOOLS_VE="ctftools" +if [[ "PY_VERSION" -eq 3 ]]; then + CTF_TOOLS_VE="${CTF_TOOLS_VE}3" +fi + +export WORKON_HOME=~/.virtualenvs +if [[ ! -d "$WORKON_HOME" ]]; then + mkdir -p "$WORKON_HOME" +fi +export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 + +source $(which virtualenvwrapper.sh) + +if ! workon "$CTF_TOOLS_VE" 2>&1 1>/dev/null; then + echo "#### Creating python#PY_VERSION virtualenv '$CTF_TOOLS_VE' ####" >&2 + # for some reason mkvirtualenv returns non-zero even if it + # succeeds? + mkvirtualenv -p $(which "python$PY_VERSION") "$CTF_TOOLS_VE" || true + echo "#### Switching to '$CTF_TOOLS_VE' virtualenv" >&2 + workon "$CTF_TOOLS_VE" || (deactivate && workon "$CTF_TOOLS_VE") +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/binjitsu/install b/binjitsu/install new file mode 100755 index 0000000..3b52a09 --- /dev/null +++ b/binjitsu/install @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip install --upgrade 'git+https://github.com/binjitsu/binjitsu.git' diff --git a/binjitsu/install-root b/binjitsu/install-root new file mode 100755 index 0000000..a6e5448 --- /dev/null +++ b/binjitsu/install-root @@ -0,0 +1,17 @@ +#!/bin/bash -e + +case "$DISTRI" in + "debian") + apt-add-repository -y ppa:pwntools/binutils + apt-get update + apt-get -y install binutils-.*-linux-gnu + ;; + "archlinux") + pacman -Syu --noconfirm binutils + ;; + *) + echo "Unknown distribution" + exit 1 + ;; +esac + diff --git a/binjitsu/uninstall b/binjitsu/uninstall new file mode 100755 index 0000000..f54f29d --- /dev/null +++ b/binjitsu/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall binjitsu diff --git a/pwntools/install b/pwntools/install index 4ca2f02..aa8ca1f 100755 --- a/pwntools/install +++ b/pwntools/install @@ -1,30 +1,4 @@ #!/bin/bash -e # pwnutils -git clone --depth 1 https://github.com/Gallopsled/pwntools.git -cd pwntools -pip install -r requirements.txt -cd .. - -# binutils -#curl https://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.gz | tar xz -#mkdir binutils-build -#cd binutils-build -#export AR=ar -#export AS=as -#../binutils-2.25/configure --prefix=$(dirname $PWD)/binutils-inst --enable-multilib -#make -j $(nproc) -#make install - -mkdir -p bin -cd bin -for i in $(yes n | pip uninstall pwntools | grep bin) -do - mv $i $(basename $i).real - cat < $(basename $i) -#!/bin/bash -PATH=/usr/bin:\$PATH $PWD/$(basename $i).real "\$@" -END - chmod 755 $(basename $i) -done -cd .. +ctf-tools-pip install --upgrade 'git+https://github.com/Gallopsled/pwntools.git' diff --git a/pwntools/install-root b/pwntools/install-root index fe5aa41..a6e5448 100755 --- a/pwntools/install-root +++ b/pwntools/install-root @@ -1,6 +1,17 @@ #!/bin/bash -e -apt-add-repository -y ppa:pwntools/binutils -apt-get update -apt-get -y install binutils-.*-linux-gnu +case "$DISTRI" in + "debian") + apt-add-repository -y ppa:pwntools/binutils + apt-get update + apt-get -y install binutils-.*-linux-gnu + ;; + "archlinux") + pacman -Syu --noconfirm binutils + ;; + *) + echo "Unknown distribution" + exit 1 + ;; +esac diff --git a/pwntools/uninstall b/pwntools/uninstall new file mode 100755 index 0000000..0bd6a4b --- /dev/null +++ b/pwntools/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall pwntools || true From 7df5ad8de075143a2351e1c323ba21d4b7520e57 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:35:43 +0100 Subject: [PATCH 20/57] uninstall scripts should also be allowed in gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d437588..c0af44d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ */* bin/* !*/install +!*/uninstall !*/install-root !*/upgrade !*/test From 720061723fecb49d9f1f5f8f42725a0419baab5e Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:51:25 +0100 Subject: [PATCH 21/57] hashpump arch support --- hashpump/install-root | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hashpump/install-root b/hashpump/install-root index 3db9f51..0642294 100755 --- a/hashpump/install-root +++ b/hashpump/install-root @@ -1,3 +1,14 @@ #!/bin/bash -e -apt-get -y install libssl-dev +case "$DISTRI" in + debian) + apt-get -y install libssl-dev + ;; + archlinux) + pacman -Syu --noconfirm openssl + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac From bd7ce8f50be8729d1e08148f418841680b168970 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:51:42 +0100 Subject: [PATCH 22/57] switches to ctf-pip tool --- hashpump/install | 2 +- python-paddingoracle/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hashpump/install b/hashpump/install index 94b164f..8db51db 100755 --- a/hashpump/install +++ b/hashpump/install @@ -5,7 +5,7 @@ cd HashPump make -j $(nproc) cd .. -pip install -e HashPump +ctf-tools-pip install --upgrade -e HashPump mkdir bin cd bin 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 From f148451933eb8081f2655d26637535532425a570 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 16:55:34 +0100 Subject: [PATCH 23/57] mitmproxy installation --- mitmproxy/install | 3 +++ mitmproxy/uninstall | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 mitmproxy/install create mode 100755 mitmproxy/uninstall diff --git a/mitmproxy/install b/mitmproxy/install new file mode 100755 index 0000000..e9a0c83 --- /dev/null +++ b/mitmproxy/install @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip install --upgrade mitmproxy diff --git a/mitmproxy/uninstall b/mitmproxy/uninstall new file mode 100755 index 0000000..22f45db --- /dev/null +++ b/mitmproxy/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall mitmproxy || true From 8104138a8f17a216ad41f07a458c212f29b150e5 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 17:09:37 +0100 Subject: [PATCH 24/57] fixed python3 virtualenv support in pip wrapper, foresight via pip/virtualenv install --- bin/ctf-tools-pip | 7 +++++-- foresight/install | 12 +----------- foresight/uninstall | 3 +++ 3 files changed, 9 insertions(+), 13 deletions(-) create mode 100755 foresight/uninstall diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip index 7e038ef..c9b3f95 100755 --- a/bin/ctf-tools-pip +++ b/bin/ctf-tools-pip @@ -1,11 +1,14 @@ #!/bin/bash set -e -o pipefail +#set -x +# let's stick with python 2 as default PY_VERSION=2 -if [[ "$0" =~ \.+pip3 ]]; then +# check this scripts file ending +if [[ "$0" =~ pip3 ]]; then PY_VERSION=3 fi -if [[ "$0" =~ \.+pip2 ]]; then +if [[ "$0" =~ pip2 ]]; then PY_VERSION=2 fi 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..a558926 --- /dev/null +++ b/foresight/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip3 uninstall foresight || true From 8f9632bead9a5293dd91c214035298a2d7c64d4f Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 18 Feb 2016 17:15:44 +0100 Subject: [PATCH 25/57] added -y switches to uninstall --- binjitsu/uninstall | 2 +- foresight/uninstall | 2 +- mitmproxy/uninstall | 2 +- pwntools/uninstall | 2 +- xortool/install | 8 +------- xortool/uninstall | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/binjitsu/uninstall b/binjitsu/uninstall index f54f29d..81cc9b9 100755 --- a/binjitsu/uninstall +++ b/binjitsu/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -ctf-tools-pip uninstall binjitsu +ctf-tools-pip uninstall -y binjitsu || true diff --git a/foresight/uninstall b/foresight/uninstall index a558926..2849572 100755 --- a/foresight/uninstall +++ b/foresight/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -ctf-tools-pip3 uninstall foresight || true +ctf-tools-pip3 uninstall -y foresight || true diff --git a/mitmproxy/uninstall b/mitmproxy/uninstall index 22f45db..3ca4c72 100755 --- a/mitmproxy/uninstall +++ b/mitmproxy/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -ctf-tools-pip uninstall mitmproxy || true +ctf-tools-pip uninstall -y mitmproxy || true diff --git a/pwntools/uninstall b/pwntools/uninstall index 0bd6a4b..a54b1fd 100755 --- a/pwntools/uninstall +++ b/pwntools/uninstall @@ -1,3 +1,3 @@ #!/bin/bash -e -ctf-tools-pip uninstall pwntools || true +ctf-tools-pip uninstall -y pwntools || true 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 From 681e5a1f7a01718a2608b6ab8baa466b128bd7b8 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Fri, 1 Apr 2016 10:46:58 +0200 Subject: [PATCH 26/57] base_build_setup has distribution as argument now --- bin/manage-tools | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/bin/manage-tools b/bin/manage-tools index 5d98a73..d9dead2 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -108,13 +108,16 @@ EOF function base_build_setup() { - if which apt-get; then - base_build_setup_ubuntu - elif which pacman; then - base_build_setup_arch - else - TOOL=SETUP tool_log "Cannot detect or unsupported distribution" - fi + case "$1" in + "ubuntu") + base_build_setup_ubuntu + ;; + "archlinux") + base_build_setup_arch + ;; + *) + TOOL=SETUP tool_log "Cannot detect or unsupported distribution" + esac } @@ -157,13 +160,17 @@ cd $(dirname "${BASH_SOURCE[0]}")/.. case $ACTION in setup) - base_build_setup + base_build_setup "$DISTRI" echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.bashrc - if [ -e ~/.zshrc ] - then + if [ -e ~/.zshrc ] + then echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc - fi + fi + + if [ -e ~/.config/fish/config.fish ]; then + echo "set -x PATH $PATH $PWD/bin" >> ~/.config/fish/config.fish + fi ;; list) From a5110e183121d3852857e98bf4307b65d7bf4354 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Fri, 1 Apr 2016 10:47:02 +0200 Subject: [PATCH 27/57] added "" to "$@" --- peda/install | 2 +- pwndbg/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 pwndbg/install diff --git a/peda/install b/peda/install index daf4987..a030946 100755 --- a/peda/install +++ b/peda/install @@ -6,7 +6,7 @@ git clone --depth 1 https://github.com/longld/peda.git mkdir bin cat > bin/gdb-peda <> bin/pwndbg < Date: Fri, 1 Apr 2016 11:18:36 +0200 Subject: [PATCH 28/57] Added GEF (GDB Enhanced Features) for debugging non x86 binaries --- gef/install | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 gef/install 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 < Date: Wed, 4 May 2016 19:55:11 +0200 Subject: [PATCH 29/57] fixed QEMU install on systems where python -> python3 --- qemu/install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu/install b/qemu/install index d4f8db4..4ea9b2b 100755 --- a/qemu/install +++ b/qemu/install @@ -2,6 +2,10 @@ curl http://wiki.qemu-project.org/download/qemu-2.4.0.1.tar.bz2 | tar xj cd qemu-2.4.0.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 From 2dd9da840c0c7528c4f7d6a2ed453d2b7921491b Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 4 May 2016 19:56:08 +0200 Subject: [PATCH 30/57] Added beef installation --- beef/install | 6 ++++++ beef/install-root | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 beef/install create mode 100644 beef/install-root diff --git a/beef/install b/beef/install new file mode 100644 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 b/beef/install-root new file mode 100644 index 0000000..c0f6bff --- /dev/null +++ b/beef/install-root @@ -0,0 +1,24 @@ +#!/bin/bash -e + +case "$DISTRI" in + debian) + 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 + ;; + archlinux) + pacman -Syu --noconfirm --needed \ + ruby python2 ruby-bundler \ + git make gcc openssl patch readline \ + zlib libyaml libffi bzip2 autoconf automake \ + libtool bison sqlite + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac From 3947de9d293624f5136ad087fb24292541744763 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 4 May 2016 19:56:30 +0200 Subject: [PATCH 31/57] Added QEMU install-root for python2 dependency --- qemu/install-root | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 qemu/install-root diff --git a/qemu/install-root b/qemu/install-root new file mode 100755 index 0000000..a6dd7df --- /dev/null +++ b/qemu/install-root @@ -0,0 +1,13 @@ +#!/bin/bash -e + +case "$DISTRI" in + debian) + ;; + archlinux) + pacman -Syu --noconfirm --needed python2 + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac From c77bd2558bbad90962bad063e83d29a662a06ff8 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 4 May 2016 19:56:51 +0200 Subject: [PATCH 32/57] updated binjitsu install --- binjitsu/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/binjitsu/install b/binjitsu/install index 3b52a09..f75c139 100755 --- a/binjitsu/install +++ b/binjitsu/install @@ -1,3 +1,5 @@ #!/bin/bash -e -ctf-tools-pip install --upgrade 'git+https://github.com/binjitsu/binjitsu.git' +#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 From f7eee72e119a5f26a4ea68c23e5c5d46debc8c3c Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 1 Jun 2016 13:29:15 +0200 Subject: [PATCH 33/57] Copied new pwntools/install-root to binjitsu, they probably have the same deps --- binjitsu/install-root | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binjitsu/install-root b/binjitsu/install-root index a6e5448..a809662 100755 --- a/binjitsu/install-root +++ b/binjitsu/install-root @@ -4,10 +4,10 @@ case "$DISTRI" in "debian") apt-add-repository -y ppa:pwntools/binutils apt-get update - apt-get -y install binutils-.*-linux-gnu + apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev ;; "archlinux") - pacman -Syu --noconfirm binutils + pacman -Syu --noconfirm --needed binutils openssl libffi ;; *) echo "Unknown distribution" From fb29febc61fc1d9fc31c8e89f3db4a18ab4edc6d Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 1 Jun 2016 13:29:53 +0200 Subject: [PATCH 34/57] added missing uninstall scripts for tools installed via pip --- hashpump/uninstall | 3 +++ python-paddingoracle/uninstall | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 hashpump/uninstall create mode 100755 python-paddingoracle/uninstall diff --git a/hashpump/uninstall b/hashpump/uninstall new file mode 100755 index 0000000..ecc2944 --- /dev/null +++ b/hashpump/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -e + +ctf-tools-pip uninstall -y hashpumpy || true 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 From ab6c90eaabafe6edd100d7e374f87fd74d0f86ea Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 1 Jun 2016 13:51:19 +0200 Subject: [PATCH 35/57] apparently dirs3arch was renamed to dirsearch --- dirs3arch/install | 7 ------- dirsearch/install | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100755 dirs3arch/install create mode 100755 dirsearch/install 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 . From 6dd094a8a97be0d80eadeca2470293087bd29c23 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 1 Jun 2016 13:55:49 +0200 Subject: [PATCH 36/57] manage-tools script contained some git merge artifacts, which broke the script --- bin/manage-tools | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/manage-tools b/bin/manage-tools index 6d44166..eb7d30a 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -162,14 +162,10 @@ case $ACTION in base_build_setup "$DISTRI" -<<<<<<< HEAD echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.bashrc + if [ -e ~/.zshrc ] then -======= - if [ -e ~/.zshrc ] - then ->>>>>>> 82571b6917b6dbb212e722d35c6f7d2d99b7e0cb echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc fi From 98c76cefdee289e477baac6960f9ef6fabad848c Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 1 Jun 2016 15:00:45 +0200 Subject: [PATCH 37/57] fixed weird indentation fails and added 'set -eu -o pipefail' at the top of the script --- bin/manage-tools | 98 ++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/bin/manage-tools b/bin/manage-tools index eb7d30a..07dc4c3 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -1,5 +1,6 @@ -#!/bin/bash -e -# set -evx +#!/bin/bash +set -eu -o pipefail +# set -x function usage() { @@ -43,66 +44,63 @@ function detect_distribution() function base_build_setup_ubuntu() { - PACKAGE_REQS="build-essential libtool g++ gcc linuxtexinfo 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 + PACKAGE_REQS="build-essential libtool g++ gcc linuxtexinfo 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 - else - TOOL=SETUP tool_log "Certain tools need i386 libraries (enable with 'dpkg --add-architecture i386; apt-get update')." - 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" - if [ "$ALLOW_SUDO" -eq 1 ]; then - sudo pacman -Syu --noconfirm $PACKAGE_REQS - sudo pacman -Syu --noconfirm base-devel || true - else - TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS" - fi + PACKAGE_REQS="curl wget python2 python3 git subversion unzip" + if [ "$ALLOW_SUDO" -eq 1 ]; then + sudo pacman -Syu --noconfirm $PACKAGE_REQS + sudo pacman -Syu --noconfirm 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; 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 + if [ "$ALLOW_SUDO" -eq 1 ] \ + && grep "^\[multilib\]$" /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 } From dc12d48e6b1bb4d11b019119be7abbc3b75ad9a8 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 1 Jun 2016 15:01:43 +0200 Subject: [PATCH 38/57] Added check for install-root failure --- bin/manage-tools | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/manage-tools b/bin/manage-tools index 07dc4c3..66b4714 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -196,7 +196,12 @@ case $ACTION in tool_log "starting install, logging to $PWD/install.log" rm -f install.log if [ -x ./install-root -a "$ALLOW_SUDO" -eq 1 ]; then - sudo env DISTRI=$DISTRI ./install-root >> install.log 2>&1 + if ! sudo env DISTRI=$DISTRI ./install-root >> install.log 2>&1; + then + tool_log "INSTALL FAILED" + cat install.log >&2 + exit 1 + fi fi if env DISTRI=$DISTRI ./install >>install.log 2>&1 then From 54c8472ebc3c55d81ff5665345492746cce63539 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 1 Jun 2016 15:14:32 +0200 Subject: [PATCH 39/57] Bulk updated install-root scripts to check $DISTRI env variable --- android-sdk/install-root | 16 +++++++++++++++- angr/install-root | 25 ++++++++++++++++++++----- apktool/install-root | 17 +++++++++++++++-- barf/install-root | 17 ++++++++++++++++- bindead/install-root | 17 ++++++++++++++++- burpsuite/install-root | 16 +++++++++++++++- codereason/install-root | 19 +++++++++++++++++-- df/install-root | 17 ++++++++++++++++- dirb/install-root | 19 +++++++++++++++++-- dislocker/install-root | 17 ++++++++++++++++- elfparser/install-root | 19 +++++++++++++++++-- firmware-mod-kit/install-root | 17 ++++++++++++++++- gdb/install-root | 17 ++++++++++++++++- hashpump-partialhash/install-root | 16 ++++++++++++++-- hashpump/install-root | 3 ++- honggfuzz/install-root | 19 +++++++++++++++++-- littleblackbox/install-root | 19 +++++++++++++++++-- msieve/install-root | 19 +++++++++++++++++-- panda/install-root | 20 +++++++++++++++++++- pathgrind/install-root | 19 +++++++++++++++++-- qira/install-root | 25 ++++++++++++++++++++----- snowman/install-root | 17 ++++++++++++++++- sonic-visualizer/install-root | 19 +++++++++++++++++-- sqlmap/install-root | 14 +++++++++++++- sslsplit/install-root | 19 +++++++++++++++++-- stegdetect/install-root | 19 +++++++++++++++++-- 26 files changed, 415 insertions(+), 46 deletions(-) mode change 100644 => 100755 apktool/install-root diff --git a/android-sdk/install-root b/android-sdk/install-root index 543a914..1c59f5e 100755 --- a/android-sdk/install-root +++ b/android-sdk/install-root @@ -1 +1,15 @@ -apt-get -y install openjdk-7-jre openjdk-7-jdk +#!/bin/bash +set -eu -o pipefail + +case "$DISTRI" in + "debian") + apt-get -y install openjdk-7-jre openjdk-7-jdk + ;; + "archlinux") + pacman -Syu --noconfirm --needed jre7-openjdk jdk7-openjdk + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/angr/install-root b/angr/install-root index f7ac0b6..9710975 100755 --- a/angr/install-root +++ b/angr/install-root @@ -1,7 +1,22 @@ -#!/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 +case "$DISTRI" in + "debian") -# for angr-management -apt-get -y install python-qt4 python-sip python-pygraphviz + # 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 + + # for angr-management + apt-get -y install python-qt4 python-sip python-pygraphviz + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/apktool/install-root b/apktool/install-root old mode 100644 new mode 100755 index ee9ef42..d9b372a --- a/apktool/install-root +++ b/apktool/install-root @@ -1,2 +1,15 @@ -apt-get update -apt-get install -y default-jre +#!/bin/bash +set -eu -o pipefail + +case "$DISTRI" in + "debian") + apt-get install -y default-jre + ;; + "archlinux") + pacman -Syu --noconfirm --needed jre8-openjdk + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/barf/install-root b/barf/install-root index ee4aee2..a0fa64f 100755 --- a/barf/install-root +++ b/barf/install-root @@ -1,3 +1,18 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install binutils-multiarch-dev +case "$DISTRI" in + "debian") + + apt-get -y install binutils-multiarch-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/bindead/install-root b/bindead/install-root index cdb4468..cdfe8fe 100755 --- a/bindead/install-root +++ b/bindead/install-root @@ -1,3 +1,18 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install maven libprotobuf-dev openjdk-7-jre openjdk-7-jdk +case "$DISTRI" in + "debian") + + apt-get -y install maven libprotobuf-dev openjdk-7-jre openjdk-7-jdk + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/burpsuite/install-root b/burpsuite/install-root index 91c2df5..c3a4dcf 100755 --- a/burpsuite/install-root +++ b/burpsuite/install-root @@ -1,3 +1,17 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install openjdk-7-jre +case "$DISTRI" in + "debian") + + apt-get -y install openjdk-7-jre + ;; + "archlinux") + + pacman -Syu --noconfirm --needed jre7-openjdk + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/codereason/install-root b/codereason/install-root index 162c938..8e10a4e 100755 --- a/codereason/install-root +++ b/codereason/install-root @@ -1,3 +1,18 @@ -#!/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 +case "$DISTRI" in + "debian") + + 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 + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/df/install-root b/df/install-root index a312999..5534a50 100755 --- a/df/install-root +++ b/df/install-root @@ -1,3 +1,18 @@ #!/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 +case "$DISTRI" in + "debian") + + 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 + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/dirb/install-root b/dirb/install-root index a86ca60..3438811 100755 --- a/dirb/install-root +++ b/dirb/install-root @@ -1,3 +1,18 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get -y install libcurl4-gnutls-dev +case "$DISTRI" in + "debian") + + apt-get -y install libcurl4-gnutls-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/dislocker/install-root b/dislocker/install-root index 3b9ff3f..a18bd26 100755 --- a/dislocker/install-root +++ b/dislocker/install-root @@ -1,3 +1,18 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install libfuse-dev libpolarssl-dev +case "$DISTRI" in + "debian") + + apt-get -y install libfuse-dev libpolarssl-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/elfparser/install-root b/elfparser/install-root index 49755cb..baf069c 100755 --- a/elfparser/install-root +++ b/elfparser/install-root @@ -1,3 +1,18 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get install -y libqt5widgets5 +case "$DISTRI" in + "debian") + + apt-get install -y libqt5widgets5 + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/firmware-mod-kit/install-root b/firmware-mod-kit/install-root index c38d2f4..ccbd1c7 100755 --- a/firmware-mod-kit/install-root +++ b/firmware-mod-kit/install-root @@ -1,3 +1,18 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install liblzma-dev python-magic zlib1g-dev +case "$DISTRI" in + "debian") + + apt-get -y install liblzma-dev python-magic zlib1g-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/gdb/install-root b/gdb/install-root index 2b3ebf2..6c580ab 100755 --- a/gdb/install-root +++ b/gdb/install-root @@ -1,3 +1,18 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install texinfo +case "$DISTRI" in + "debian") + + apt-get -y install texinfo + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/hashpump-partialhash/install-root b/hashpump-partialhash/install-root index 3db9f51..38e6305 100755 --- a/hashpump-partialhash/install-root +++ b/hashpump-partialhash/install-root @@ -1,3 +1,15 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get -y install libssl-dev +case "$DISTRI" in + debian) + apt-get -y install libssl-dev + ;; + archlinux) + pacman -Syu --noconfirm openssl + ;; + *) + echo "Unsupported distribution" + exit 1 + ;; +esac diff --git a/hashpump/install-root b/hashpump/install-root index 0642294..38e6305 100755 --- a/hashpump/install-root +++ b/hashpump/install-root @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail case "$DISTRI" in debian) diff --git a/honggfuzz/install-root b/honggfuzz/install-root index b9662a2..9777066 100755 --- a/honggfuzz/install-root +++ b/honggfuzz/install-root @@ -1,3 +1,18 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get install libbfd-dev libunwind8-dev +case "$DISTRI" in + "debian") + + apt-get install libbfd-dev libunwind8-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/littleblackbox/install-root b/littleblackbox/install-root index 2e551a9..37cc867 100755 --- a/littleblackbox/install-root +++ b/littleblackbox/install-root @@ -1,3 +1,18 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get -y install libssl-dev libpcap-dev libsqlite3-dev +case "$DISTRI" in + "debian") + + apt-get -y install libssl-dev libpcap-dev libsqlite3-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/msieve/install-root b/msieve/install-root index 5949ced..56cf375 100755 --- a/msieve/install-root +++ b/msieve/install-root @@ -1,3 +1,18 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get -y install libgmp3-dev libgmp-dev +case "$DISTRI" in + "debian") + + apt-get -y install libgmp3-dev libgmp-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/panda/install-root b/panda/install-root index 0bdd410..6caa864 100755 --- a/panda/install-root +++ b/panda/install-root @@ -1 +1,19 @@ -apt-get -y install nasm libssl-dev libpcap-dev subversion curl autoconf libtool libc++-dev llvm-3.3-dev clang-3.3 unzip +#!/bin/bash +set -eu -o pipefail + +case "$DISTRI" in + "debian") + + apt-get -y install nasm libssl-dev libpcap-dev subversion curl \ + autoconf libtool libc++-dev llvm-3.3-dev clang-3.3 unzip + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/pathgrind/install-root b/pathgrind/install-root index d36ba8d..113b244 100755 --- a/pathgrind/install-root +++ b/pathgrind/install-root @@ -1,3 +1,18 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get -y install libc6-dev-i386 libc6-dev +case "$DISTRI" in + "debian") + + apt-get -y install libc6-dev-i386 libc6-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/qira/install-root b/qira/install-root index fb7c208..a03d9a9 100755 --- a/qira/install-root +++ b/qira/install-root @@ -1,7 +1,22 @@ -#!/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 +case "$DISTRI" in + "debian") -# plugin deps -apt-get -y install libssl1.0.0:i386 + 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 + + # plugin deps + apt-get -y install libssl1.0.0:i386 + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/snowman/install-root b/snowman/install-root index 90a3e8b..c355f2d 100755 --- a/snowman/install-root +++ b/snowman/install-root @@ -1,3 +1,18 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install libboost-dev cmake libqt4-dev +case "$DISTRI" in + "debian") + + apt-get -y install libboost-dev cmake libqt4-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/sonic-visualizer/install-root b/sonic-visualizer/install-root index 7508acd..6e798c3 100755 --- a/sonic-visualizer/install-root +++ b/sonic-visualizer/install-root @@ -1,3 +1,18 @@ -#!/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 +case "$DISTRI" in + "debian") + + 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 + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/sqlmap/install-root b/sqlmap/install-root index eeac131..8fc32b2 100755 --- a/sqlmap/install-root +++ b/sqlmap/install-root @@ -1,3 +1,15 @@ #!/bin/bash +set -eu -o pipefail -apt-get -y install libsqlite3-dev +case "$DISTRI" in + "debian") + apt-get -y install libsqlite3-dev + ;; + "archlinux") + pacman -Syu --noconfirm --needed sqlite + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/sslsplit/install-root b/sslsplit/install-root index 2ac2936..e904418 100755 --- a/sslsplit/install-root +++ b/sslsplit/install-root @@ -1,3 +1,18 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get -y install libevent-dev +case "$DISTRI" in + "debian") + + apt-get -y install libevent-dev + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac diff --git a/stegdetect/install-root b/stegdetect/install-root index f4dd360..8664a04 100755 --- a/stegdetect/install-root +++ b/stegdetect/install-root @@ -1,3 +1,18 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail -apt-get -y install automake1.4 +case "$DISTRI" in + "debian") + + apt-get -y install automake1.4 + ;; + "archlinux") + echo "archlinux is currently not supported!" + echo "Update install-root and do a pull-request ;)" + exit 1 + ;; + *) + echo "Unsupported distribution: ''" + exit 1 + ;; +esac From a6d7d930c92f59d19bb135b4d34e0e80d81f4f5a Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 1 Jun 2016 15:43:34 +0200 Subject: [PATCH 40/57] updated readme --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e407b5..c74a782 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. | @@ -112,7 +116,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! From 37e74bef929c2d3c0f685de84dda1f62e7e2c038 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 11:51:59 +0200 Subject: [PATCH 41/57] Added case fallthrough for debian as distri in all install-root scripts. fixed manage-tools and Dockerfile. --- Dockerfile | 4 +--- afl/install-root | 5 ++++- android-sdk/install-root | 2 ++ angr/install-root | 2 ++ apktool/install-root | 2 ++ barf/install-root | 2 ++ beef/install-root | 0 bin/manage-tools | 10 ++++++---- bindead/install-root | 2 ++ binjitsu/install-root | 4 ++++ burpsuite/install-root | 2 ++ codereason/install-root | 2 ++ df/install-root | 2 ++ dirb/install-root | 2 ++ dislocker/install-root | 2 ++ elfparser/install-root | 2 ++ firmware-mod-kit/install-root | 2 ++ gdb/install-root | 2 ++ honggfuzz/install-root | 2 ++ littleblackbox/install-root | 2 ++ msieve/install-root | 2 ++ panda/install-root | 2 ++ pathgrind/install-root | 2 ++ pwntools/install-root | 4 ++++ qira/install-root | 2 ++ snowman/install-root | 2 ++ sonic-visualizer/install-root | 2 ++ sqlmap/install-root | 2 ++ sslsplit/install-root | 2 ++ stegdetect/install-root | 2 ++ 30 files changed, 67 insertions(+), 8 deletions(-) mode change 100644 => 100755 beef/install-root diff --git a/Dockerfile b/Dockerfile index 5edfec5..cbb65c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,9 +14,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/afl/install-root b/afl/install-root index 62cc64b..1880c72 100755 --- a/afl/install-root +++ b/afl/install-root @@ -1,6 +1,9 @@ -#!/bin/bash -e +#!/bin/bash +set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y build-dep qemu apt-get -y install bison diff --git a/android-sdk/install-root b/android-sdk/install-root index 1c59f5e..90f3d8a 100755 --- a/android-sdk/install-root +++ b/android-sdk/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install openjdk-7-jre openjdk-7-jdk ;; diff --git a/angr/install-root b/angr/install-root index 9710975..0f80b70 100755 --- a/angr/install-root +++ b/angr/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") # for angr diff --git a/apktool/install-root b/apktool/install-root index d9b372a..e48302f 100755 --- a/apktool/install-root +++ b/apktool/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get install -y default-jre ;; diff --git a/barf/install-root b/barf/install-root index a0fa64f..29e3651 100755 --- a/barf/install-root +++ b/barf/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install binutils-multiarch-dev diff --git a/beef/install-root b/beef/install-root old mode 100644 new mode 100755 diff --git a/bin/manage-tools b/bin/manage-tools index 66b4714..4046a78 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -42,9 +42,9 @@ function detect_distribution() } -function base_build_setup_ubuntu() +function base_build_setup_debian() { - PACKAGE_REQS="build-essential libtool g++ gcc linuxtexinfo curl wget automake autoconf python-dev git subversion unzip" + PACKAGE_REQS="build-essential libtool g++ gcc linuxtexinfo 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 @@ -70,7 +70,7 @@ function base_build_setup_ubuntu() function base_build_setup_arch() { - PACKAGE_REQS="curl wget python2 python3 git subversion unzip" + PACKAGE_REQS="curl wget python2 python3 git subversion unzip python-virtualenvwrapper" if [ "$ALLOW_SUDO" -eq 1 ]; then sudo pacman -Syu --noconfirm $PACKAGE_REQS sudo pacman -Syu --noconfirm base-devel || true @@ -108,7 +108,9 @@ function base_build_setup() { case "$1" in "ubuntu") - base_build_setup_ubuntu + ;& # fallthrough + "debian") + base_build_setup_debian ;; "archlinux") base_build_setup_arch diff --git a/bindead/install-root b/bindead/install-root index cdfe8fe..326f6c8 100755 --- a/bindead/install-root +++ b/bindead/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install maven libprotobuf-dev openjdk-7-jre openjdk-7-jdk diff --git a/binjitsu/install-root b/binjitsu/install-root index a809662..d38ef6f 100755 --- a/binjitsu/install-root +++ b/binjitsu/install-root @@ -2,6 +2,10 @@ case "$DISTRI" in "debian") + echo "Need pwntools compatible binutils from PPA" + exit 1 + ;; + "ubuntu") apt-add-repository -y ppa:pwntools/binutils apt-get update apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev diff --git a/burpsuite/install-root b/burpsuite/install-root index c3a4dcf..7716f83 100755 --- a/burpsuite/install-root +++ b/burpsuite/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install openjdk-7-jre diff --git a/codereason/install-root b/codereason/install-root index 8e10a4e..2c2eaeb 100755 --- a/codereason/install-root +++ b/codereason/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") 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/df/install-root b/df/install-root index 5534a50..f068a62 100755 --- a/df/install-root +++ b/df/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") 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 b/dirb/install-root index 3438811..f1c077f 100755 --- a/dirb/install-root +++ b/dirb/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install libcurl4-gnutls-dev diff --git a/dislocker/install-root b/dislocker/install-root index a18bd26..192ca00 100755 --- a/dislocker/install-root +++ b/dislocker/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install libfuse-dev libpolarssl-dev diff --git a/elfparser/install-root b/elfparser/install-root index baf069c..2ec0020 100755 --- a/elfparser/install-root +++ b/elfparser/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get install -y libqt5widgets5 diff --git a/firmware-mod-kit/install-root b/firmware-mod-kit/install-root index ccbd1c7..67e9306 100755 --- a/firmware-mod-kit/install-root +++ b/firmware-mod-kit/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install liblzma-dev python-magic zlib1g-dev diff --git a/gdb/install-root b/gdb/install-root index 6c580ab..2ef22cb 100755 --- a/gdb/install-root +++ b/gdb/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install texinfo diff --git a/honggfuzz/install-root b/honggfuzz/install-root index 9777066..efde6c4 100755 --- a/honggfuzz/install-root +++ b/honggfuzz/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get install libbfd-dev libunwind8-dev diff --git a/littleblackbox/install-root b/littleblackbox/install-root index 37cc867..bc26fbb 100755 --- a/littleblackbox/install-root +++ b/littleblackbox/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install libssl-dev libpcap-dev libsqlite3-dev diff --git a/msieve/install-root b/msieve/install-root index 56cf375..54775e7 100755 --- a/msieve/install-root +++ b/msieve/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install libgmp3-dev libgmp-dev diff --git a/panda/install-root b/panda/install-root index 6caa864..4cf3f54 100755 --- a/panda/install-root +++ b/panda/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install nasm libssl-dev libpcap-dev subversion curl \ diff --git a/pathgrind/install-root b/pathgrind/install-root index 113b244..8980dcb 100755 --- a/pathgrind/install-root +++ b/pathgrind/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install libc6-dev-i386 libc6-dev diff --git a/pwntools/install-root b/pwntools/install-root index a809662..d38ef6f 100755 --- a/pwntools/install-root +++ b/pwntools/install-root @@ -2,6 +2,10 @@ case "$DISTRI" in "debian") + echo "Need pwntools compatible binutils from PPA" + exit 1 + ;; + "ubuntu") apt-add-repository -y ppa:pwntools/binutils apt-get update apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev diff --git a/qira/install-root b/qira/install-root index a03d9a9..5287b52 100755 --- a/qira/install-root +++ b/qira/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") 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 diff --git a/snowman/install-root b/snowman/install-root index c355f2d..c292cb7 100755 --- a/snowman/install-root +++ b/snowman/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install libboost-dev cmake libqt4-dev diff --git a/sonic-visualizer/install-root b/sonic-visualizer/install-root index 6e798c3..54d93a3 100755 --- a/sonic-visualizer/install-root +++ b/sonic-visualizer/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") 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 b/sqlmap/install-root index 8fc32b2..96986d1 100755 --- a/sqlmap/install-root +++ b/sqlmap/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install libsqlite3-dev ;; diff --git a/sslsplit/install-root b/sslsplit/install-root index e904418..27e9998 100755 --- a/sslsplit/install-root +++ b/sslsplit/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install libevent-dev diff --git a/stegdetect/install-root b/stegdetect/install-root index 8664a04..ef3be8a 100755 --- a/stegdetect/install-root +++ b/stegdetect/install-root @@ -2,6 +2,8 @@ set -eu -o pipefail case "$DISTRI" in + "ubuntu") + ;& # fallthrough "debian") apt-get -y install automake1.4 From ea9b95a996525a96d92f3a8380e6ba0d2c796974 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 12:11:47 +0200 Subject: [PATCH 42/57] fixed unbound variable error --- bin/manage-tools | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/bin/manage-tools b/bin/manage-tools index 4046a78..9f150d0 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -72,8 +72,8 @@ 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 $PACKAGE_REQS - sudo pacman -Syu --noconfirm base-devel || true + 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 @@ -108,7 +108,7 @@ function base_build_setup() { case "$1" in "ubuntu") - ;& # fallthrough + ;& # fallthrough "debian") base_build_setup_debian ;; @@ -121,6 +121,10 @@ function base_build_setup() } +if [[ $# -eq 0 ]]; then + usage + exit 1 +fi DISTRI=$(detect_distribution) @@ -140,8 +144,14 @@ done [ -z "$ALLOW_SUDO" ] && 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 From 910d8c0049a55b0a6b82a10dc0a7d9f6c08ab8a2 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 13:41:29 +0200 Subject: [PATCH 43/57] fixed typo in debian package list --- bin/manage-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/manage-tools b/bin/manage-tools index 9f150d0..7426a7e 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -44,7 +44,7 @@ function detect_distribution() function base_build_setup_debian() { - PACKAGE_REQS="build-essential libtool g++ gcc linuxtexinfo curl wget automake autoconf python python-dev git subversion unzip virtualenvwrapper" + 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 From abf6c16250b01abb762da0d0d4b8960dd842a7ee Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 14:11:09 +0200 Subject: [PATCH 44/57] moved shell path setup into base_build_setup funciton, create py2 virtualenv during install --- bin/manage-tools | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/bin/manage-tools b/bin/manage-tools index 7426a7e..0656e31 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -114,10 +114,27 @@ function base_build_setup() ;; "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 || true } @@ -171,18 +188,6 @@ case $ACTION in setup) base_build_setup "$DISTRI" - - echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.bashrc - - if [ -e ~/.zshrc ] - then - echo "PATH=\"$PWD/bin:\$PATH\"" >> ~/.zshrc - fi - - if [ -e ~/.config/fish/config.fish ]; then - echo "set -x PATH $PATH $PWD/bin" >> ~/.config/fish/config.fish - fi - ;; list) for t in * From 21876d00d7ac4e6fa91da2a932936f0897b5f422 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 15:03:17 +0200 Subject: [PATCH 45/57] Properly source also on ubuntu --- bin/ctf-tools-pip | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip index c9b3f95..430c8c8 100755 --- a/bin/ctf-tools-pip +++ b/bin/ctf-tools-pip @@ -23,7 +23,8 @@ if [[ ! -d "$WORKON_HOME" ]]; then fi export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 -source $(which virtualenvwrapper.sh) +source /etc/bash_completion.d/virtualenvwrapper \ + || source $(which virtualenvwrapper.sh) if ! workon "$CTF_TOOLS_VE" 2>&1 1>/dev/null; then echo "#### Creating python#PY_VERSION virtualenv '$CTF_TOOLS_VE' ####" >&2 From b2288c946d1c082f01153b889dcf7e383c229d6f Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 16:30:14 +0200 Subject: [PATCH 46/57] pipe ./uninstall output to uninstall.log --- bin/manage-tools | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/manage-tools b/bin/manage-tools index 0656e31..3543902 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -235,8 +235,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 .. From 7f4cfe2c574ed1d22f4910dfdb3a03f7b9a26de0 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 16:30:28 +0200 Subject: [PATCH 47/57] fix unbound variable error --- bin/manage-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/manage-tools b/bin/manage-tools index 3543902..e88043a 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -159,7 +159,7 @@ do shift done -[ -z "$ALLOW_SUDO" ] && export ALLOW_SUDO=0 +[[ -z ${ALLOW_SUDO+x} ]] && export ALLOW_SUDO=0 if [[ $# -ge 1 ]]; then ACTION="$1" From 368484543a0342687f86969c80725f5f24d41290 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 16:31:30 +0200 Subject: [PATCH 48/57] drop virtualenvwrapper dependency for ctf-tools-pip, which should make it portable accross ubuntu/arch --- bin/ctf-tools-pip | 31 ++++++++++++++++++------------- bin/manage-tools | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip index 430c8c8..5057859 100755 --- a/bin/ctf-tools-pip +++ b/bin/ctf-tools-pip @@ -1,5 +1,5 @@ #!/bin/bash -set -e -o pipefail +set -eu -o pipefail #set -x # let's stick with python 2 as default @@ -12,27 +12,32 @@ 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 +if [[ $PY_VERSION -eq 3 ]]; then CTF_TOOLS_VE="${CTF_TOOLS_VE}3" fi -export WORKON_HOME=~/.virtualenvs +if [[ -z "${WORKON_HOME+x}" ]]; then + export WORKON_HOME="$HOME/.virtualenvs" +fi if [[ ! -d "$WORKON_HOME" ]]; then mkdir -p "$WORKON_HOME" fi -export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 -source /etc/bash_completion.d/virtualenvwrapper \ - || source $(which virtualenvwrapper.sh) +VE_DIR="$WORKON_HOME/$CTF_TOOLS_VE" -if ! workon "$CTF_TOOLS_VE" 2>&1 1>/dev/null; then - echo "#### Creating python#PY_VERSION virtualenv '$CTF_TOOLS_VE' ####" >&2 - # for some reason mkvirtualenv returns non-zero even if it - # succeeds? - mkvirtualenv -p $(which "python$PY_VERSION") "$CTF_TOOLS_VE" || true - echo "#### Switching to '$CTF_TOOLS_VE' virtualenv" >&2 - workon "$CTF_TOOLS_VE" || (deactivate && workon "$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/manage-tools b/bin/manage-tools index e88043a..9e9a55b 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -134,7 +134,7 @@ function base_build_setup() fi # create the py2 virtualenv - "$PWD/bin/ctf-tools-pip" freeze 2>&1 >/dev/null || true + "$PWD/bin/ctf-tools-pip" freeze 2>&1 >/dev/null } From 402aced1a5150637226b8931fa7e15fce365100b Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Thu, 2 Jun 2016 16:47:30 +0200 Subject: [PATCH 49/57] ok set -u is a bad idea when sourcing activate... --- bin/ctf-tools-pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip index 5057859..a55c6be 100755 --- a/bin/ctf-tools-pip +++ b/bin/ctf-tools-pip @@ -1,5 +1,5 @@ #!/bin/bash -set -eu -o pipefail +set -e -o pipefail #set -x # let's stick with python 2 as default From 1d47962e5853c9cbfd5e28e140859485a5666365 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Mon, 6 Jun 2016 15:11:08 +0200 Subject: [PATCH 50/57] Split install-root scripts into distribution specific ones --- .gitignore | 2 +- afl/install-root | 19 ------------ afl/install-root-archlinux | 4 +++ afl/install-root-debian | 5 ++++ android-sdk/install-root | 17 ----------- android-sdk/install-root-archlinux | 4 +++ android-sdk/install-root-debian | 4 +++ angr/install-root | 24 --------------- angr/install-root-debian | 8 +++++ apktool/install-root | 17 ----------- apktool/install-root-archlinux | 4 +++ apktool/install-root-debian | 4 +++ barf/install-root | 20 ------------- barf/install-root-debian | 4 +++ beef/install | 0 beef/install-root | 24 --------------- beef/install-root-archlinux | 7 +++++ beef/install-root-debian | 9 ++++++ bin/manage-tools | 33 ++++++++++++++++----- bindead/install-root | 20 ------------- bindead/install-root-debian | 4 +++ binjitsu/install-root | 21 ------------- binjitsu/install-root-archlinux | 3 ++ binjitsu/install-root-ubuntu | 5 ++++ burpsuite/install-root | 19 ------------ burpsuite/install-root-archlinux | 4 +++ burpsuite/install-root-debian | 4 +++ codereason/install-root | 20 ------------- codereason/install-root-debian | 4 +++ crosstool/install-root | 13 -------- crosstool/install-root-archlinux | 3 ++ crosstool/install-root-debian | 3 ++ df/install-root | 20 ------------- df/install-root-debian | 4 +++ dirb/install-root | 20 ------------- dirb/install-root-archlinux | 4 +++ dirb/install-root-debian | 4 +++ dislocker/install-root | 20 ------------- dislocker/install-root-archlinux | 4 +++ dislocker/install-root-debian | 4 +++ elfparser/install-root | 20 ------------- elfparser/install-root-debian | 4 +++ firmware-mod-kit/install-root | 20 ------------- firmware-mod-kit/install-root-archlinux | 4 +++ firmware-mod-kit/install-root-debian | 4 +++ gdb/install-root | 20 ------------- gdb/install-root-archlinux | 4 +++ gdb/install-root-debian | 4 +++ hash-identifier/install-root | 11 ------- hash-identifier/install-root-debian | 3 ++ hashpump-partialhash/install-root | 15 ---------- hashpump-partialhash/install-root-archlinux | 4 +++ hashpump-partialhash/install-root-debian | 4 +++ hashpump/install-root | 15 ---------- hashpump/install-root-archlinux | 4 +++ hashpump/install-root-debian | 4 +++ honggfuzz/install-root | 20 ------------- honggfuzz/install-root-archlinux | 5 ++++ honggfuzz/install-root-debian | 4 +++ littleblackbox/install-root | 20 ------------- littleblackbox/install-root-archlinux | 4 +++ littleblackbox/install-root-debian | 4 +++ msieve/install-root | 20 ------------- msieve/install-root-archlinux | 4 +++ msieve/install-root-debian | 4 +++ panda/install-root | 21 ------------- panda/install-root-archlinux | 5 ++++ panda/install-root-debian | 5 ++++ pathgrind/install-root | 20 ------------- pathgrind/install-root-debian | 4 +++ pwntools/install-root | 21 ------------- pwntools/install-root-archlinux | 3 ++ pwntools/install-root-ubuntu | 5 ++++ qemu/install-root | 13 -------- qemu/install-root-archlinux | 3 ++ qemu/install-root-debian | 3 ++ qira/install-root | 24 --------------- qira/install-root-archlinux | 6 ++++ qira/install-root-debian | 8 +++++ snowman/install-root | 20 ------------- snowman/install-root-archlinux | 4 +++ snowman/install-root-debian | 4 +++ sonic-visualizer/install-root | 20 ------------- sonic-visualizer/install-root-archlinux | 6 ++++ sonic-visualizer/install-root-debian | 4 +++ sqlmap/install-root | 17 ----------- sqlmap/install-root-archlinux | 4 +++ sqlmap/install-root-debian | 4 +++ sslsplit/install-root | 20 ------------- sslsplit/install-root-archlinux | 4 +++ sslsplit/install-root-debian | 4 +++ stegdetect/install-root | 20 ------------- stegdetect/install-root-debian | 4 +++ 93 files changed, 273 insertions(+), 640 deletions(-) delete mode 100755 afl/install-root create mode 100755 afl/install-root-archlinux create mode 100755 afl/install-root-debian delete mode 100755 android-sdk/install-root create mode 100755 android-sdk/install-root-archlinux create mode 100755 android-sdk/install-root-debian delete mode 100755 angr/install-root create mode 100755 angr/install-root-debian delete mode 100755 apktool/install-root create mode 100644 apktool/install-root-archlinux create mode 100755 apktool/install-root-debian delete mode 100755 barf/install-root create mode 100755 barf/install-root-debian mode change 100644 => 100755 beef/install delete mode 100755 beef/install-root create mode 100755 beef/install-root-archlinux create mode 100755 beef/install-root-debian delete mode 100755 bindead/install-root create mode 100755 bindead/install-root-debian delete mode 100755 binjitsu/install-root create mode 100755 binjitsu/install-root-archlinux create mode 100755 binjitsu/install-root-ubuntu delete mode 100755 burpsuite/install-root create mode 100755 burpsuite/install-root-archlinux create mode 100755 burpsuite/install-root-debian delete mode 100755 codereason/install-root create mode 100755 codereason/install-root-debian delete mode 100755 crosstool/install-root create mode 100755 crosstool/install-root-archlinux create mode 100755 crosstool/install-root-debian delete mode 100755 df/install-root create mode 100755 df/install-root-debian delete mode 100755 dirb/install-root create mode 100755 dirb/install-root-archlinux create mode 100755 dirb/install-root-debian delete mode 100755 dislocker/install-root create mode 100755 dislocker/install-root-archlinux create mode 100755 dislocker/install-root-debian delete mode 100755 elfparser/install-root create mode 100755 elfparser/install-root-debian delete mode 100755 firmware-mod-kit/install-root create mode 100755 firmware-mod-kit/install-root-archlinux create mode 100755 firmware-mod-kit/install-root-debian delete mode 100755 gdb/install-root create mode 100755 gdb/install-root-archlinux create mode 100755 gdb/install-root-debian delete mode 100755 hash-identifier/install-root create mode 100755 hash-identifier/install-root-debian delete mode 100755 hashpump-partialhash/install-root create mode 100755 hashpump-partialhash/install-root-archlinux create mode 100755 hashpump-partialhash/install-root-debian delete mode 100755 hashpump/install-root create mode 100755 hashpump/install-root-archlinux create mode 100755 hashpump/install-root-debian delete mode 100755 honggfuzz/install-root create mode 100755 honggfuzz/install-root-archlinux create mode 100755 honggfuzz/install-root-debian delete mode 100755 littleblackbox/install-root create mode 100755 littleblackbox/install-root-archlinux create mode 100755 littleblackbox/install-root-debian delete mode 100755 msieve/install-root create mode 100755 msieve/install-root-archlinux create mode 100755 msieve/install-root-debian delete mode 100755 panda/install-root create mode 100755 panda/install-root-archlinux create mode 100755 panda/install-root-debian delete mode 100755 pathgrind/install-root create mode 100755 pathgrind/install-root-debian delete mode 100755 pwntools/install-root create mode 100755 pwntools/install-root-archlinux create mode 100755 pwntools/install-root-ubuntu delete mode 100755 qemu/install-root create mode 100755 qemu/install-root-archlinux create mode 100755 qemu/install-root-debian delete mode 100755 qira/install-root create mode 100755 qira/install-root-archlinux create mode 100755 qira/install-root-debian delete mode 100755 snowman/install-root create mode 100755 snowman/install-root-archlinux create mode 100755 snowman/install-root-debian delete mode 100755 sonic-visualizer/install-root create mode 100755 sonic-visualizer/install-root-archlinux create mode 100755 sonic-visualizer/install-root-debian delete mode 100755 sqlmap/install-root create mode 100755 sqlmap/install-root-archlinux create mode 100755 sqlmap/install-root-debian delete mode 100755 sslsplit/install-root create mode 100755 sslsplit/install-root-archlinux create mode 100755 sslsplit/install-root-debian delete mode 100755 stegdetect/install-root create mode 100755 stegdetect/install-root-debian diff --git a/.gitignore b/.gitignore index c0af44d..27ee96f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ bin/* !*/install !*/uninstall -!*/install-root +!*/install-root-* !*/upgrade !*/test diff --git a/afl/install-root b/afl/install-root deleted file mode 100755 index 1880c72..0000000 --- a/afl/install-root +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - apt-get -y build-dep qemu - apt-get -y install bison - ;; - "archlinux") - pacman -Syu --noconfirm bison - pacman -Syu --noconfirm qemu - ;; - *) - echo "Unkown distribution" - exit 1 - ;; -esac 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-debian b/afl/install-root-debian new file mode 100755 index 0000000..8ecb18e --- /dev/null +++ b/afl/install-root-debian @@ -0,0 +1,5 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y build-dep qemu +apt-get -y install bison diff --git a/android-sdk/install-root b/android-sdk/install-root deleted file mode 100755 index 90f3d8a..0000000 --- a/android-sdk/install-root +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - apt-get -y install openjdk-7-jre openjdk-7-jdk - ;; - "archlinux") - pacman -Syu --noconfirm --needed jre7-openjdk jdk7-openjdk - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/android-sdk/install-root-debian new file mode 100755 index 0000000..e7ef4c5 --- /dev/null +++ b/android-sdk/install-root-debian @@ -0,0 +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 deleted file mode 100755 index 0f80b70..0000000 --- a/angr/install-root +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - # 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 - - # for angr-management - apt-get -y install python-qt4 python-sip python-pygraphviz - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/angr/install-root-debian b/angr/install-root-debian new file mode 100755 index 0000000..9282191 --- /dev/null +++ b/angr/install-root-debian @@ -0,0 +1,8 @@ +#!/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 + +# for angr-management +apt-get -y install python-qt4 python-sip python-pygraphviz diff --git a/apktool/install-root b/apktool/install-root deleted file mode 100755 index e48302f..0000000 --- a/apktool/install-root +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - apt-get install -y default-jre - ;; - "archlinux") - pacman -Syu --noconfirm --needed jre8-openjdk - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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 deleted file mode 100755 index 29e3651..0000000 --- a/barf/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install binutils-multiarch-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/barf/install-root-debian b/barf/install-root-debian new file mode 100755 index 0000000..6696d43 --- /dev/null +++ b/barf/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install binutils-multiarch-dev diff --git a/beef/install b/beef/install old mode 100644 new mode 100755 diff --git a/beef/install-root b/beef/install-root deleted file mode 100755 index c0f6bff..0000000 --- a/beef/install-root +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -e - -case "$DISTRI" in - debian) - 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 - ;; - archlinux) - pacman -Syu --noconfirm --needed \ - ruby python2 ruby-bundler \ - git make gcc openssl patch readline \ - zlib libyaml libffi bzip2 autoconf automake \ - libtool bison sqlite - ;; - *) - echo "Unsupported distribution" - exit 1 - ;; -esac 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/manage-tools b/bin/manage-tools index 9e9a55b..4396d6c 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -212,14 +212,31 @@ case $ACTION in tool_log "starting install, logging to $PWD/install.log" rm -f install.log - if [ -x ./install-root -a "$ALLOW_SUDO" -eq 1 ]; then - if ! sudo env DISTRI=$DISTRI ./install-root >> install.log 2>&1; - then - tool_log "INSTALL FAILED" - cat install.log >&2 - exit 1 - fi - fi + + # 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" diff --git a/bindead/install-root b/bindead/install-root deleted file mode 100755 index 326f6c8..0000000 --- a/bindead/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install maven libprotobuf-dev openjdk-7-jre openjdk-7-jdk - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/bindead/install-root-debian b/bindead/install-root-debian new file mode 100755 index 0000000..09c3f63 --- /dev/null +++ b/bindead/install-root-debian @@ -0,0 +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-root b/binjitsu/install-root deleted file mode 100755 index d38ef6f..0000000 --- a/binjitsu/install-root +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -e - -case "$DISTRI" in - "debian") - echo "Need pwntools compatible binutils from PPA" - exit 1 - ;; - "ubuntu") - apt-add-repository -y ppa:pwntools/binutils - apt-get update - apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev - ;; - "archlinux") - pacman -Syu --noconfirm --needed binutils openssl libffi - ;; - *) - echo "Unknown distribution" - exit 1 - ;; -esac - 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/binjitsu/install-root-ubuntu b/binjitsu/install-root-ubuntu new file mode 100755 index 0000000..05fdf99 --- /dev/null +++ b/binjitsu/install-root-ubuntu @@ -0,0 +1,5 @@ +#!/bin/bash -e + +apt-add-repository -y ppa:pwntools/binutils +apt-get update +apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev diff --git a/burpsuite/install-root b/burpsuite/install-root deleted file mode 100755 index 7716f83..0000000 --- a/burpsuite/install-root +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install openjdk-7-jre - ;; - "archlinux") - - pacman -Syu --noconfirm --needed jre7-openjdk - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/burpsuite/install-root-debian new file mode 100755 index 0000000..78b0902 --- /dev/null +++ b/burpsuite/install-root-debian @@ -0,0 +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 deleted file mode 100755 index 2c2eaeb..0000000 --- a/codereason/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - 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 - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/codereason/install-root-debian b/codereason/install-root-debian new file mode 100755 index 0000000..ecf98f4 --- /dev/null +++ b/codereason/install-root-debian @@ -0,0 +1,4 @@ +#!/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 b/crosstool/install-root deleted file mode 100755 index cbb84a3..0000000 --- a/crosstool/install-root +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e - -case "$DISTRI" in - debian) - apt-get install -y gperf flex bison help2man gawk libncurses5-dev - ;; - archlinux) - pacman -Syu --noconfirm gperf flex bison help2man gawk ncurses - ;; - *) - echo "Unsupported distro" - ;; -esac 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-debian b/crosstool/install-root-debian new file mode 100755 index 0000000..b9e870d --- /dev/null +++ b/crosstool/install-root-debian @@ -0,0 +1,3 @@ +#!/bin/bash -e + +apt-get install -y gperf flex bison help2man gawk libncurses5-dev diff --git a/df/install-root b/df/install-root deleted file mode 100755 index f068a62..0000000 --- a/df/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - 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 - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/df/install-root-debian b/df/install-root-debian new file mode 100755 index 0000000..4b5294d --- /dev/null +++ b/df/install-root-debian @@ -0,0 +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 diff --git a/dirb/install-root b/dirb/install-root deleted file mode 100755 index f1c077f..0000000 --- a/dirb/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install libcurl4-gnutls-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/dirb/install-root-debian new file mode 100755 index 0000000..86c573c --- /dev/null +++ b/dirb/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libcurl4-gnutls-dev diff --git a/dislocker/install-root b/dislocker/install-root deleted file mode 100755 index 192ca00..0000000 --- a/dislocker/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install libfuse-dev libpolarssl-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/dislocker/install-root-debian new file mode 100755 index 0000000..5836fd3 --- /dev/null +++ b/dislocker/install-root-debian @@ -0,0 +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 deleted file mode 100755 index 2ec0020..0000000 --- a/elfparser/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get install -y libqt5widgets5 - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/elfparser/install-root-debian b/elfparser/install-root-debian new file mode 100755 index 0000000..4d5cad2 --- /dev/null +++ b/elfparser/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get install -y libqt5widgets5 diff --git a/firmware-mod-kit/install-root b/firmware-mod-kit/install-root deleted file mode 100755 index 67e9306..0000000 --- a/firmware-mod-kit/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install liblzma-dev python-magic zlib1g-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/firmware-mod-kit/install-root-debian new file mode 100755 index 0000000..3bcd4b2 --- /dev/null +++ b/firmware-mod-kit/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install liblzma-dev python-magic zlib1g-dev diff --git a/gdb/install-root b/gdb/install-root deleted file mode 100755 index 2ef22cb..0000000 --- a/gdb/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install texinfo - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/gdb/install-root-debian new file mode 100755 index 0000000..76cf84c --- /dev/null +++ b/gdb/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install texinfo diff --git a/hash-identifier/install-root b/hash-identifier/install-root deleted file mode 100755 index 4f93a7f..0000000 --- a/hash-identifier/install-root +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -e - -case "$DISTRI" in - debian) - apt-get -y install tofrodos - ;; - *) - echo "Unsupported distribution" - exit 1 - ;; -esac diff --git a/hash-identifier/install-root-debian b/hash-identifier/install-root-debian new file mode 100755 index 0000000..c9cd9b3 --- /dev/null +++ b/hash-identifier/install-root-debian @@ -0,0 +1,3 @@ +#!/bin/bash -e + +apt-get -y install tofrodos diff --git a/hashpump-partialhash/install-root b/hashpump-partialhash/install-root deleted file mode 100755 index 38e6305..0000000 --- a/hashpump-partialhash/install-root +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - debian) - apt-get -y install libssl-dev - ;; - archlinux) - pacman -Syu --noconfirm openssl - ;; - *) - echo "Unsupported distribution" - exit 1 - ;; -esac diff --git a/hashpump-partialhash/install-root-archlinux b/hashpump-partialhash/install-root-archlinux new file mode 100755 index 0000000..7beecc1 --- /dev/null +++ b/hashpump-partialhash/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed openssl diff --git a/hashpump-partialhash/install-root-debian b/hashpump-partialhash/install-root-debian new file mode 100755 index 0000000..f417d60 --- /dev/null +++ b/hashpump-partialhash/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libssl-dev diff --git a/hashpump/install-root b/hashpump/install-root deleted file mode 100755 index 38e6305..0000000 --- a/hashpump/install-root +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - debian) - apt-get -y install libssl-dev - ;; - archlinux) - pacman -Syu --noconfirm openssl - ;; - *) - echo "Unsupported distribution" - exit 1 - ;; -esac diff --git a/hashpump/install-root-archlinux b/hashpump/install-root-archlinux new file mode 100755 index 0000000..7beecc1 --- /dev/null +++ b/hashpump/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed openssl diff --git a/hashpump/install-root-debian b/hashpump/install-root-debian new file mode 100755 index 0000000..f417d60 --- /dev/null +++ b/hashpump/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libssl-dev diff --git a/honggfuzz/install-root b/honggfuzz/install-root deleted file mode 100755 index efde6c4..0000000 --- a/honggfuzz/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get install libbfd-dev libunwind8-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/honggfuzz/install-root-archlinux b/honggfuzz/install-root-archlinux new file mode 100755 index 0000000..18d63b3 --- /dev/null +++ b/honggfuzz/install-root-archlinux @@ -0,0 +1,5 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get install libbfd-dev libunwind8-dev +pacman -Syu --noconfirm --needed libunwind binutils diff --git a/honggfuzz/install-root-debian b/honggfuzz/install-root-debian new file mode 100755 index 0000000..7d83009 --- /dev/null +++ b/honggfuzz/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get install libbfd-dev libunwind8-dev diff --git a/littleblackbox/install-root b/littleblackbox/install-root deleted file mode 100755 index bc26fbb..0000000 --- a/littleblackbox/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install libssl-dev libpcap-dev libsqlite3-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/littleblackbox/install-root-archlinux b/littleblackbox/install-root-archlinux new file mode 100755 index 0000000..1e85e0f --- /dev/null +++ b/littleblackbox/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed openssl libpcap sqlite diff --git a/littleblackbox/install-root-debian b/littleblackbox/install-root-debian new file mode 100755 index 0000000..b22ec1a --- /dev/null +++ b/littleblackbox/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libssl-dev libpcap-dev libsqlite3-dev diff --git a/msieve/install-root b/msieve/install-root deleted file mode 100755 index 54775e7..0000000 --- a/msieve/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install libgmp3-dev libgmp-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/msieve/install-root-archlinux b/msieve/install-root-archlinux new file mode 100755 index 0000000..29c434a --- /dev/null +++ b/msieve/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --noconfirm --needed gmp diff --git a/msieve/install-root-debian b/msieve/install-root-debian new file mode 100755 index 0000000..4f25dcb --- /dev/null +++ b/msieve/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libgmp3-dev libgmp-dev diff --git a/panda/install-root b/panda/install-root deleted file mode 100755 index 4cf3f54..0000000 --- a/panda/install-root +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install nasm libssl-dev libpcap-dev subversion curl \ - autoconf libtool libc++-dev llvm-3.3-dev clang-3.3 unzip - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/panda/install-root-archlinux b/panda/install-root-archlinux new file mode 100755 index 0000000..8d2ce2d --- /dev/null +++ b/panda/install-root-archlinux @@ -0,0 +1,5 @@ +#!/bin/bash +set -eu -o pipefail + +pacman -Syu --needed --noconfirm nasm openssl libpcap subversion curl \ + autoconf libtool libc++ unzip clang llvm diff --git a/panda/install-root-debian b/panda/install-root-debian new file mode 100755 index 0000000..331a865 --- /dev/null +++ b/panda/install-root-debian @@ -0,0 +1,5 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install nasm libssl-dev libpcap-dev subversion curl \ + autoconf libtool libc++-dev llvm-3.3-dev clang-3.3 unzip diff --git a/pathgrind/install-root b/pathgrind/install-root deleted file mode 100755 index 8980dcb..0000000 --- a/pathgrind/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install libc6-dev-i386 libc6-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/pathgrind/install-root-debian b/pathgrind/install-root-debian new file mode 100755 index 0000000..961843c --- /dev/null +++ b/pathgrind/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libc6-dev-i386 libc6-dev diff --git a/pwntools/install-root b/pwntools/install-root deleted file mode 100755 index d38ef6f..0000000 --- a/pwntools/install-root +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -e - -case "$DISTRI" in - "debian") - echo "Need pwntools compatible binutils from PPA" - exit 1 - ;; - "ubuntu") - apt-add-repository -y ppa:pwntools/binutils - apt-get update - apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev - ;; - "archlinux") - pacman -Syu --noconfirm --needed binutils openssl libffi - ;; - *) - echo "Unknown distribution" - exit 1 - ;; -esac - 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..05fdf99 --- /dev/null +++ b/pwntools/install-root-ubuntu @@ -0,0 +1,5 @@ +#!/bin/bash -e + +apt-add-repository -y ppa:pwntools/binutils +apt-get update +apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev diff --git a/qemu/install-root b/qemu/install-root deleted file mode 100755 index a6dd7df..0000000 --- a/qemu/install-root +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e - -case "$DISTRI" in - debian) - ;; - archlinux) - pacman -Syu --noconfirm --needed python2 - ;; - *) - echo "Unsupported distribution" - exit 1 - ;; -esac 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 b/qira/install-root deleted file mode 100755 index 5287b52..0000000 --- a/qira/install-root +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - 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 - - # plugin deps - apt-get -y install libssl1.0.0:i386 - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/qira/install-root-debian new file mode 100755 index 0000000..4d822d1 --- /dev/null +++ b/qira/install-root-debian @@ -0,0 +1,8 @@ +#!/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 + +# plugin deps +apt-get -y install libssl1.0.0:i386 diff --git a/snowman/install-root b/snowman/install-root deleted file mode 100755 index c292cb7..0000000 --- a/snowman/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install libboost-dev cmake libqt4-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/snowman/install-root-debian new file mode 100755 index 0000000..9a92121 --- /dev/null +++ b/snowman/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libboost-dev cmake libqt4-dev diff --git a/sonic-visualizer/install-root b/sonic-visualizer/install-root deleted file mode 100755 index 54d93a3..0000000 --- a/sonic-visualizer/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - 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 - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/sonic-visualizer/install-root-debian new file mode 100755 index 0000000..1f38931 --- /dev/null +++ b/sonic-visualizer/install-root-debian @@ -0,0 +1,4 @@ +#!/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 b/sqlmap/install-root deleted file mode 100755 index 96986d1..0000000 --- a/sqlmap/install-root +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - apt-get -y install libsqlite3-dev - ;; - "archlinux") - pacman -Syu --noconfirm --needed sqlite - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/sqlmap/install-root-debian new file mode 100755 index 0000000..2ff2b0e --- /dev/null +++ b/sqlmap/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libsqlite3-dev diff --git a/sslsplit/install-root b/sslsplit/install-root deleted file mode 100755 index 27e9998..0000000 --- a/sslsplit/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install libevent-dev - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac 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-debian b/sslsplit/install-root-debian new file mode 100755 index 0000000..3e352e1 --- /dev/null +++ b/sslsplit/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install libevent-dev diff --git a/stegdetect/install-root b/stegdetect/install-root deleted file mode 100755 index ef3be8a..0000000 --- a/stegdetect/install-root +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -case "$DISTRI" in - "ubuntu") - ;& # fallthrough - "debian") - - apt-get -y install automake1.4 - ;; - "archlinux") - echo "archlinux is currently not supported!" - echo "Update install-root and do a pull-request ;)" - exit 1 - ;; - *) - echo "Unsupported distribution: ''" - exit 1 - ;; -esac diff --git a/stegdetect/install-root-debian b/stegdetect/install-root-debian new file mode 100755 index 0000000..6852027 --- /dev/null +++ b/stegdetect/install-root-debian @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu -o pipefail + +apt-get -y install automake1.4 From b2108672422e4585dd0f42a97d48cb20a2128975 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Mon, 6 Jun 2016 15:38:34 +0200 Subject: [PATCH 51/57] Added actual detection of ubuntu as distribution --- bin/manage-tools | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/manage-tools b/bin/manage-tools index 4396d6c..5d6a330 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -35,7 +35,11 @@ function detect_distribution() if which pacman 2>&1 >/dev/null; then echo "archlinux" elif which apt-get 2>&1 >/dev/null; then - echo "debian" + if lsb_release -a | grep -i ubuntu; then + echo "ubuntu" + else + echo "debian" + fi else echo "" fi From 65c3ab58631b0c6ed821d23e6e29692a219d3805 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Mon, 6 Jun 2016 16:25:06 +0200 Subject: [PATCH 52/57] fixed tabs vs spaces and a distribution detection function --- bin/manage-tools | 56 ++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/bin/manage-tools b/bin/manage-tools index 5d6a330..6ad811f 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -35,11 +35,11 @@ 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; then - echo "ubuntu" - else - echo "debian" - fi + if lsb_release -a | grep -i ubuntu 2>&1 >/dev/null; then + echo "ubuntu" + else + echo "debian" + fi else echo "" fi @@ -217,30 +217,30 @@ case $ACTION in tool_log "starting install, logging to $PWD/install.log" rm -f install.log - # 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 + # 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 + # execute install script if env DISTRI=$DISTRI ./install >>install.log 2>&1 then tool_log "install finished" From dcf227435c3805c5ce5ddf6f8e59f271d6ac9cd6 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Mon, 6 Jun 2016 16:27:52 +0200 Subject: [PATCH 53/57] Install manage-tools setup dependencies at beginning of Dockerfile so container rebuilds don't take as long when a tool or manage-tools changed --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index cbb65c4..987e643 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ from ubuntu:trusty maintainer yans@yancomm.net +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 adduser ctf COPY .git /home/ctf/tools/.git RUN chown -R ctf.ctf /home/ctf/tools From c8f710a70dc7636ab87534b135f88644d7156925 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Mon, 6 Jun 2016 16:29:46 +0200 Subject: [PATCH 54/57] switched to useradd instead of adduser in Dockerfile (adduser is interactive) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 987e643..a93248d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ 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 adduser ctf +RUN useradd -m ctf COPY .git /home/ctf/tools/.git RUN chown -R ctf.ctf /home/ctf/tools From 42d92e964e2d5cec026938d695ffd13ee9e5df36 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Mon, 6 Jun 2016 17:43:01 +0200 Subject: [PATCH 55/57] Install pwntools with pip from local git clone with depth=1 --- pwntools/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pwntools/install b/pwntools/install index aa8ca1f..d500de0 100755 --- a/pwntools/install +++ b/pwntools/install @@ -1,4 +1,4 @@ #!/bin/bash -e -# pwnutils -ctf-tools-pip install --upgrade 'git+https://github.com/Gallopsled/pwntools.git' +git clone --depth=1 https://github.com/Gallopsled/pwntools.git +ctf-tools-pip install --upgrade -e pwntools From bc82a626250a9ad4a79773dd483c218e9eff71e0 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Mon, 6 Jun 2016 18:19:16 +0200 Subject: [PATCH 56/57] Added Dockerfile for archlinux based container. --- Dockerfile.archlinux | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Dockerfile.archlinux 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"] From ad04a445fa8673e0eafd8cb7e4e02f8bd14b9d33 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Mon, 6 Jun 2016 18:23:40 +0200 Subject: [PATCH 57/57] install software-properties-common to add pwntools-binutils ppa on ubuntu --- binjitsu/install-root-ubuntu | 1 + pwntools/install-root-ubuntu | 1 + 2 files changed, 2 insertions(+) diff --git a/binjitsu/install-root-ubuntu b/binjitsu/install-root-ubuntu index 05fdf99..50ac55e 100755 --- a/binjitsu/install-root-ubuntu +++ 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/pwntools/install-root-ubuntu b/pwntools/install-root-ubuntu index 05fdf99..50ac55e 100755 --- a/pwntools/install-root-ubuntu +++ b/pwntools/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