pwnable dockerfile

오랜만에 pwnable 문제 좀 풀고 싶어서 전에 만들어뒀던 dockerfile을 쓰려니 좀 불편해서 새로 만들었다.

현재 쓰고 있는 zsh + tmux 환경을 도커 환경에서도 그대로 쓰고 싶어서 볼륨을 /root 에 추가했으니 필요에 따라서 변경해서 쓰면 된다.

dockerfile

FROM ubuntu:18.04

WORKDIR /root

# for 32bit binary
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386 gcc-multilib g++-multilib

RUN apt-get install -y sudo net-tools vim wget git binutils build-essential binutils-multiarch gdb gcc g++ python3 python3-dev python3-pip ruby libssl-dev strace ltrace curl nmap tmux
RUN pip3 install --upgrade pip

# setup exploit environment
RUN apt-get install -y libseccomp-dev
RUN curl https://sh.rustup.rs -sSf > rust.sh
RUN chmod 744 rust.sh
RUN ./rust.sh -y
RUN ~/.cargo/bin/rustup update nightly
RUN ~/.cargo/bin/rustup target add wasm32-wasi --toolchain nightly

RUN bash -c "$(curl -fsSL http://gef.blah.cat/sh)"
RUN pip3 install pwntools==4.4.0 requests z3-solver flask
RUN gem install one_gadget

# shell environment
RUN apt-get install -y zsh
RUN echo "Y" | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
RUN chsh -s `which zsh`

CMD /bin/bash -c "while true; do echo 'still alive'; sleep 600; done"

docker-compose.yml

version: "3.9"
services:
  ubuntu-18.04:
    build: .
    volumes:
      - /root:/root
    environment:
      LANG: C.UTF-8

꿀팁에 게시되었습니다

관련 글

답글 남기기

이메일 주소는 공개되지 않습니다.