diff --git a/.travis.yml b/.travis.yml index c7e4e9c..e1cfd51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,34 @@ -language: python -python: 2.7 +language: bash sudo: required -dist: trusty -install: (sudo apt-get update || true) && bin/manage-tools -s setup -script: bin/manage-tools -s test all +services: +- docker +before_install: +- if [ "$DISTRO" = "archlinux" ]; then docker build -t ctftools -f Dockerfile.archlinux .; fi +- if [ "$DISTRO" = "fedora" ]; then docker build -t ctftools -f Dockerfile.fedora .; fi +- if [ "$DISTRO" = "xenial" ]; then docker build -t ctftools -f Dockerfile.xenial .; fi +- if [ "$DISTRO" = "trusty" ]; then docker build -t ctftools -f Dockerfile .; fi + +env: + +- DISTRO='archlinux' TOOL='afl android-sdk apktool binwalk burpsuite checksec df dirb elfkickers evilize featherduster firmware-mod-kit gdb hashpump hashpump-partialhash honggfuzz jdgui keystone libheap msieve pkcrack pwndbg pwntools python-paddingoracle pyvmmonitor radare2 sqlmap sslsplit testdisk tor-browser unicorn veles virtualsocket xortool xrop yafu zsteg' # estimated 2000 seconds +- DISTRO='archlinux' TOOL='commix cribdrag dirsearch exetractor foresight gef pdf-parser peda peepdf pemcrack rp++ scrdec18 shellnoob ssh_decoder steganabara stegsolve subbrute' # estimated 16 seconds +- DISTRO='archlinux' EXPECTFAIL=1 TOOL='qira taintgrind z3' # estimated 1831 seconds +- DISTRO='archlinux' EXPECTFAIL=1 TOOL='angr barf beef bindead capstone codereason dislocker elfparser gdb-heap hash-identifier hashkill littleblackbox mitmproxy panda pathgrind preeny python-pin reveng ropper shellsploit snowman sonic-visualizer stegdetect villoc wcc xspy' # estimated 764 seconds +# - DISTRO='archlinux' TOOL='qemu' # unknown duration... +- DISTRO='fedora' TOOL='apktool binwalk burpsuite capstone checksec commix cribdrag dirsearch elfkickers evilize exetractor foresight gdb gef jdgui libheap pdf-parser peda peepdf pkcrack python-paddingoracle pyvmmonitor radare2 ropper rp++ scrdec18 shellnoob shellsploit ssh_decoder steganabara stegsolve subbrute unicorn virtualsocket xortool yafu z3' # estimated 1779 seconds +- DISTRO='fedora' EXPECTFAIL=1 TOOL='afl android-sdk angr barf beef bindead codereason df dirb dislocker elfparser featherduster firmware-mod-kit gdb-heap hash-identifier hashkill hashpump hashpump-partialhash honggfuzz keystone littleblackbox mitmproxy msieve panda pathgrind pemcrack preeny pwndbg pwntools python-pin qemu qira reveng snowman sonic-visualizer sqlmap sslsplit stegdetect taintgrind testdisk tor-browser veles villoc wcc xrop xspy zsteg' # estimated 549 seconds +- DISTRO='trusty' TOOL='barf capstone jdgui stegdetect yafu z3' # estimated 1995 seconds +- DISTRO='trusty' TOOL='qemu' # estimated 2160 seconds +- DISTRO='trusty' TOOL='apktool bindead featherduster gdb qira snowman' # estimated 1976 seconds +- DISTRO='trusty' TOOL='afl android-sdk burpsuite codereason df firmware-mod-kit hashkill keystone mitmproxy pwndbg pwntools radare2 unicorn' # estimated 1976 seconds +- DISTRO='trusty' TOOL='binwalk checksec commix cribdrag dirb dirsearch dislocker elfkickers elfparser evilize exetractor foresight gef hash-identifier hashpump hashpump-partialhash honggfuzz libheap littleblackbox msieve pdf-parser peda peepdf pemcrack pkcrack preeny python-paddingoracle python-pin pyvmmonitor ropper rp++ scrdec18 shellnoob shellsploit sqlmap ssh_decoder sslsplit steganabara stegsolve subbrute testdisk tor-browser villoc virtualsocket xortool xspy zsteg' # estimated 374 seconds +- DISTRO='trusty' EXPECTFAIL=1 TOOL='angr panda sonic-visualizer' # estimated 1877 seconds +- DISTRO='trusty' EXPECTFAIL=1 TOOL='beef gdb-heap pathgrind reveng taintgrind veles wcc xrop' # estimated 303 seconds +- DISTRO='xenial' TOOL='qemu' # estimated 1928 seconds +- DISTRO='xenial' TOOL='barf keystone mitmproxy z3' # estimated 1920 seconds +- DISTRO='xenial' TOOL='afl android-sdk angr firmware-mod-kit gdb snowman' # estimated 1985 seconds +- DISTRO='xenial' TOOL='apktool binwalk burpsuite capstone checksec codereason commix cribdrag df dirb dirsearch dislocker elfkickers elfparser evilize exetractor featherduster foresight gef hash-identifier hashpump hashpump-partialhash honggfuzz jdgui libheap littleblackbox msieve pdf-parser peda peepdf pemcrack pkcrack preeny pwndbg python-paddingoracle pyvmmonitor radare2 ropper rp++ scrdec18 shellnoob shellsploit sqlmap ssh_decoder sslsplit steganabara stegsolve subbrute testdisk tor-browser unicorn veles virtualsocket xortool xspy yafu' # estimated 1230 seconds +- DISTRO='xenial' EXPECTFAIL=1 TOOL='beef bindead gdb-heap hashkill panda pathgrind pwntools python-pin qira reveng sonic-visualizer stegdetect taintgrind villoc wcc xrop zsteg' # estimated 457 seconds +script: +- travis_wait 50 ./bin/travis-ci.sh + diff --git a/.travis.yml.footer b/.travis.yml.footer new file mode 100644 index 0000000..31b6918 --- /dev/null +++ b/.travis.yml.footer @@ -0,0 +1,3 @@ +script: +- travis_wait 50 ./bin/travis-ci.sh + diff --git a/.travis.yml.header b/.travis.yml.header new file mode 100644 index 0000000..4a52d26 --- /dev/null +++ b/.travis.yml.header @@ -0,0 +1,12 @@ +language: bash +sudo: required +services: +- docker +before_install: +- if [ "$DISTRO" = "archlinux" ]; then docker build -t ctftools -f Dockerfile.archlinux .; fi +- if [ "$DISTRO" = "fedora" ]; then docker build -t ctftools -f Dockerfile.fedora .; fi +- if [ "$DISTRO" = "xenial" ]; then docker build -t ctftools -f Dockerfile.xenial .; fi +- if [ "$DISTRO" = "trusty" ]; then docker build -t ctftools -f Dockerfile .; fi + +env: + diff --git a/Dockerfile b/Dockerfile index a93248d..ee2cfb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ 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 + unzip virtualenvwrapper sudo RUN useradd -m ctf COPY .git /home/ctf/tools/.git @@ -18,7 +18,8 @@ USER ctf WORKDIR /home/ctf/tools RUN git checkout . RUN bin/manage-tools -s setup +RUN bin/ctf-tools-pip install appdirs RUN echo "workon ctftools" >> /home/ctf/.bashrc WORKDIR /home/ctf -ENTRYPOINT bash -i +CMD bash -i diff --git a/Dockerfile.archlinux b/Dockerfile.archlinux index f364ae0..11efc6e 100644 --- a/Dockerfile.archlinux +++ b/Dockerfile.archlinux @@ -20,7 +20,7 @@ RUN pacman -Syu --noconfirm --needed \ python2-pip python-pip \ unzip python-virtualenvwrapper \ zsh grml-zsh-config \ - sudo \ + sudo which \ && pacman -Scc --noconfirm RUN useradd -m ctf diff --git a/Dockerfile.fedora b/Dockerfile.fedora new file mode 100644 index 0000000..24c059f --- /dev/null +++ b/Dockerfile.fedora @@ -0,0 +1,19 @@ +FROM fedora + +RUN dnf -y install which sudo git redhat-lsb + +RUN useradd -m ctf +COPY .git /home/ctf/tools/.git +RUN chown -R ctf.ctf /home/ctf/tools + +RUN echo "ctf ALL=NOPASSWD: ALL" > /etc/sudoers.d/ctf +USER ctf + +WORKDIR /home/ctf/tools +RUN git checkout . +RUN bin/manage-tools -s setup +RUN bin/ctf-tools-pip install appdirs +RUN echo "workon ctftools" >> /home/ctf/.bashrc + +WORKDIR /home/ctf +CMD bash -i diff --git a/Dockerfile.xenial b/Dockerfile.xenial new file mode 100644 index 0000000..70f2e20 --- /dev/null +++ b/Dockerfile.xenial @@ -0,0 +1,25 @@ +from ubuntu:xenial +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 sudo + +RUN useradd -m ctf +COPY .git /home/ctf/tools/.git +RUN chown -R ctf.ctf /home/ctf/tools + +RUN echo "ctf ALL=NOPASSWD: ALL" > /etc/sudoers.d/ctf +RUN apt-get update +RUN apt-get -y install git virtualenvwrapper + +USER ctf + +WORKDIR /home/ctf/tools +RUN git checkout . +RUN bin/manage-tools -s setup +RUN bin/ctf-tools-pip install appdirs +RUN echo "workon ctftools" >> /home/ctf/.bashrc + +WORKDIR /home/ctf +CMD bash -i diff --git a/README.md b/README.md index c836b6f..aa9bc9f 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ This is a collection of setup scripts to create an install of various security research tools. Of course, this isn't a hard problem, but it's really nice to have them in one place that's easily deployable to new machines and so forth. +The install-scripts for these tools are checked regularly, the results can be found on [the build status page](_buildstatus/index.md). Installers for the following tools are included: | Category | Tool | Description | |----------|------|-------------| -| binary | [afl](http://lcamtuf.coredump.cx/afl/) | State-of-the-art fuzzer. | +| binary | [afl](http://lcamtuf.coredump.cx/afl/) | State-of-the-art fuzzer. | | 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. | @@ -22,24 +22,28 @@ 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 | [gdb-heap](https://fedorahosted.org/gdb-heap/) | gdb extension for debugging heap issues. | | 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 | [libheap](https://github.com/cloudburst/libheap) | gdb python library for examining the glibc heap (ptmalloc) | +| binary | [miasm](https://github.com/cea-sec/miasm) | Reverse engineering framework in Python. | | 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 | [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! | -| binary | [qira](http://qira.me) | Parallel, timeless debugger. | +| binary | [qira](http://qira.me) | Parallel, timeless debugger. | | binary | [radare2](http://www.radare.org/) | Some crazy thing crowell likes. | | binary | [ropper](https://github.com/sashs/Ropper) | Another gadget finder. | | binary | [rp++](https://github.com/0vercl0k/rp) | Another gadget finder. | +| binary | [rr](http://rr-project.org) | Record and Replay Debugging Framework | | binary | [shellnoob](https://github.com/reyammer/shellnoob) | Shellcode writing helper. | | binary | [shellsploit](https://github.com/b3mb4m/shellsploit-framework) | Shellcode development kit. | | binary | [snowman](https://github.com/yegord/snowman) | Cross-architecture decompiler. | -| binary | [taintgrind](https://github.com/wmkhoo/taintgrind) | A valgrind taint analysis tool. | +| binary | [taintgrind](https://github.com/wmkhoo/taintgrind) | A valgrind taint analysis tool. | | binary | [villoc](https://github.com/wapiflapi/villoc) | Visualization of heap operations. | | binary | [virtualsocket](https://github.com/antoniobianchi333/virtualsocket) | A nice library to interact with binaries. | | binary | [wcc](https://github.com/endrazine/wcc) | The Witchcraft Compiler Collection is a collection of compilation tools to perform binary black magic on the GNU/Linux and other POSIX platforms. | @@ -53,6 +57,7 @@ Installers for the following tools are included: | forensics | [scrdec](https://gist.github.com/bcse/1834878) | A decoder for encoded Windows Scripts. | | forensics | [testdisk](http://www.cgsecurity.org/wiki/TestDisk) | Testdisk and photorec for file recovery. | | crypto | [cribdrag](https://github.com/SpiderLabs/cribdrag) | Interactive crib dragging tool (for crypto). | +| crypto | [fastcoll](https://www.win.tue.nl/hashclash/) | An md5sum collision generator. | | crypto | [foresight](https://github.com/ALSchwalm/foresight) | A tool for predicting the output of random number generators. To run, launch "foresee". | | crypto | [featherduster](https://github.com/nccgroup/featherduster) | An automated, modular cryptanalysis tool. | | crypto | [hashkill](https://github.com/gat3way/hashkill) | Hash cracker. | @@ -80,8 +85,23 @@ Installers for the following tools are included: | stego | [steganabara](http://www.caesum.com/handbook/stego.htm) | Another image steganography solver. | | stego | [stegdetect](http://www.outguess.org/) | Steganography detection/breaking tool. | | stego | [stegsolve](http://www.caesum.com/handbook/stego.htm) | Image steganography solver. | +| stego | [zsteg](https://github.com/zed-0xff/zsteg) | detect stegano-hidden data in PNG & BMP. | | android | [apktool](https://ibotpeaches.github.io/Apktool/) | Dissect, dis-assemble, and re-pack Android APKs | | android | [android-sdk](http://developer.android.com/sdk) | The android SDK (adb, emulator, etc). | +| misc | [xspy](http://git.kali.org/gitweb/?p=packages/xspy.git;a=summary) | Tiny tool to spy on X sessions. | +| misc | [z3](https://github.com/Z3Prover/z3) | Theorem prover from Microsoft Research. | +| misc | [jdgui](http://jd.benow.ca/) | Java decompiler. | +| misc | [veles](https://codisec.com/veles/) | Binary data analysis and visulalization tool. | + +There are also a couple of installers for useful libraries included. Currently +only the python bindings for these libraries are installed. + +| Category | Library | Description | +|----------|---------|-------------| +| binary | [capstone](http://www.capstone-engine.org) | Multi-architecture disassembly framework. | +| binary | [keystone](http://www.keystone-engine.org) | Lightweight multi-architecture assembler framework. | +| binary | [unicorn](http://www.unicorn-engine.org) | Multi-architecture CPU emulator framework. | +| binary | [lief](https://lief.quarkslab.com/) | Library to Instrument Executable Formats. | There are also some installers for non-CTF stuff to break the monotony! @@ -149,6 +169,12 @@ docker run -it ctf-tools The built image will have ctf-tools cloned and ready to go, but you will still need to install the tools themselves (see above). +Alternatively, you can also pull ctf-tools (with some tools preinstalled) from dockerhub: + +```bash +docker run -it zardus/ctf-tools +``` + ## Vagrant You can build a Vagrant VM with: @@ -167,7 +193,7 @@ vagrant ssh ## Kali Linux Kali Linux (Sana and Rolling), due to manually setting certain libraries to not use the latest version available (sometimes being out of date by years) causes some tools to not install at all, or fail in strange ways. AFL and Panda comes to mind, in fact any tool that uses QEMU 2.30 will probably fail during compilation under Kali. -Overriding these libraries breaks other tools included in Kali so your only solution is to either live with some of Kali's tools being broken, or running another distribution seperately such as Ubuntu. +Overriding these libraries breaks other tools included in Kali so your only solution is to either live with some of Kali's tools being broken, or running another distribution seperately such as Ubuntu. Most tools aren't affected though. @@ -198,7 +224,7 @@ Good luck! # See Also -There's a curated list of CTF tools, but without installers, here: https://github.com/apsdehal/awesome-ctf. +There's a curated list of CTF tools, but without installers, here: https://github.com/apsdehal/aWEsoMe-cTf. There's a Vagrant config with a lot of the bigger frameworks here: https://github.com/thebarbershopper/epictreasure. @@ -211,6 +237,7 @@ They're not included in ctf-tools, but are included here as notes for the author |----------|---------|-------------|---------| | forensics | [foremost](http://foremost.sourceforge.net/) | File carver. | `foremost` | | dsniff | [dsniff](http://www.monkey.org/~dugsong/dsniff/) | Grabs passwords and other data from pcaps/network streams. | dsniff | +| stego | [pngtools](https://launchpad.net/ubuntu/+source/pngtools) | PNG's analysis tool. | ## Tools with unofficial Debian/Ubuntu repos or debs diff --git a/_buildstatus/fail.png b/_buildstatus/fail.png new file mode 100644 index 0000000..976f6e5 Binary files /dev/null and b/_buildstatus/fail.png differ diff --git a/_buildstatus/index.md b/_buildstatus/index.md new file mode 100644 index 0000000..ff6caf5 --- /dev/null +++ b/_buildstatus/index.md @@ -0,0 +1,93 @@ + | archlinux | fedora | trusty | xenial +----- | ----- | ----- | ----- | ----- +![success](success.png) | 54 | 37 | 73 | 67 +![fail](fail.png) | 29 | 47 | 11 | 17 +![unknown](unknown.png) | 1 | 0 | 0 | 0 +total | 84 | 84 | 84 | 84 + + | archlinux | fedora | trusty | xenial +----- | ----- | ----- | ----- | ----- +afl | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +android-sdk | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +angr | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) +apktool | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +barf | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +beef | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +bindead | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![fail](fail.png) +binwalk | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +burpsuite | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +capstone | ![fail](fail.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +checksec | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +codereason | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +commix | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +cribdrag | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +df | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +dirb | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +dirsearch | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +dislocker | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +elfkickers | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +elfparser | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +evilize | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +exetractor | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +featherduster | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +firmware-mod-kit | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +foresight | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +gdb | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +gdb-heap | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +gef | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +hash-identifier | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +hashkill | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![fail](fail.png) +hashpump | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +hashpump-partialhash | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +honggfuzz | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +jdgui | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +keystone | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +libheap | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +littleblackbox | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +mitmproxy | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +msieve | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +panda | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +pathgrind | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +pdf-parser | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +peda | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +peepdf | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +pemcrack | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +pkcrack | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +preeny | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +pwndbg | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +pwntools | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![fail](fail.png) +python-paddingoracle | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +python-pin | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![fail](fail.png) +pyvmmonitor | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +qemu | ![unknown](unknown.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +qira | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![fail](fail.png) +radare2 | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +reveng | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +ropper | ![fail](fail.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +rp++ | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +scrdec18 | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +shellnoob | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +shellsploit | ![fail](fail.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +snowman | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +sonic-visualizer | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +sqlmap | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +ssh_decoder | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +sslsplit | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +steganabara | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +stegdetect | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![fail](fail.png) +stegsolve | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +subbrute | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +taintgrind | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +testdisk | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +tor-browser | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +unicorn | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +veles | ![success](success.png) | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) +villoc | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![fail](fail.png) +virtualsocket | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +wcc | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +xortool | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +xrop | ![success](success.png) | ![fail](fail.png) | ![fail](fail.png) | ![fail](fail.png) +xspy | ![fail](fail.png) | ![fail](fail.png) | ![success](success.png) | ![success](success.png) +yafu | ![success](success.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +z3 | ![fail](fail.png) | ![success](success.png) | ![success](success.png) | ![success](success.png) +zsteg | ![success](success.png) | ![fail](fail.png) | ![success](success.png) | ![fail](fail.png) diff --git a/_buildstatus/success.png b/_buildstatus/success.png new file mode 100644 index 0000000..94d398d Binary files /dev/null and b/_buildstatus/success.png differ diff --git a/_buildstatus/unknown.png b/_buildstatus/unknown.png new file mode 100644 index 0000000..3f6dc23 Binary files /dev/null and b/_buildstatus/unknown.png differ diff --git a/afl/install b/afl/install index dd5832d..fa7acd1 100755 --- a/afl/install +++ b/afl/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex # # AFL diff --git a/afl/install-root-archlinux b/afl/install-root-archlinux index 41ce76f..deddec6 100755 --- a/afl/install-root-archlinux +++ b/afl/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed bison qemu diff --git a/afl/install-root-debian b/afl/install-root-debian index 8ecb18e..9b950c8 100755 --- a/afl/install-root-debian +++ b/afl/install-root-debian @@ -1,5 +1,13 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail apt-get -y build-dep qemu -apt-get -y install bison + +case "$(lsb_release -cs)" in + xenial) + apt-get -y install bison libtool-bin + ;; + *) + apt-get -y install bison + ;; +esac diff --git a/android-sdk/install b/android-sdk/install index 9745425..d36553e 100755 --- a/android-sdk/install +++ b/android-sdk/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex [ -e android-sdk_r24.4.1-linux.tgz ] || wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz [ -e android-sdk-linux ] || tar xfz android-sdk_r24.4.1-linux.tgz diff --git a/android-sdk/install-root-archlinux b/android-sdk/install-root-archlinux index 72ef27d..1e82b03 100755 --- a/android-sdk/install-root-archlinux +++ b/android-sdk/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex 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 index e7ef4c5..65b4fd9 100755 --- a/android-sdk/install-root-debian +++ b/android-sdk/install-root-debian @@ -1,4 +1,12 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get -y install openjdk-7-jre openjdk-7-jdk +case "$(lsb_release -cs)" in + xenial) + # need to overwrite because of an ubuntu packaging error(!) + apt-get -y -o Dpkg::Options::="--force-overwrite" install openjdk-9-jre openjdk-9-jdk + ;; + *) + apt-get -y install openjdk-7-jre openjdk-7-jdk + ;; +esac diff --git a/angr/install b/angr/install index dc7bd78..c48f8b3 100755 --- a/angr/install +++ b/angr/install @@ -1,13 +1,14 @@ -#!/bin/bash -e +#!/bin/bash -ex -[ -e $VIRTUAL_ENV/lib/python2.7/site-packages/PyQt4 ] || ln -s /usr/lib/python2.7/dist-packages/PyQt4 $VIRTUAL_ENV/lib/python2.7/site-packages/ -[ -e $VIRTUAL_ENV/lib/python2.7/site-packages/sip.so ] || ln -s /usr/lib/python2.7/dist-packages/sip.so $VIRTUAL_ENV/lib/python2.7/site-packages/ -[ -e $VIRTUAL_ENV/lib/python2.7/site-packages/pygraphviz ] || ln -s /usr/lib/pymodules/python2.7/pygraphviz $VIRTUAL_ENV/lib/python2.7/site-packages/ +source ctf-tools-venv-activate + +#[ -e $VIRTUAL_ENV/lib/python2.7/site-packages/PyQt4 ] || ln -s /usr/lib/python2.7/dist-packages/PyQt4 $VIRTUAL_ENV/lib/python2.7/site-packages/ +#[ -e $VIRTUAL_ENV/lib/python2.7/site-packages/sip.so ] || ln -s /usr/lib/python2.7/dist-packages/sip.so $VIRTUAL_ENV/lib/python2.7/site-packages/ +#[ -e $VIRTUAL_ENV/lib/python2.7/site-packages/pygraphviz ] || ln -s /usr/lib/pymodules/python2.7/pygraphviz $VIRTUAL_ENV/lib/python2.7/site-packages/ git clone --depth 1 https://github.com/angr/angr-dev -cd angr-dev -./setup.sh -cd .. +GIT_ASKPASS=echo angr-dev/setup.sh -w -r https://git:@github.com/salls angrop +rm -rf angr-dev/wheels mkdir -p bin cd bin diff --git a/angr/install-root-debian b/angr/install-root-debian index 9282191..8c20534 100755 --- a/angr/install-root-debian +++ b/angr/install-root-debian @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/bash -ex 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 +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 libqt4-dev graphviz-dev binutils-multiarch nasm libc6:i386 libgcc1:i386 libstdc++6:i386 libtinfo5:i386 zlib1g:i386 # for angr-management apt-get -y install python-qt4 python-sip python-pygraphviz diff --git a/apktool/install b/apktool/install index 244f6d2..56e81a8 100755 --- a/apktool/install +++ b/apktool/install @@ -1,8 +1,8 @@ -#!/bin/bash -e +#!/bin/bash -ex mkdir bin wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.0.2.jar -mv apktool_2.0.2.jar bin/apktool.jar +wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.2.0.jar +mv apktool_2.2.0.jar bin/apktool.jar mv apktool bin/ chmod 755 bin/apktool chmod 755 bin/apktool.jar diff --git a/apktool/install-root-archlinux b/apktool/install-root-archlinux old mode 100644 new mode 100755 index 07e5ef1..ac72556 --- a/apktool/install-root-archlinux +++ b/apktool/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed jre8-openjdk diff --git a/apktool/install-root-debian b/apktool/install-root-debian index a37d5e1..21bca34 100755 --- a/apktool/install-root-debian +++ b/apktool/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail apt-get install -y default-jre diff --git a/barf/install b/barf/install index 92b38f1..11d8794 100755 --- a/barf/install +++ b/barf/install @@ -1,7 +1,12 @@ -#!/bin/bash +#!/bin/bash -ex # it's z3! -pip install https://github.com/zardus/z3/archive/pypy-and-setup.zip +ctf-tools-pip install https://github.com/zardus/z3/archive/pypy-and-setup.zip + +set +e +source ${VIRTUALENVWRAPPER_SCRIPT} +workon ctftools +set -e # pybfd can't be installed with pip git clone --depth 1 https://github.com/Groundworkstech/pybfd @@ -9,11 +14,16 @@ cd pybfd/ python setup.py install cd .. +# install pyasmjit +git clone --depth 1 https://github.com/programa-stic/pyasmjit.git +cd pyasmjit +python setup.py install +cd .. + # install barf git clone --depth 1 https://github.com/programa-stic/barf-project cd barf-project/ -pip install -e pyasmjit/ -pip install -e barf/ +python setup.py install cd .. mkdir -p bin diff --git a/barf/install-root-debian b/barf/install-root-debian index 6696d43..a37ff21 100755 --- a/barf/install-root-debian +++ b/barf/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail apt-get -y install binutils-multiarch-dev diff --git a/barf/uninstall b/barf/uninstall index 9d67ede..d6e93a7 100755 --- a/barf/uninstall +++ b/barf/uninstall @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex -pip uninstall -y barf pyasmjit +ctf-tools-pip uninstall -y barf pyasmjit rm -f $VIRTUAL_ENV/bin/BARFgadgets diff --git a/beef/install b/beef/install index acd7f52..2ccdc7a 100755 --- a/beef/install +++ b/beef/install @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex git clone --depth 1 https://github.com/beefproject/beef diff --git a/beef/install-root-archlinux b/beef/install-root-archlinux index f0e09bc..e898a41 100755 --- a/beef/install-root-archlinux +++ b/beef/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex pacman -Syu --noconfirm --needed \ ruby python2 ruby-bundler \ diff --git a/beef/install-root-debian b/beef/install-root-debian index dd185e4..66e6b73 100755 --- a/beef/install-root-debian +++ b/beef/install-root-debian @@ -1,8 +1,8 @@ -#!/bin/bash -e +#!/bin/bash -ex echo "Need to get ruby with RVM... Unsupported for now" exit 1 -apt-get install build-essential openssl libreadline6 \ +apt-get -y 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 \ diff --git a/bin/ctf-tools-pip b/bin/ctf-tools-pip index a55c6be..9ec042d 100755 --- a/bin/ctf-tools-pip +++ b/bin/ctf-tools-pip @@ -2,42 +2,8 @@ set -e -o pipefail #set -x -# let's stick with python 2 as default -PY_VERSION=2 -# check this scripts file ending -if [[ "$0" =~ pip3 ]]; then - PY_VERSION=3 -fi -if [[ "$0" =~ pip2 ]]; then - PY_VERSION=2 -fi - -PY_INTERPRETER=$(which "python$PY_VERSION" || which python) - -CTF_TOOLS_VE="ctftools" -if [[ $PY_VERSION -eq 3 ]]; then - CTF_TOOLS_VE="${CTF_TOOLS_VE}3" -fi - -if [[ -z "${WORKON_HOME+x}" ]]; then - export WORKON_HOME="$HOME/.virtualenvs" -fi -if [[ ! -d "$WORKON_HOME" ]]; then - mkdir -p "$WORKON_HOME" -fi - -VE_DIR="$WORKON_HOME/$CTF_TOOLS_VE" - -if [[ ! -d "$VE_DIR" || ! -e "$VE_DIR/bin/activate" ]]; then - echo "#### Creating python$PY_VERSION virtualenv '$CTF_TOOLS_VE' ####" >&2 - virtualenv --system-site-packages -p "$PY_INTERPRETER" "$VE_DIR" -fi - -if [[ -z "${VIRTUAL_ENV+x}" || "$VIRTUAL_ENV" != "$VE_DIR" ]]; then - if [[ -n "${VIRTUAL_ENV+x}" ]]; then - deactivate - fi - source "$VE_DIR/bin/activate" -fi +# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source $DIR/ctf-tools-venv-activate exec pip "$@" diff --git a/bin/ctf-tools-venv-activate b/bin/ctf-tools-venv-activate new file mode 100755 index 0000000..1ffc6e7 --- /dev/null +++ b/bin/ctf-tools-venv-activate @@ -0,0 +1,45 @@ +#!/bin/bash + +# check this scripts file ending +if [[ "$0" =~ pip3 ]]; then + PY_VERSION=3 +fi +if [[ "$0" =~ pip2 ]]; then + PY_VERSION=2 +fi + +if [[ -z "${PY_VERSION+x}" ]]; then + # if not defined otherwise let's stick with python 2 as default + PY_VERSION=2 +fi + +PY_INTERPRETER=$(which "python$PY_VERSION" || which python) + +if [[ -z "${CTF_TOOLS_VE+x}" ]]; then + CTF_TOOLS_VE="ctftools" + if [[ $PY_VERSION -eq 3 ]]; then + CTF_TOOLS_VE="${CTF_TOOLS_VE}3" + fi +fi + +if [[ -z "${WORKON_HOME+x}" ]]; then + export WORKON_HOME="$HOME/.virtualenvs" +fi +if [[ ! -d "$WORKON_HOME" ]]; then + mkdir -p "$WORKON_HOME" +fi + +VE_DIR="$WORKON_HOME/$CTF_TOOLS_VE" + +if [[ ! -d "$VE_DIR" || ! -e "$VE_DIR/bin/activate" ]]; then + echo "#### Creating python$PY_VERSION virtualenv '$CTF_TOOLS_VE' ####" >&2 + virtualenv --system-site-packages -p "$PY_INTERPRETER" "$VE_DIR" +fi + +if [[ -z "${VIRTUAL_ENV+x}" || "$VIRTUAL_ENV" != "$VE_DIR" ]]; then + if [[ -n "${VIRTUAL_ENV+x}" ]]; then + source ${VIRTUAL_ENV}/bin/activate + deactivate + fi + source "$VE_DIR/bin/activate" +fi diff --git a/bin/ctf-tools-venv-activate3 b/bin/ctf-tools-venv-activate3 new file mode 100755 index 0000000..49f1918 --- /dev/null +++ b/bin/ctf-tools-venv-activate3 @@ -0,0 +1,8 @@ +#!/bin/bash + +export PY_VERSION=3 +export CTF_TOOLS_VE="ctftools3" + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +source "$DIR/ctf-tools-venv-activate" diff --git a/bin/manage-tools b/bin/manage-tools index 6ad811f..b036492 100755 --- a/bin/manage-tools +++ b/bin/manage-tools @@ -5,10 +5,12 @@ set -eu -o pipefail function usage() { cat <&1 >/dev/null; then + if which pacman >/dev/null 2>&1; then echo "archlinux" - elif which apt-get 2>&1 >/dev/null; then - if lsb_release -a | grep -i ubuntu 2>&1 >/dev/null; then + elif which apt-get >/dev/null 2>&1; then + if lsb_release -a 2>/dev/null | grep -i ubuntu >/dev/null 2>&1; then echo "ubuntu" else echo "debian" fi + elif which dnf >/dev/null 2>&1; then + echo "fedora" else echo "" fi @@ -48,7 +52,7 @@ function detect_distribution() function base_build_setup_debian() { - PACKAGE_REQS="build-essential libtool g++ gcc texinfo curl wget automake autoconf python python-dev git subversion unzip virtualenvwrapper" + PACKAGE_REQS="build-essential libtool g++ gcc texinfo curl wget automake autoconf python python-dev git subversion unzip virtualenvwrapper lsb-release" PACKAGE_COUNT=$(echo $PACKAGE_REQS | tr ' ' '\n' | wc -l) if [ $(dpkg -l $PACKAGE_REQS | grep "^ii" | wc -l) -ne $PACKAGE_COUNT ] then @@ -108,6 +112,19 @@ EOF } +function base_build_setup_fedora() +{ + PACKAGE_REQS="libtool gcc gcc-c++ clang cmake texinfo curl wget automake autoconf python python-devel git subversion unzip python-virtualenvwrapper redhat-rpm-config" + if [ "$ALLOW_SUDO" -eq 1 ]; then + sudo dnf -y install $PACKAGE_REQS + else + TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS" + fi + + # TODO: check whether we have to explicitly enable i386 package support +} + + function base_build_setup() { case "$1" in @@ -120,6 +137,9 @@ function base_build_setup() base_build_setup_arch export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 ;; + "fedora") + base_build_setup_fedora + ;; *) TOOL=SETUP tool_log "Cannot detect or unsupported distribution" esac @@ -137,8 +157,15 @@ function base_build_setup() echo "set -x PATH $PWD/bin \$PATH " >> ~/.config/fish/config.fish fi + if [[ ! -e "$PWD/bin/ctf-tools-pip3" ]]; then + ln -s "$PWD/bin/ctf-tools-pip" "$PWD/bin/ctf-tools-pip3" + fi + # create the py2 virtualenv "$PWD/bin/ctf-tools-pip" freeze 2>&1 >/dev/null + + # create the py3 virtualenv + "$PWD/bin/ctf-tools-pip3" freeze 2>&1 >/dev/null } @@ -155,6 +182,12 @@ do -s) export ALLOW_SUDO=1 ;; + -f) + export FORCE=1 + ;; + -v) + export VERBOSE_OUTPUT=1 + ;; *) usage exit @@ -164,6 +197,9 @@ do done [[ -z ${ALLOW_SUDO+x} ]] && export ALLOW_SUDO=0 +[[ -z ${FORCE+x} ]] && export FORCE=0 +[[ -z ${VERBOSE_OUTPUT+x} ]] && export VERBOSE_OUTPUT=0 +export EXPECTFAIL=${EXPECTFAIL:-0} if [[ $# -ge 1 ]]; then ACTION="$1" @@ -202,18 +238,27 @@ case $ACTION in ;; bin) cd bin - ln -sf ../$TOOL/bin/* . - tool_log "bin symlinks updated" + if [ -d ../$TOOL/bin ]; then + ln -sf ../$TOOL/bin/* . + tool_log "bin symlinks updated" + fi cd .. ;; install) cd $TOOL - if git status --ignored . | egrep -q 'Untracked|Ignored' + if [ "$FORCE" -eq 0 ] && git status --ignored . | egrep -q 'Untracked|Ignored' then tool_log "appears to already be installed. Uninstall first?" exit 0 fi + # the first line in all install and uninstall scripts should have the -e flag, otherwise fail + if [ $(for i in install* uninstall test; do if [ -e "$i" ]; then head -1 "$i"; fi; done | sort | uniq | grep -v '^#!/bin/bash -ex$' | wc -l) -ne 0 ]; + then + tool_log "not all install/uninstall/test scripts start with '#!/bin/bash -ex', which is a must for accurate testing." + exit 1 + fi + tool_log "starting install, logging to $PWD/install.log" rm -f install.log @@ -241,8 +286,16 @@ case $ACTION in fi # execute install script - if env DISTRI=$DISTRI ./install >>install.log 2>&1 - then + set +e + if [ "$VERBOSE_OUTPUT" -eq 1 ]; then + DISTRI=$DISTRI ./install 2>&1 | tee -a install.log + else + DISTRI=$DISTRI ./install >>install.log 2>&1 + fi + INSTALL_FAILED=$? + set -e + + if [ "$INSTALL_FAILED" -eq 0 ]; then tool_log "install finished" else tool_log "INSTALL FAILED" @@ -283,21 +336,34 @@ case $ACTION in cat README.md | grep "<\!--tool-->" | sed "s/<\!--[^-]*-->//g" | grep -i "$TOOL" ;; test) - if ! cat README.md | grep "<\!--tool-->" | grep "| \[$TOOL\](" | grep -q -- "--test--" + if [ "$FORCE" -eq 0 ] && ! cat README.md | grep "<\!--tool-->" | grep "| \[$TOOL\](" | grep -q -- "--test--" then tool_log "Tests not enabled." + if [ "$EXPECTFAIL" -eq "1" ]; then exit 1; fi else - $0 install $TOOL + if ( + if ! $0 install $TOOL; then exit 1; fi - cd $TOOL + cd $TOOL || exit 1 if [ -f ./test ] then tool_log "Running test script." - ./test + if ! ./test + then + tool_log "$TOOL test failed!" + exit 1 + fi tool_log "test script succeeded!" else tool_log "Install succeeded. No test script!" fi + exit 0 + ); + then + if [ "$EXPECTFAIL" -eq "1" ]; then exit 1; else exit 0; fi + else + if [ "$EXPECTFAIL" -eq "1" ]; then exit 0; else exit 1; fi + fi fi ;; *) diff --git a/bin/travis-ci-status/Dockerfile b/bin/travis-ci-status/Dockerfile new file mode 100644 index 0000000..8f3a6c3 --- /dev/null +++ b/bin/travis-ci-status/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:xenial + +RUN apt-get update +RUN apt-get -y install python-software-properties software-properties-common build-essential git python-pip ipython vim +RUN apt-add-repository ppa:brightbox/ruby-ng +RUN apt-get update +RUN apt-get -y install ruby2.1 ruby2.1-dev ruby-switch +RUN ruby-switch --set ruby2.1 + +RUN gem install travis -v 1.8.8 --no-rdoc --no-ri +RUN pip install binpacking + +WORKDIR /gitdata diff --git a/bin/travis-ci-status/fetch_latest_timingdata.inside-docker.sh b/bin/travis-ci-status/fetch_latest_timingdata.inside-docker.sh new file mode 100755 index 0000000..a8b2300 --- /dev/null +++ b/bin/travis-ci-status/fetch_latest_timingdata.inside-docker.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tmpfile=$(mktemp) + +# Fetch data +( +for i in $(travis show --skip-completion-check --no-interactive | grep '^#' | awk '{print $1}' | tr "#" " "); +do + travis logs --skip-completion-check --no-interactive "$i" | grep '^\[ACCOUNTING\]=====\[' | cut -d' ' -f2-5 +done +) > $tmpfile + +# generate travis-ci data +( +cat /gitdata/.travis.yml.header +/gitdata/bin/travis-ci-status/make_binpacked_travis_ci_conf.py $tmpfile +cat /gitdata/.travis.yml.footer +) > /gitdata/.travis.yml + +# generate build status data +/gitdata/bin/travis-ci-status/make_build_status_md.py $tmpfile > /gitdata/_buildstatus/index.md + +rm -f $tmpfile diff --git a/bin/travis-ci-status/fetch_latest_timingdata.sh b/bin/travis-ci-status/fetch_latest_timingdata.sh new file mode 100755 index 0000000..65ce75b --- /dev/null +++ b/bin/travis-ci-status/fetch_latest_timingdata.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +dockerimage=ctf-tools-travisbuildcheck +gitdir=$(git rev-parse --show-toplevel) + +if ! docker history $dockerimage &> /dev/null; +then + echo "Docker image \"$dockerimage\" does not exist. Run" + echo + echo " docker build -t $dockerimage ." + echo + echo "first, then retry this command." + exit 1 +fi + +docker run --rm -v $gitdir:/gitdata -ti $dockerimage /gitdata/bin/travis-ci-status/fetch_latest_timingdata.inside-docker.sh + diff --git a/bin/travis-ci-status/make_binpacked_travis_ci_conf.py b/bin/travis-ci-status/make_binpacked_travis_ci_conf.py new file mode 100755 index 0000000..31137e2 --- /dev/null +++ b/bin/travis-ci-status/make_binpacked_travis_ci_conf.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +import binpacking, sys, pprint + +MAXBINDURATION = 2000 # seconds + +def parseOutput(fn): + lines = [l.strip() for l in open(fn).readlines()] + out = {} + + for l in lines: + [distro, tool, success, duration] = l.split(" ") + if not distro in out: + out[distro] = {} + out[distro][tool] = { + "success": success == "SUCCEEDED", + "duration": int(duration) + } + return out + +def printBins(timingdata, distro, expectfail): + inputs = dict([(t, v["duration"]) for (t, v) in timingdata[distro].items() if v["success"] != expectfail]) + bins = binpacking.to_constant_volume(inputs, MAXBINDURATION) + + for b in bins: + tools = " ".join(sorted(b.keys())) + duration = sum(b.values()) + if expectfail: + print("- DISTRO='{}' EXPECTFAIL=1 TOOL='{}' # estimated {} seconds".format(distro, tools, duration)) + else: + print("- DISTRO='{}' TOOL='{}' # estimated {} seconds".format(distro, tools, duration)) + +def getToolsFromTimingdata(timingdata): + out = {} + for d, dd in timingdata.items(): + for t, td in dd.items(): + out[t] = 1 + return out.keys() + +if __name__ == "__main__": + timingdata = parseOutput(sys.argv[1]) + distros = sorted(timingdata.keys()) # all distros seen during previous build + tools = sorted(getToolsFromTimingdata(timingdata)) # all tools seen during previous build + + for distro in distros: + printBins(timingdata, distro, False) + printBins(timingdata, distro, True) + + # no timing data, assume the build took too long for this tool on this distro + nodata = [t for t in tools if t not in timingdata[distro]] + for tool in nodata: + print("# - DISTRO='{}' TOOL='{}' # unknown duration...".format(distro, tool)) + diff --git a/bin/travis-ci-status/make_build_status_md.py b/bin/travis-ci-status/make_build_status_md.py new file mode 100755 index 0000000..6265184 --- /dev/null +++ b/bin/travis-ci-status/make_build_status_md.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +from make_binpacked_travis_ci_conf import * + +if __name__ == "__main__": + timingdata = parseOutput(sys.argv[1]) + distros = sorted(timingdata.keys()) # all distros seen during previous build + tools = sorted(getToolsFromTimingdata(timingdata)) # all tools seen during previous build + + fulltable = [] + summarytable = [] + + fulltable += [" | ".join([""] + distros)] + fulltable += [" | ".join(["-----"] * (1+len(distros)))] + + summary = {} + for tool in tools: + parts = [] + for distro in distros: + val = "unknown" + if tool in timingdata[distro]: + val = "success" if timingdata[distro][tool]["success"] else "fail" + parts += [val] + if distro not in summary: + summary[distro] = { + "unknown": 0, + "success": 0, + "fail": 0, + "total": 0, + } + summary[distro][val] += 1 + summary[distro]["total"] += 1 + fulltable += [" | ".join([tool] + ["![{0}]({0}.png)".format(x) for x in parts])] + + summarytable += [" | ".join([""] + distros)] + summarytable += [" | ".join(["-----"] * (1+len(distros)))] + for x in ["success", "fail", "unknown"]: + summarytable += [" | ".join(["![{0}]({0}.png)".format(x)] + ["{}".format(summary[d][x]) for d in distros])] + for x in ["total"]: + summarytable += [" | ".join([x] + ["{}".format(summary[d][x]) for d in distros])] + + print("\n".join(summarytable)) + print("") + print("\n".join(fulltable)) diff --git a/bin/travis-ci.sh b/bin/travis-ci.sh new file mode 100755 index 0000000..1a09f97 --- /dev/null +++ b/bin/travis-ci.sh @@ -0,0 +1,64 @@ +#!/bin/bash -e + +export EXPECTFAIL=${EXPECTFAIL:-0} + +function flipstatus() { + if [ $EXPECTFAIL -eq 0 ]; + then + echo $1 + else + case $1 in + FAILED) + echo SUCCEEDED + ;; + SUCCEEDED) + echo FAILED + ;; + *) + echo $1 + ;; + esac + fi +} + +starttime=$SECONDS +failed="" +for t in $TOOL; +do + set +e + toolstarttime=$SECONDS + echo "[-] TOOL $t TEST STARTED: $((SECONDS - starttime)) seconds since start of script." + if ! docker run -e EXPECTFAIL="$EXPECTFAIL" -e TOOL="$t" --rm ctftools bash -ic 'manage-tools -s -f -v test $TOOL'; + then + failed="$failed$t " + echo "[ACCOUNTING]=====[ $DISTRO $t $(flipstatus FAILED) $((SECONDS - toolstarttime)) ]" + else + echo "[ACCOUNTING]=====[ $DISTRO $t $(flipstatus SUCCEEDED) $((SECONDS - toolstarttime)) ]" + fi + echo "[-] TOOL $t TEST ENDED: $((SECONDS - toolstarttime)) seconds, $((SECONDS - starttime)) seconds since start of script." + set -e +done + +if [ "$failed" != "" ]; +then + echo "===================================================" + failcount=$(echo "$failed" | wc -w) + totalcount=$(echo "$TOOL" | wc -w) + if [ "$EXPECTFAIL" -eq "1" ]; + then + echo "ERROR: $failcount/$totalcount tools succeeded while they were expected to fail: $failed" + else + echo "ERROR: $failcount/$totalcount tools failed while they should have succeeded: $failed" + fi + echo "===================================================" + exit 1 +fi + +if [ "$EXPECTFAIL" -eq "1" ]; +then + echo "DONE: $totalcount tools failed as expected." +else + echo "DONE: $totalcount tools succeeded as expected." +fi + +exit 0 diff --git a/bindead/install b/bindead/install index 3249791..7ff864c 100755 --- a/bindead/install +++ b/bindead/install @@ -1,10 +1,11 @@ -#!/bin/bash -e +#!/bin/bash -ex INST_DIR="$PWD" [ -e bindead ] || git clone --depth 1 https://bitbucket.org/mihaila/bindead.git cd bindead JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre ./build.sh +mvn install cd .. [ -e p9 ] || git clone --depth 1 https://bitbucket.org/mihaila/p9.git diff --git a/bindead/install-root-debian b/bindead/install-root-debian index 09c3f63..4032d59 100755 --- a/bindead/install-root-debian +++ b/bindead/install-root-debian @@ -1,4 +1,11 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get -y install maven libprotobuf-dev openjdk-7-jre openjdk-7-jdk +case "$(lsb_release -cs)" in + xenial) + apt-get -o Dpkg::Options::="--force-overwrite" -y install maven libprotobuf-dev openjdk-9-jre openjdk-9-jdk + ;; + *) + apt-get -y install maven libprotobuf-dev openjdk-7-jre openjdk-7-jdk + ;; +esac diff --git a/binjitsu/install b/binjitsu/install deleted file mode 100755 index f75c139..0000000 --- a/binjitsu/install +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e - -#ctf-tools-pip install --upgrade 'git+https://github.com/binjitsu/binjitsu.git' -git clone --depth=1 'https://github.com/binjitsu/binjitsu.git' -ctf-tools-pip install --upgrade -e binjitsu diff --git a/binjitsu/install-root-archlinux b/binjitsu/install-root-archlinux deleted file mode 100755 index 24665a9..0000000 --- a/binjitsu/install-root-archlinux +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -e - -pacman -Syu --noconfirm --needed binutils openssl libffi diff --git a/binjitsu/install-root-ubuntu b/binjitsu/install-root-ubuntu deleted file mode 100755 index 50ac55e..0000000 --- a/binjitsu/install-root-ubuntu +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -e - -apt-get -y install software-properties-common -apt-add-repository -y ppa:pwntools/binutils -apt-get update -apt-get -y install binutils-.*-linux-gnu libffi-dev libssl-dev diff --git a/binjitsu/uninstall b/binjitsu/uninstall deleted file mode 100755 index 81cc9b9..0000000 --- a/binjitsu/uninstall +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -e - -ctf-tools-pip uninstall -y binjitsu || true diff --git a/binwalk/install b/binwalk/install index 074309c..cd85624 100755 --- a/binwalk/install +++ b/binwalk/install @@ -1,7 +1,7 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/devttys0/binwalk.git -pip install -e binwalk +ctf-tools-pip install -e binwalk mkdir -p bin ln -s $VIRTUAL_ENV/bin/binwalk bin diff --git a/burpsuite/install b/burpsuite/install index 69826ee..49f1411 100755 --- a/burpsuite/install +++ b/burpsuite/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex wget -O ./burp.jar 'https://portswigger.net/DownloadUpdate.ashx?Product=Free' chmod 755 ./burp.jar diff --git a/burpsuite/install-root-archlinux b/burpsuite/install-root-archlinux index 5a77a79..48d875e 100755 --- a/burpsuite/install-root-archlinux +++ b/burpsuite/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed jre7-openjdk diff --git a/burpsuite/install-root-debian b/burpsuite/install-root-debian index 78b0902..d414ddc 100755 --- a/burpsuite/install-root-debian +++ b/burpsuite/install-root-debian @@ -1,4 +1,11 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get -y install openjdk-7-jre +case "$(lsb_release -cs)" in + xenial) + apt-get -o Dpkg::Options::="--force-overwrite" -y install openjdk-9-jre + ;; + *) + apt-get -y install openjdk-7-jre + ;; +esac diff --git a/capstone/install b/capstone/install new file mode 100755 index 0000000..715e8af --- /dev/null +++ b/capstone/install @@ -0,0 +1,4 @@ +#!/bin/bash -ex + +ctf-tools-pip install --no-use-wheel -U capstone +ctf-tools-pip3 install --no-use-wheel -U capstone diff --git a/capstone/test b/capstone/test new file mode 100755 index 0000000..36e2881 --- /dev/null +++ b/capstone/test @@ -0,0 +1,33 @@ +#!/bin/bash -ex + +PY_TEST_FILE=$(mktemp) +cat << END > $PY_TEST_FILE +from capstone import * +import sys + +CODE = b"\x55\x48\x8b\x05\xb8\x13\x00\x00" + +addresses = [0x1000, 0x1001] +md = Cs(CS_ARCH_X86, CS_MODE_64) +for idx, i in enumerate(md.disasm(CODE, 0x1000)): + if i.address != addresses[idx]: + sys.exit(1) + +sys.exit(0) +END + +source ${VIRTUALENVWRAPPER_SCRIPT} + +set +e +workon ctftools +set -e +python $PY_TEST_FILE +deactivate + +set +e +workon ctftools3 +set -e +python $PY_TEST_FILE +deactivate + +rm $PY_TEST_FILE diff --git a/capstone/uninstall b/capstone/uninstall new file mode 100755 index 0000000..d8e4f24 --- /dev/null +++ b/capstone/uninstall @@ -0,0 +1,4 @@ +#!/bin/bash -ex + +ctf-tools-pip uninstall -y capstone || true +ctf-tools-pip3 uninstall -y capstone || true diff --git a/checksec/install b/checksec/install index d3d07bb..b0ad48d 100755 --- a/checksec/install +++ b/checksec/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/slimm609/checksec.sh mkdir bin diff --git a/codereason/install b/codereason/install index 4464357..2d8a115 100755 --- a/codereason/install +++ b/codereason/install @@ -1,8 +1,10 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/trailofbits/codereason cd codereason +find . -type f -exec sed -i 's:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain::g' {} \; ./install_vex.sh +# This step fails in travis-ci because of CMake 3.2 not finding Boost, while docker has CMake 2.8 which finds Boost just fine ./make.sh cd .. diff --git a/codereason/install-root-debian b/codereason/install-root-debian index ecf98f4..8232d7a 100755 --- a/codereason/install-root-debian +++ b/codereason/install-root-debian @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/bash -ex 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 +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 libboost-all-dev + diff --git a/commix/install b/commix/install index aeb3b94..6d9f304 100755 --- a/commix/install +++ b/commix/install @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex git clone --depth 1 https://github.com/stasinopoulos/commix.git mkdir bin diff --git a/cribdrag/install b/cribdrag/install index 8dbd38a..1fd414d 100755 --- a/cribdrag/install +++ b/cribdrag/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/SpiderLabs/cribdrag diff --git a/cross2/install b/cross2/install index 21508b1..1b0d534 100755 --- a/cross2/install +++ b/cross2/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex FILE=cross2-20130826.tgz INSTALL_DIR=$PWD diff --git a/crosstool/install b/crosstool/install index 905bb58..5eec21b 100755 --- a/crosstool/install +++ b/crosstool/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex mkdir -p src [ -e crosstool-ng ] || git clone --depth 1 https://github.com/crosstool-ng/crosstool-ng.git diff --git a/crosstool/install-root-archlinux b/crosstool/install-root-archlinux index b071db2..9319c65 100755 --- a/crosstool/install-root-archlinux +++ b/crosstool/install-root-archlinux @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex pacman -Syu --noconfirm gperf flex bison help2man gawk ncurses diff --git a/crosstool/install-root-debian b/crosstool/install-root-debian index b9e870d..f569ad7 100755 --- a/crosstool/install-root-debian +++ b/crosstool/install-root-debian @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex apt-get install -y gperf flex bison help2man gawk libncurses5-dev diff --git a/crosstool/uninstall b/crosstool/uninstall index 396e755..5c3ecb2 100755 --- a/crosstool/uninstall +++ b/crosstool/uninstall @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex [ -e x-tools ] && chmod -R u+w x-tools rm -rf crosstools-ng diff --git a/df/install b/df/install index c8c7ffb..bb485f6 100755 --- a/df/install +++ b/df/install @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/bash -ex -wget -O - http://www.bay12games.com/dwarves/df_42_02_linux.tar.bz2 | tar xj +wget -O - http://www.bay12games.com/dwarves/df_43_05_linux.tar.bz2 | tar xj mkdir -p bin cat < bin/dwarf_fortress diff --git a/df/install-root-debian b/df/install-root-debian index 4b5294d..00b6825 100755 --- a/df/install-root-debian +++ b/df/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex 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 b/dirb/install index 7b8409b..a12cb85 100755 --- a/dirb/install +++ b/dirb/install @@ -1,11 +1,11 @@ -#!/bin/bash -e +#!/bin/bash -ex mkdir bin -wget -O dirb.tar.gz https://sourceforge.net/projects/dirb/files/latest/download +wget -O dirb.tar.gz http://downloads.sourceforge.net/project/dirb/dirb/2.22/dirb222.tar.gz tar -xf dirb.tar.gz chmod -R a+X dirb222/ -cd dirb* +cd dirb222 chmod a+x configure ./configure make diff --git a/dirb/install-root-archlinux b/dirb/install-root-archlinux index c9eddd1..3da8976 100755 --- a/dirb/install-root-archlinux +++ b/dirb/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed curl gnutls diff --git a/dirb/install-root-debian b/dirb/install-root-debian index 86c573c..b5566fe 100755 --- a/dirb/install-root-debian +++ b/dirb/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail apt-get -y install libcurl4-gnutls-dev diff --git a/dirsearch/install b/dirsearch/install index 6a3a5c0..ec5c6f4 100755 --- a/dirsearch/install +++ b/dirsearch/install @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex mkdir bin git clone --depth 1 https://github.com/maurosoria/dirsearch.git diff --git a/dislocker/install b/dislocker/install index 261e0a1..6ccd217 100755 --- a/dislocker/install +++ b/dislocker/install @@ -1,14 +1,18 @@ -#!/bin/bash +#!/bin/bash -ex -wget http://www.hsc.fr/ressources/outils/dislocker/download/dislocker.tar.bz2 -tar xjf dislocker.tar.bz2 -cd dislocker/src -sed 's?override LDFLAGS.*?& -Wl,-rpath,'`pwd`'?' < Makefile > Makefile.tmp && mv Makefile.tmp Makefile +wget -O dislocker.tar.gz https://github.com/Aorimn/dislocker/archive/v0.7.1.tar.gz +tar xf dislocker.tar.gz +DISLOCKERDIR=$(ls -d dislocker-*) +cd $DISLOCKERDIR + +cmake . make -j $(nproc) -cd ../.. +cd .. mkdir bin cd bin -ln -s ../dislocker/src/dislocker-bek . -ln -s ../dislocker/src/dislocker-file . -ln -s ../dislocker/src/dislocker-fuse . -ln -s ../dislocker/src/dislocker-metadata . +ls -l ../$DISLOCKERDIR/src/ + +ln -s ../$DISLOCKERDIR/src/dislocker-bek . +ln -s ../$DISLOCKERDIR/src/dislocker-file . +ln -s ../$DISLOCKERDIR/src/dislocker-fuse . +ln -s ../$DISLOCKERDIR/src/dislocker-metadata . diff --git a/dislocker/install-root-archlinux b/dislocker/install-root-archlinux index 57c736c..4bec1db 100755 --- a/dislocker/install-root-archlinux +++ b/dislocker/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed mbedtls fuse diff --git a/dislocker/install-root-debian b/dislocker/install-root-debian index 5836fd3..d67146d 100755 --- a/dislocker/install-root-debian +++ b/dislocker/install-root-debian @@ -1,4 +1,11 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get -y install libfuse-dev libpolarssl-dev +case "$(lsb_release -cs)" in + xenial) + apt-get -y install gcc cmake make libfuse-dev libmbedtls-dev ruby-dev + ;; + *) + apt-get -y install gcc cmake make libfuse-dev libpolarssl-dev ruby-dev + ;; +esac diff --git a/elfkickers/install b/elfkickers/install index d5ed894..fb0f7b3 100755 --- a/elfkickers/install +++ b/elfkickers/install @@ -1,7 +1,7 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/BR903/ELFkickers cd ELFkickers -make -j +make -j $(nproc) cd .. mv ELFkickers/bin ./bin diff --git a/elfparser/install b/elfparser/install index 901eb2e..c97c8e3 100755 --- a/elfparser/install +++ b/elfparser/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex wget http://www.elfparser.com/release/elfparser_x86_64_1.4.0.deb dpkg -x elfparser_x86_64_1.4.0.deb . diff --git a/elfparser/install-root-debian b/elfparser/install-root-debian index 4d5cad2..a02a16c 100755 --- a/elfparser/install-root-debian +++ b/elfparser/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail apt-get install -y libqt5widgets5 diff --git a/evilize/install b/evilize/install index c8cf94d..5cf4105 100755 --- a/evilize/install +++ b/evilize/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex wget http://www.mscs.dal.ca/~selinger/md5collision/downloads/evilize-0.2.tar.gz tar zvxf evilize-0.2.tar.gz diff --git a/exetractor/install b/exetractor/install index 25f96eb..68652b1 100755 --- a/exetractor/install +++ b/exetractor/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/kholia/exetractor-clone.git diff --git a/fastcoll/install b/fastcoll/install new file mode 100755 index 0000000..2d3b37e --- /dev/null +++ b/fastcoll/install @@ -0,0 +1,9 @@ +#!/bin/bash -ex + +[ -e fastcoll ] || git clone https://github.com/upbit/clone-fastcoll fastcoll +cd fastcoll +make + +cd .. +mkdir bin +cp fastcoll/fastcoll bin diff --git a/featherduster/install b/featherduster/install index 409e77d..f032021 100755 --- a/featherduster/install +++ b/featherduster/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth=1 https://github.com/nccgroup/featherduster.git ctf-tools-pip install --upgrade -e featherduster diff --git a/featherduster/install-root-debian b/featherduster/install-root-debian new file mode 100755 index 0000000..a3d8a1c --- /dev/null +++ b/featherduster/install-root-debian @@ -0,0 +1,5 @@ +#!/bin/bash -ex +set -eu -o pipefail + +apt-get -y install libgmp3-dev libncurses5-dev + diff --git a/featherduster/uninstall b/featherduster/uninstall index 0a69434..67ec03a 100755 --- a/featherduster/uninstall +++ b/featherduster/uninstall @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex ctf-tools-pip uninstall -y featherduster || true diff --git a/firmware-mod-kit/install b/firmware-mod-kit/install index c6b4ee5..c723630 100755 --- a/firmware-mod-kit/install +++ b/firmware-mod-kit/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/mirror/firmware-mod-kit.git cd firmware-mod-kit/src diff --git a/firmware-mod-kit/install-root-archlinux b/firmware-mod-kit/install-root-archlinux index 98639df..06d80b0 100755 --- a/firmware-mod-kit/install-root-archlinux +++ b/firmware-mod-kit/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex 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 index 3bcd4b2..eb00ee7 100755 --- a/firmware-mod-kit/install-root-debian +++ b/firmware-mod-kit/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail apt-get -y install liblzma-dev python-magic zlib1g-dev diff --git a/foresight/install b/foresight/install index 4e796d3..926ca05 100755 --- a/foresight/install +++ b/foresight/install @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex ctf-tools-pip3 install --upgrade 'git+https://github.com/ALSchwalm/foresight.git' diff --git a/foresight/uninstall b/foresight/uninstall index 2849572..bd6b77d 100755 --- a/foresight/uninstall +++ b/foresight/uninstall @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex ctf-tools-pip3 uninstall -y foresight || true diff --git a/gdb-heap/install b/gdb-heap/install new file mode 100755 index 0000000..89fed9f --- /dev/null +++ b/gdb-heap/install @@ -0,0 +1,22 @@ +#!/bin/bash -ex + +git clone --depth=1 http://git.fedorahosted.org/git/gdb-heap.git || true + +cd gdb-heap +# make sure gdbinit exists +touch ~/.gdbinit +if ! grep "init-gdb-heap" ~/.gdbinit; then + cat >> ~/.gdbinit <> ~/.gdbinit < bin/jd-gui +#/bin/bash -e +java -jar $PWD/jd-gui-1.4.0.jar "\$@" +END +chmod 755 bin/jd-gui diff --git a/jdgui/install-root-archlinux b/jdgui/install-root-archlinux new file mode 100755 index 0000000..48d875e --- /dev/null +++ b/jdgui/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash -ex +set -eu -o pipefail + +pacman -Syu --noconfirm --needed jre7-openjdk diff --git a/jdgui/install-root-debian b/jdgui/install-root-debian new file mode 100755 index 0000000..10eff87 --- /dev/null +++ b/jdgui/install-root-debian @@ -0,0 +1,12 @@ +#!/bin/bash -ex +set -eu -o pipefail + + +case "$(lsb_release -cs)" in + xenial) + apt-get -o Dpkg::Options::="--force-overwrite" -y install openjdk-9-jre + ;; + *) + apt-get -y install openjdk-7-jre + ;; +esac diff --git a/keystone/install b/keystone/install new file mode 100755 index 0000000..8d73cc0 --- /dev/null +++ b/keystone/install @@ -0,0 +1,5 @@ +#!/bin/bash -ex + +ctf-tools-pip install -U keystone +# seems to be broken? +#ctf-tools-pip3 install -U keystone diff --git a/keystone/test b/keystone/test new file mode 100755 index 0000000..23479c1 --- /dev/null +++ b/keystone/test @@ -0,0 +1,14 @@ +#!/bin/bash -ex +set -e -o pipefail + +source ctf-tools-venv-activate + +python <> ~/.gdbinit </dev/null 2>&1 ; then + export LLVM_CONFIG=$(which llvm-config-3.9) + ctf-tools-pip install "llvmlite==0.16" +elif which llvm-config-3.8 >/dev/null 2>&1 ; then + export LLVM_CONFIG=$(which llvm-config-3.8) + ctf-tools-pip install "llvmlite==0.15" +elif which llvm-config >/dev/null 2>&1; then + # let's hope for the best + ctf-tools-pip install llvmlite +else + echo "Skipping llvmlite install!" +fi + +ctf-tools-pip install -e elfesteem +ctf-tools-pip install -e miasm diff --git a/miasm/install-root-archlinux b/miasm/install-root-archlinux new file mode 100755 index 0000000..df89e80 --- /dev/null +++ b/miasm/install-root-archlinux @@ -0,0 +1,4 @@ +#!/bin/bash -ex + +pacman -Syu --needed --noconfirm \ + zlib libstdc++5 llvm clang libedit diff --git a/miasm/install-root-debian b/miasm/install-root-debian new file mode 100755 index 0000000..9fe368f --- /dev/null +++ b/miasm/install-root-debian @@ -0,0 +1,7 @@ +#!/bin/bash -ex + +apt-get install -y \ + zlib1g zlib1g-dev \ + libstdc++6 \ + llvm-3.8 llvm-3.8-dev clang-3.8 \ + libedit2 libedit-dev diff --git a/miasm/install-root-fedora b/miasm/install-root-fedora new file mode 100755 index 0000000..9424c31 --- /dev/null +++ b/miasm/install-root-fedora @@ -0,0 +1,6 @@ +#!/bin/bash -ex + +dnf install -y zlib zlib-devel \ + libstdc++-devel libstdc++ libstdc++-static \ + llvm llvm-devel \ + libedit libedit-devel diff --git a/miasm/uninstall b/miasm/uninstall new file mode 100755 index 0000000..e9af19a --- /dev/null +++ b/miasm/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -ex + +ctf-tools-pip uninstall -y llvmlite elfesteem miasm || true diff --git a/mitmproxy/install b/mitmproxy/install index e9a0c83..e576121 100755 --- a/mitmproxy/install +++ b/mitmproxy/install @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex -ctf-tools-pip install --upgrade mitmproxy +ctf-tools-pip install --upgrade packaging mitmproxy diff --git a/mitmproxy/install-root-debian b/mitmproxy/install-root-debian new file mode 100755 index 0000000..70ce3c8 --- /dev/null +++ b/mitmproxy/install-root-debian @@ -0,0 +1,5 @@ +#!/bin/bash -ex +set -eu -o pipefail + +apt-get -y install libssl-dev libffi-dev libtiff5-dev libjpeg8-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk libxml2-dev libxslt1-dev + diff --git a/mitmproxy/uninstall b/mitmproxy/uninstall index 3ca4c72..0c2fda3 100755 --- a/mitmproxy/uninstall +++ b/mitmproxy/uninstall @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex ctf-tools-pip uninstall -y mitmproxy || true diff --git a/msieve/install b/msieve/install index c9f661e..cdab3d5 100755 --- a/msieve/install +++ b/msieve/install @@ -1,7 +1,7 @@ -#!/bin/bash -e +#!/bin/bash -ex mkdir bin -wget -O msieve.tar.gz https://sourceforge.net/projects/msieve/files/latest/download +wget -O msieve.tar.gz "http://downloads.sourceforge.net/project/msieve/msieve/Msieve v1.53/msieve153_src.tar.gz" tar -xf msieve.tar.gz cd msieve-* diff --git a/msieve/install-root-archlinux b/msieve/install-root-archlinux index 29c434a..1f571c9 100755 --- a/msieve/install-root-archlinux +++ b/msieve/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed gmp diff --git a/msieve/install-root-debian b/msieve/install-root-debian index 4f25dcb..bcb3bc1 100755 --- a/msieve/install-root-debian +++ b/msieve/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get -y install libgmp3-dev libgmp-dev +apt-get -y install libgmp3-dev libgmp-dev libz-dev diff --git a/panda/install b/panda/install index 5f1cf0a..abde86f 100755 --- a/panda/install +++ b/panda/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex [ -e panda ] || git clone --depth 1 https://github.com/moyix/panda @@ -11,7 +11,7 @@ cp distorm3/make/linux/*.so distorm3/*.a lib mkdir -p include cp distorm3/include/*.h include -pip install -U pycparser +ctf-tools-pip install -U pycparser sed -i -e "s|/usr/local|$PWD|" panda/qemu/build.sh export QEMU_CFLAGS="-I $PWD/include -L $PWD/lib" diff --git a/panda/install-root-archlinux b/panda/install-root-archlinux index 8d2ce2d..39d013d 100755 --- a/panda/install-root-archlinux +++ b/panda/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --needed --noconfirm nasm openssl libpcap subversion curl \ diff --git a/panda/install-root-debian b/panda/install-root-debian index 331a865..3ef1c3f 100755 --- a/panda/install-root-debian +++ b/panda/install-root-debian @@ -1,5 +1,7 @@ -#!/bin/bash +#!/bin/bash -ex 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 + autoconf libtool libc++-dev llvm-3.3-dev clang-3.3 unzip \ + protobuf-c-compiler protobuf-compiler libprotobuf-dev pkg-config \ + libglib2.0-dev libdwarf-dev diff --git a/pathgrind/install b/pathgrind/install index a7dcefa..b43d9c1 100755 --- a/pathgrind/install +++ b/pathgrind/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/codelion/pathgrind.git cd pathgrind diff --git a/pathgrind/install-root-debian b/pathgrind/install-root-debian index 961843c..8c3cb4e 100755 --- a/pathgrind/install-root-debian +++ b/pathgrind/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail apt-get -y install libc6-dev-i386 libc6-dev diff --git a/pdf-parser/install b/pdf-parser/install index 1269668..99748ec 100755 --- a/pdf-parser/install +++ b/pdf-parser/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex wget https://didierstevens.com/files/software/pdf-parser_V0_6_4.zip unzip pdf-parser_V0_6_4.zip diff --git a/peda/install b/peda/install index ec0e06f..7b2e820 100755 --- a/peda/install +++ b/peda/install @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail git clone --depth 1 https://github.com/longld/peda.git @@ -11,7 +11,8 @@ EOF chmod +rx bin/gdb-peda cd peda -#echo "source $PWD/peda.py" >> ~/.gdbinit +# make sure gdbinit exists +touch ~/.gdbinit if ! grep "init-peda" ~/.gdbinit; then cat >> ~/.gdbinit <> bin/pwndbg <> ~/.gdbinit < bin/pyvmmonitor-ui diff --git a/qemu/install b/qemu/install index c0803c7..7f4063b 100755 --- a/qemu/install +++ b/qemu/install @@ -1,11 +1,10 @@ -#!/bin/bash +#!/bin/bash -ex +set -e -o pipefail -curl http://wiki.qemu-project.org/download/qemu-2.4.1.tar.bz2 | tar xvj -cd qemu-2.4.1 -if [[ "$(python --version 2>&1)" =~ Python\ 3 ]]; then - ./configure "--prefix=$(dirname $PWD)" "--python=$(which python2)" -else - ./configure "--prefix=$(dirname $PWD)" -fi +curl http://download.qemu-project.org/qemu-2.8.0.tar.bz2 | tar xvj +cd qemu-2.8.0 + +source ctf-tools-venv-activate +./configure "--prefix=$(dirname $PWD)" "--python=$(which python)" make -j $(nproc) make install diff --git a/qemu/install-root-archlinux b/qemu/install-root-archlinux index dc6ba02..216dd19 100755 --- a/qemu/install-root-archlinux +++ b/qemu/install-root-archlinux @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex pacman -Syu --noconfirm --needed python2 diff --git a/qemu/install-root-debian b/qemu/install-root-debian index 6d0eb02..d453ea8 100755 --- a/qemu/install-root-debian +++ b/qemu/install-root-debian @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex -apt-get install -y python +apt-get install -y python pkg-config zlib1g-dev libglib2.0-dev diff --git a/qira/install b/qira/install index 16ebdf1..7ff7cb4 100755 --- a/qira/install +++ b/qira/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex mkdir nosudo cat < nosudo/sudo diff --git a/qira/install-root-archlinux b/qira/install-root-archlinux index c9bc049..cf17c26 100755 --- a/qira/install-root-archlinux +++ b/qira/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed python2-pip openssl libjpeg-turbo zlib \ diff --git a/qira/install-root-debian b/qira/install-root-debian index 4d822d1..76fdceb 100755 --- a/qira/install-root-debian +++ b/qira/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex 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 diff --git a/radare2/install b/radare2/install index ed32022..300b2c3 100755 --- a/radare2/install +++ b/radare2/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/radare/radare2.git cd radare2/ @@ -17,3 +17,5 @@ LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$PWD/../lib $PWD/$i.real "\$@" END chmod 755 $i done + +ctf-tools-pip install -U r2pipe diff --git a/radare2/uninstall b/radare2/uninstall new file mode 100755 index 0000000..28e6315 --- /dev/null +++ b/radare2/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash -ex + +ctf-tools-pip uninstall -y r2pipe || true diff --git a/reveng/install b/reveng/install index 3d066ea..71e3a8e 100755 --- a/reveng/install +++ b/reveng/install @@ -1,11 +1,11 @@ -#!/bin/bash +#!/bin/bash -ex -curl http://jaist.dl.sourceforge.net/project/reveng/1.4.0/reveng-1.4.0.tar.gz | tar xz -cd reveng-1.4.0 +curl http://jaist.dl.sourceforge.net/project/reveng/1.4.4/reveng-1.4.4.tar.gz | tar xz +cd reveng-1.4.4 sed -i -e "s/^#define BMP_BIT.*/#define BMP_BIT 64/" config.h sed -i -e "s/^#define BMP_SUB.*/#define BMP_SUB 32/" config.h make -j $(nproc) cd .. mkdir -p bin -cp reveng-1.4.0/reveng bin +cp reveng-1.4.4/reveng bin diff --git a/ropper/install b/ropper/install index a81cbfd..6bc0fb1 100755 --- a/ropper/install +++ b/ropper/install @@ -1,7 +1,7 @@ -#!/bin/bash -e +#!/bin/bash -ex [ -e ropper ] || git clone --depth 1 https://github.com/sashs/Ropper.git ropper -pip install --no-use-wheel --no-cache-dir -I capstone -pip install filebytes -pip install -e ropper +ctf-tools-pip install --no-use-wheel -I capstone +ctf-tools-pip install filebytes +ctf-tools-pip install -e ropper diff --git a/ropper/test b/ropper/test index 0a7ecbc..fcb90c9 100755 --- a/ropper/test +++ b/ropper/test @@ -1,4 +1,9 @@ -#!/bin/bash -e +#!/bin/bash -ex + +set +e +source ${VIRTUALENVWRAPPER_SCRIPT} +workon ctftools +set -e [ $(ropper --file /bin/false | wc -l) -gt 400 ] || exit 1 exit 0 diff --git a/rp++/install b/rp++/install index 57efbc7..9a92976 100755 --- a/rp++/install +++ b/rp++/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex # 64bit test diff --git a/rr/configure-system b/rr/configure-system new file mode 100755 index 0000000..f5b17b6 --- /dev/null +++ b/rr/configure-system @@ -0,0 +1,3 @@ +#!/bin/bash -e + +echo 'kernel.perf_event_paranoid = 1' | sudo tee /etc/sysctl.d/10-rr.conf diff --git a/rr/install b/rr/install new file mode 100755 index 0000000..8a7b128 --- /dev/null +++ b/rr/install @@ -0,0 +1,8 @@ +#!/bin/bash -ex + +git clone https://github.com/mozilla/rr.git +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=.. -G Ninja ../rr +ninja || ninja-build +ninja install || ninja-build install diff --git a/rr/install-root-archlinux b/rr/install-root-archlinux new file mode 100755 index 0000000..429bd9c --- /dev/null +++ b/rr/install-root-archlinux @@ -0,0 +1,5 @@ +#!/bin/bash -ex + +pacman -Syu --noconfirm --needed \ + ccache cmake gdb python2-pexpect ninja zlib +./configure-system diff --git a/rr/install-root-debian b/rr/install-root-debian new file mode 100755 index 0000000..a0431f6 --- /dev/null +++ b/rr/install-root-debian @@ -0,0 +1,6 @@ +#!/bin/bash -ex + +apt-get install -y ccache cmake make g++-multilib gdb \ + pkg-config libz-dev realpath python-pexpect manpages-dev git zlib1g-dev \ + ninja-build +./configure-system diff --git a/rr/install-root-fedora b/rr/install-root-fedora new file mode 100755 index 0000000..53d66ac --- /dev/null +++ b/rr/install-root-fedora @@ -0,0 +1,7 @@ +#!/bin/bash -ex + +dnf install -y \ + ccache cmake make gcc gcc-c++ gdb \ + glibc-devel glibc-devel.i686 libstdc++-devel libstdc++-devel.i686 zlib-devel \ + python-pexpect man-pages ninja-build +./configure-system diff --git a/scrdec18/install b/scrdec18/install index 19e946a..59aac3b 100755 --- a/scrdec18/install +++ b/scrdec18/install @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex wget "https://gist.githubusercontent.com/bcse/1834878/raw/7483fb72abbb32aa69b853fdcc9f6f72e7568677/scrdec18.c" mkdir -p bin diff --git a/shellnoob/install b/shellnoob/install index f41b1b3..58038b6 100755 --- a/shellnoob/install +++ b/shellnoob/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/reyammer/shellnoob diff --git a/shellsploit/install b/shellsploit/install index 56a4e7a..c6c8f92 100755 --- a/shellsploit/install +++ b/shellsploit/install @@ -1,7 +1,12 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone https://github.com/b3mb4m/shellsploit-framework.git cd shellsploit-framework + +set +e +source ${VIRTUALENVWRAPPER_SCRIPT} +workon ctftools +set -e python easyinstall.py install cd .. @@ -9,3 +14,4 @@ mkdir -p bin cd bin ln -sf $VIRTUAL_ENV/bin/shellsploit . cd .. +deactivate diff --git a/snowman/install b/snowman/install index c421d6a..4625277 100755 --- a/snowman/install +++ b/snowman/install @@ -1,12 +1,9 @@ -#!/bin/bash -e +#!/bin/bash -ex INST_DIR=$PWD -#[ -e snowman ] || git clone --depth 1 --depth 1 https://github.com/yegord/snowman -[ -e v1.0.tar.gz ] || wget https://github.com/nihilus/snowman/archive/v1.0.tar.gz -tar xzf v1.0.tar.gz -cd snowman-1.0 -rm -rf build +[ -e snowman ] || git clone --depth 1 https://github.com/yegord/snowman +cd snowman mkdir build cd build cmake -D CMAKE_INSTALL_PREFIX=$INST_DIR ../src diff --git a/snowman/install-root-archlinux b/snowman/install-root-archlinux index 453cf15..a67d742 100755 --- a/snowman/install-root-archlinux +++ b/snowman/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --needed --noconfirm boost boost-libs cmake diff --git a/snowman/install-root-debian b/snowman/install-root-debian index 9a92121..01652c4 100755 --- a/snowman/install-root-debian +++ b/snowman/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail apt-get -y install libboost-dev cmake libqt4-dev diff --git a/snowman/install-root-fedora b/snowman/install-root-fedora new file mode 100755 index 0000000..f05ba18 --- /dev/null +++ b/snowman/install-root-fedora @@ -0,0 +1,4 @@ +#!/bin/bash -ex +set -eu -o pipefail + +dnf install -y boost cmake qt5-base qqt5-base-devel diff --git a/sonic-visualizer/install b/sonic-visualizer/install index 34cbb39..840bccd 100755 --- a/sonic-visualizer/install +++ b/sonic-visualizer/install @@ -1,11 +1,11 @@ -#!/bin/bash -e +#!/bin/bash -ex INST_DIR=$PWD wget --no-check-certificate -O - https://code.soundsoftware.ac.uk/attachments/download/1675/sonic-visualiser-2.5.tar.gz | tar xz cd sonic-visualiser-2.5 ./configure --prefix=$INST_DIR -make -j +make -j $(nproc) #make install mkdir -p bin diff --git a/sonic-visualizer/install-root-archlinux b/sonic-visualizer/install-root-archlinux index 73a440f..615e753 100755 --- a/sonic-visualizer/install-root-archlinux +++ b/sonic-visualizer/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed bzip2 fftw libsndfile libsamplerate \ diff --git a/sonic-visualizer/install-root-debian b/sonic-visualizer/install-root-debian index 1f38931..71fa5ee 100755 --- a/sonic-visualizer/install-root-debian +++ b/sonic-visualizer/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex 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 +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 qt5-default libasound-dev diff --git a/sqlmap/install b/sqlmap/install index 5bfd504..e701829 100755 --- a/sqlmap/install +++ b/sqlmap/install @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/bash -ex git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git -pip install pymysql psycopg2 pysqlite2 python-ntlm +ctf-tools-pip install pymysql psycopg2 pysqlite python-ntlm mkdir bin cd bin ln -s ../sqlmap/sqlmap.py . diff --git a/sqlmap/install-root-archlinux b/sqlmap/install-root-archlinux index 6f4f7f2..f594bc2 100755 --- a/sqlmap/install-root-archlinux +++ b/sqlmap/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed sqlite diff --git a/sqlmap/install-root-debian b/sqlmap/install-root-debian index 2ff2b0e..16da7d8 100755 --- a/sqlmap/install-root-debian +++ b/sqlmap/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get -y install libsqlite3-dev +apt-get -y install libsqlite3-dev libpq-dev diff --git a/ssh_decoder/install b/ssh_decoder/install index d7b32b7..f6a8fae 100755 --- a/ssh_decoder/install +++ b/ssh_decoder/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/jjyg/ssh_decoder.git chmod 755 ssh_decoder/ssh_decoder.rb diff --git a/sslsplit/install b/sslsplit/install index 2133381..d396b11 100755 --- a/sslsplit/install +++ b/sslsplit/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/droe/sslsplit cd sslsplit diff --git a/sslsplit/install-root-archlinux b/sslsplit/install-root-archlinux index dd0b5bb..c67f458 100755 --- a/sslsplit/install-root-archlinux +++ b/sslsplit/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed libevent diff --git a/sslsplit/install-root-debian b/sslsplit/install-root-debian index 3e352e1..0564932 100755 --- a/sslsplit/install-root-debian +++ b/sslsplit/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get -y install libevent-dev +apt-get -y install libevent-dev pkg-config libssl-dev diff --git a/steganabara/install b/steganabara/install index 0a923b1..5bf6949 100755 --- a/steganabara/install +++ b/steganabara/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex curl http://www.caesum.com/handbook/steganabara-1.1.1.tar.gz | tar xz mkdir -p bin diff --git a/stegdetect/install b/stegdetect/install index c59a49b..aea2646 100755 --- a/stegdetect/install +++ b/stegdetect/install @@ -1,14 +1,11 @@ -#!/bin/bash -e +#!/bin/bash -ex INST_DIR="$PWD" -#wget -O - http://www.outguess.org/stegdetect-0.6.tar.gz | tar xz -#cd stegdetect-0.6 -git clone --depth 1 https://github.com/abeluck/stegdetect stegdetect-0.6 -wget -O - http://archive.debian.org/debian-archive/debian/pool/main/s/stegdetect/stegdetect_0.6-3.tar.gz | tar xz stegdetect-0.6/file/Magdir/varied.out +git clone --depth 1 https://github.com/AlexandreFournier/stegdetect.git mkdir -p bin etc man/man1 share/stegbreak -cd stegdetect-0.6 +cd stegdetect linux32 ./configure --prefix="$INST_DIR" linux32 make linux32 make install diff --git a/stegdetect/install-root-archlinux b/stegdetect/install-root-archlinux new file mode 100755 index 0000000..c1ad9db --- /dev/null +++ b/stegdetect/install-root-archlinux @@ -0,0 +1,7 @@ +#!/bin/bash -ex +set -eu -o pipefail + +echo "ERROR: archlinux has no aclocal-1.4. only $(aclocal --version | head -n 1)" +exit 1 + +pacman -Syu --noconfirm --needed automake diff --git a/stegdetect/install-root-debian b/stegdetect/install-root-debian index 6852027..3034e68 100755 --- a/stegdetect/install-root-debian +++ b/stegdetect/install-root-debian @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get -y install automake1.4 +apt-get -y install automake1.4 automake autotools-dev libevent-dev diff --git a/stegsolve/install b/stegsolve/install index be5b6af..a259dbc 100755 --- a/stegsolve/install +++ b/stegsolve/install @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex wget http://www.caesum.com/handbook/Stegsolve.jar -O stegsolve.jar chmod +x stegsolve.jar diff --git a/subbrute/install b/subbrute/install index 864238b..a8e5186 100755 --- a/subbrute/install +++ b/subbrute/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex git clone --depth 1 https://github.com/TheRook/subbrute.git diff --git a/taintgrind/install b/taintgrind/install index 002676c..d0c7988 100755 --- a/taintgrind/install +++ b/taintgrind/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex INST_DIR=$PWD diff --git a/testdisk/install b/testdisk/install index 0299373..2fe8a89 100755 --- a/testdisk/install +++ b/testdisk/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex curl https://www.cgsecurity.org/testdisk-7.0.linux26-x86_64.tar.bz2 | tar xj diff --git a/tor-browser/install b/tor-browser/install index c6d57ef..58ac20e 100755 --- a/tor-browser/install +++ b/tor-browser/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex REL_PATH=$(curl https://www.torproject.org/projects/torbrowser.html.en#downloads | grep -i tor-browser-linux | grep hardened | grep td | sed -e 's/.*href="//' -e 's/">.*//') wget https://www.torproject.org/projects/$REL_PATH -O - | tar xvJ diff --git a/unicorn/install b/unicorn/install new file mode 100755 index 0000000..f3291f1 --- /dev/null +++ b/unicorn/install @@ -0,0 +1,4 @@ +#!/bin/bash -ex + +ctf-tools-pip install -U unicorn +ctf-tools-pip3 install -U unicorn diff --git a/unicorn/install-root-debian b/unicorn/install-root-debian new file mode 100755 index 0000000..dac4551 --- /dev/null +++ b/unicorn/install-root-debian @@ -0,0 +1,3 @@ +#!/bin/bash -ex + +apt-get -y install libglib2.0-dev diff --git a/unicorn/test b/unicorn/test new file mode 100755 index 0000000..88c7ef1 --- /dev/null +++ b/unicorn/test @@ -0,0 +1,30 @@ +#!/bin/bash -ex +set -e -o pipefail + +source ctf-tools-venv-activate + +python <&/*#include */&g" \ + src/wsh/include/libwitch/wsh.h +fi + + make mv bin/ ../ popd diff --git a/wcc/install-root-archlinux b/wcc/install-root-archlinux index 75c5b0d..91ec20b 100755 --- a/wcc/install-root-archlinux +++ b/wcc/install-root-archlinux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail pacman -Syu --noconfirm --needed clang uthash readline capstone \ diff --git a/wcc/install-root-debian b/wcc/install-root-debian index 1c03f48..24c5307 100755 --- a/wcc/install-root-debian +++ b/wcc/install-root-debian @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/bash -ex set -eu -o pipefail -apt-get install clang libbfd-dev uthash-dev \ +apt-get -y install clang libbfd-dev uthash-dev \ libelf-dev libcapstone-dev \ libreadline6 libreadline6-dev \ libiberty-dev libgsl-dev diff --git a/wcc/install-root-fedora b/wcc/install-root-fedora new file mode 100755 index 0000000..7f55248 --- /dev/null +++ b/wcc/install-root-fedora @@ -0,0 +1,6 @@ +#!/bin/bash -ex +set -eu -o pipefail + +dnf install -y clang clang-libs clang-devel binutils binutils-devel \ + uthash-devel elfutils-libelf elfutils-libelf-devel capstone \ + capstone-devel readline readline-devel gsl gsl-devel diff --git a/xortool/install b/xortool/install index d7f733c..566b8bd 100755 --- a/xortool/install +++ b/xortool/install @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex ctf-tools-pip install --upgrade 'git+https://github.com/hellman/xortool.git' diff --git a/xortool/uninstall b/xortool/uninstall index fae39d7..c7353cb 100755 --- a/xortool/uninstall +++ b/xortool/uninstall @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/bin/bash -ex ctf-tools-pip uninstall -y xortool || true diff --git a/xrop/install b/xrop/install index 6c825e8..4adfdb9 100755 --- a/xrop/install +++ b/xrop/install @@ -1,12 +1,12 @@ -#!/bin/bash +#!/bin/bash -ex git clone --depth 1 https://github.com/acama/xrop.git cd xrop git submodule update --init --recursive -make -j $(nproc) +make -j 1 # Watch out!! -j $(nproc) makes the build fail cd .. mkdir bin cd bin -ln -s ../xrop/xrop . +ln -s ../xrop cd .. diff --git a/xspy/install b/xspy/install new file mode 100755 index 0000000..dbabab3 --- /dev/null +++ b/xspy/install @@ -0,0 +1,5 @@ +#!/bin/bash -ex + +[ -e xspy ] || git clone git://git.kali.org/packages/xspy.git +mkdir -p bin +gcc -o bin/xspy xspy/Xspy.c -lX11 diff --git a/xspy/install-root-debian b/xspy/install-root-debian new file mode 100755 index 0000000..9233fb5 --- /dev/null +++ b/xspy/install-root-debian @@ -0,0 +1,3 @@ +#!/bin/bash -ex + +apt-get install -y libx11-dev diff --git a/yafu/install b/yafu/install index 0e833cd..982b9fb 100755 --- a/yafu/install +++ b/yafu/install @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex mkdir yafu mkdir bin diff --git a/yafu/test b/yafu/test index 5089fb0..079a1b4 100755 --- a/yafu/test +++ b/yafu/test @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex RESULT=$(./bin/yafu 'factor(10)' | grep "^P" | tr -d '\n') [ "$RESULT" == "P1 = 2P1 = 5" ] || exit 1 diff --git a/z3/install b/z3/install new file mode 100755 index 0000000..51efe3d --- /dev/null +++ b/z3/install @@ -0,0 +1,18 @@ +#!/bin/bash -ex + +git clone https://github.com/Z3Prover/z3 +cd z3 + +# move to ctftools virtual env +set +e +source ${VIRTUALENVWRAPPER_SCRIPT} +workon ctftools +set -e + +# install z3 +python scripts/mk_make.py --python +cd build +make +make install + +deactivate diff --git a/z3/test b/z3/test new file mode 100755 index 0000000..1d53bdc --- /dev/null +++ b/z3/test @@ -0,0 +1,9 @@ +#!/bin/bash -ex + +set +e +source ${VIRTUALENVWRAPPER_SCRIPT} +workon ctftools +set -e + +python -c 'import z3; print(z3.get_version_string())' || exit 1 +exit 0 diff --git a/z3/uninstall b/z3/uninstall new file mode 100755 index 0000000..bd33492 --- /dev/null +++ b/z3/uninstall @@ -0,0 +1,4 @@ +#!/bin/bash -ex + +cd z3/build +make uninstall diff --git a/zsteg/install b/zsteg/install new file mode 100755 index 0000000..290dd98 --- /dev/null +++ b/zsteg/install @@ -0,0 +1,3 @@ +#!/bin/bash -ex + +gem install --user-install zsteg diff --git a/zsteg/install-root-archlinux b/zsteg/install-root-archlinux new file mode 100755 index 0000000..1fd31fd --- /dev/null +++ b/zsteg/install-root-archlinux @@ -0,0 +1,3 @@ +#!/bin/bash -ex + +pacman -Syu --noconfirm --needed ruby diff --git a/zsteg/install-root-debian b/zsteg/install-root-debian new file mode 100755 index 0000000..8211568 --- /dev/null +++ b/zsteg/install-root-debian @@ -0,0 +1,3 @@ +#!/bin/bash -ex + +apt-get install -y ruby