Advertisement
opexxx

Dockerfile

Mar 22nd, 2017
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.68 KB | None | 0 0
  1. #----------------------------------------------------------------#
  2. # Dockerfile to build a container for binary reverse engineering #
  3. # and exploitation. Suitable for CTFs.                           #
  4. #                                                                #
  5. # See https://github.com/superkojiman/pwnbox for details.        #
  6. #                                                                #
  7. # To build: docker build -t superkojiman/pwnbox                  #
  8. #----------------------------------------------------------------#
  9.  
  10. FROM phusion/baseimage:0.9.19
  11. MAINTAINER superkojiman@techorganic.com
  12.  
  13. ENV DEBIAN_FRONTEND noninteractive
  14.  
  15. RUN dpkg --add-architecture i386
  16. RUN apt-get update && apt-get -y upgrade
  17.  
  18. #-------------------------------------#
  19. # Install packages from Ubuntu repos  #
  20. #-------------------------------------#
  21. RUN apt-get install -y \
  22.     sudo \
  23.     build-essential \
  24.     gcc-multilib \
  25.     g++-multilib \
  26.     gdb \
  27.     gdb-multiarch \
  28.     python-dev \
  29.     python3-dev \
  30.     python-pip \
  31.     python3-pip \
  32.     ipython \
  33.     default-jdk \
  34.     net-tools \
  35.     nasm \
  36.     cmake \
  37.     vim \
  38.     tmux \
  39.     git \
  40.     binwalk \
  41.     strace \
  42.     ltrace \
  43.     autoconf \
  44.     socat \
  45.     netcat \
  46.     nmap \
  47.     wget \
  48.     exiftool \
  49.     squashfs-tools \
  50.     unzip \
  51.     virtualenvwrapper \
  52.     upx-ucl \
  53.     man-db \
  54.     manpages-dev \
  55.     libtool-bin \
  56.     bison \
  57.     libini-config-dev \
  58.     libssl-dev \
  59.     libffi-dev \
  60.     libglib2.0-dev \
  61.     libc6:i386 \
  62.     libncurses5:i386 \
  63.     libstdc++6:i386 \
  64.     libc6-dev-i386
  65.  
  66. RUN apt-get -y autoremove
  67. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  68.  
  69. #-------------------------------------#
  70. # Install stuff from pip repos        #
  71. #-------------------------------------#
  72. RUN pip install \
  73.     pycipher \
  74.     uncompyle \
  75.     ropgadget \
  76.     distorm3 \
  77.     filebytes \
  78.     r2pipe \
  79.     python-constraint
  80.  
  81. # setup angr virtualenv
  82. RUN bash -c 'source /etc/bash_completion.d/virtualenvwrapper && \
  83.    mkvirtualenv angr && \
  84.    pip install angr && \
  85.    deactivate'
  86.  
  87. # install pwntools 3
  88. RUN pip install --upgrade pwntools
  89.  
  90. # install docopt for xortool
  91. RUN pip install docopt
  92.  
  93. #-------------------------------------#
  94. # Install stuff from GitHub repos     #
  95. #-------------------------------------#
  96. # install capstone
  97. RUN git clone https://github.com/aquynh/capstone.git /opt/capstone && \
  98.     cd /opt/capstone && \
  99.     ./make.sh && \
  100.     ./make.sh install  && \
  101.     cd bindings/python && \
  102.     make install && \
  103.     make install3
  104.  
  105. RUN git clone https://gist.github.com/47e3a5ac99867e7f4e0d.git /opt/binstall && \
  106.     cd /opt/binstall && \
  107.     chmod 755 binstall.sh && \
  108.     ./binstall.sh amd64 && \
  109.     ./binstall.sh i386
  110.  
  111. # install radrare2
  112. RUN git clone https://github.com/radare/radare2.git /opt/radare2 && \
  113.     cd /opt/radare2 && \
  114.     git fetch --tags && \
  115.     git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) && \
  116.     ./sys/install.sh  && \
  117.     make symstall
  118.  
  119. # install ropper
  120. RUN git clone https://github.com/sashs/Ropper.git /opt/ropper && \
  121.     cd /opt/ropper && \
  122.     python setup.py install
  123. RUN rm -rf /opt/ropper
  124.  
  125. # install ropeme
  126. RUN git clone https://github.com/packz/ropeme.git /opt/ropeme && \
  127.     sed -i 's/distorm/distorm3/g' /opt/ropeme/ropeme/gadgets.py
  128.  
  129. # install rp++
  130. RUN mkdir /opt/rp
  131. RUN wget https://github.com/downloads/0vercl0k/rp/rp-lin-x64 -P /opt/rp
  132. RUN wget https://github.com/downloads/0vercl0k/rp/rp-lin-x86 -P /opt/rp
  133.  
  134. # install retargetable decompiler scripts
  135. RUN git clone https://github.com/s3rvac/retdec-sh.git /opt/retdec-sh
  136.  
  137. # install villoc
  138. RUN git clone https://github.com/wapiflapi/villoc.git /opt/villoc
  139.  
  140. # install libformatstr
  141. RUN git clone https://github.com/hellman/libformatstr.git /opt/libformatstr && \
  142.     cd /opt/libformatstr && \
  143.     python setup.py install
  144. RUN rm -rf /opt/libformatstr
  145.  
  146. # install preeny
  147. RUN git clone https://github.com/zardus/preeny.git /opt/preeny && \
  148.     cd /opt/preeny && \
  149.     make
  150.  
  151. # install xortool
  152. RUN git clone https://github.com/hellman/xortool.git /opt/xortool && \
  153.     cd /opt/xortool && \
  154.     python setup.py install
  155.  
  156. # install tmux-resurrect
  157. RUN git clone https://github.com/tmux-plugins/tmux-resurrect.git /opt/tmux-resurrect
  158.  
  159. # install libc-database
  160. RUN git clone https://github.com/niklasb/libc-database /opt/libc-database
  161.  
  162. # install peda
  163. RUN git clone https://github.com/longld/peda.git /opt/peda
  164.  
  165. # install gef
  166. RUN git clone https://github.com/hugsy/gef.git /opt/gef
  167.  
  168. # install pwndbg
  169. RUN git clone https://github.com/pwndbg/pwndbg.git /opt/pwndbg && \
  170.     cd /opt/pwndbg && \
  171.     ./setup.sh
  172.  
  173. ENTRYPOINT ["/bin/bash"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement