1
sudo docker run -it -v /home/pwn/Desktop/pwn_ques:/root/work -v /home/pwn/Desktop/glibc:/root/glibc -p 9994:8888 --privileged --cap-add=SYS_PTRACE --security-opt="seccomp=unconfined" --name pwn18_10 pwn:18.10

ubuntu 18.04 pwn docker dockerfile

目前是18.04Dockerfile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
FROM ubuntu:18.04

ENV TZ Asia/Shanghai
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
# ENV HTTP_PROXY "socks5://192.168.0.6:10080"
# ENV HTTPS_PROXY "socks5://192.168.0.6:10080"

RUN sed -i 's/\(archive\|security\).ubuntu.com/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list
# RUN apt-get -y update && apt-get install -y --no-install-recommends apt-utils
RUN dpkg --add-architecture i386 && \
apt-get -y update && \
apt-get install -y --no-install-recommends apt-utils && \
apt install -y \
libc6:i386 \
libc6-dbg:i386 \
libc6-dbg \
lib32stdc++6 \
g++-multilib \
cmake \
ipython3 \
vim \
net-tools \
iputils-ping \
libffi-dev \
libssl-dev \
python3-dev \
python3-pip \
build-essential \
ruby \
ruby-dev \
tmux \
strace \
ltrace \
nasm \
wget \
gdb \
gdb-multiarch \
netcat \
socat \
git \
patchelf \
gawk \
file \
python3-distutils \
tzdata \
bison

RUN rm -rf /var/lib/apt/list/*

RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata

RUN wget https://github.com/radareorg/radare2/releases/download/4.4.0/radare2_4.4.0_amd64.deb && \
dpkg -i radare2_4.4.0_amd64.deb && rm radare2_4.4.0_amd64.deb


RUN python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -U pip && \
python3 -m pip config set global.index-url http://mirrors.aliyun.com/pypi/simple && \
python3 -m pip config set install.trusted-host mirrors.aliyun.com && \
python3 -m pip install --no-cache-dir --use-feature=2020-resolver\
ropgadget \
pwntools \
z3-solver \
smmap2 \
apscheduler \
ropper \
unicorn \
keystone-engine \
capstone \
angr \
pebble \
r2pipe \
filebytes \
keystone-engine

RUN python3 -m pip install setuptools --upgrade --no-cache-dir
RUN python3 -m pip install ropper --no-cache-dir

RUN gem install one_gadget seccomp-tools && rm -rf /var/lib/gems/2.*/cache/*

WORKDIR /root/

COPY pwndbg /root/pwndbg
COPY Pwngdb /root/Pwngdb
RUN pwd
RUN ls
# RUN git clone --depth 1 https://github.com/pwndbg/pwndbg && \
# cd pwndbg && chmod +x setup.sh && ./setup.sh
RUN cd /root/pwndbg && chmod +x setup.sh && ./setup.sh

#RUN git clone --depth 1 https://github.com/scwuaptx/Pwngdb.git /root/Pwngdb && \
# cd /root/Pwngdb && cat /root/Pwngdb/.gdbinit >> /root/.gdbinit
RUN cd /root/Pwngdb && cat /root/Pwngdb/.gdbinit >> /root/.gdbinit
# && \
# sed -i "s?source ~/peda/peda.py?# source ~/peda/peda.py?g" /root/.gdbinit

RUN sed -i "s?source ~/peda/peda.py?# source ~/peda/peda.py?g" /root/.gdbinit


#RUN git clone --depth 1 https://github.com/niklasb/libc-database.git libc-database && \
# cd libc-database && ./get || echo "/libc-database/" > ~/.libcdb_path

RUN touch /root/.tmux.conf && \
echo "set -g history-limit 5000" >> /root/.tmux.conf && \
echo "set -g mouse on" >> /root/.tmux.conf

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100 --slave /usr/bin/pip pip /usr/bin/pip3 &&\
update-alternatives --install /usr/bin/python python /usr/bin/python2 90 --slave /usr/bin/pip pip /usr/bin/pip2


RUN mkdir ~/work
WORKDIR /root/work

EXPOSE 9999

ENTRYPOINT ["tmux"]

ubuntu 19.04 pwn docker dockerfile

ubuntu 19.04dockerfile,主要是将源中网址添加old-release,并只设置main restricted

1
2
3
4
5
6
deb http://old-releases.ubuntu.com/ubuntu disco main restricted
deb-src http://old-releases.ubuntu.com/ubuntu disco main restricted
deb http://old-releases.ubuntu.com/ubuntu disco-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu disco-updates main restricted
deb http://old-releases.ubuntu.com/ubuntu disco-security main restricted
deb-src http://old-releases.ubuntu.com/ubuntu disco-security main restricted
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
FROM ubuntu:19.04

ENV TZ Asia/Shanghai
ENV DEBIAN_FRONTEND noninteractive
# ENV HTTP_PROXY "socks5://192.168.0.6:10080"
# ENV HTTPS_PROXY "socks5://192.168.0.6:10080"

RUN rm /etc/apt/sources.list

COPY ubuntu_19_04_sources.list /etc/apt/sources.list

# RUN sed -i 's/\(archive\|security\).ubuntu.com/mirrors.aliyun.com/' /etc/apt/sources.list
# RUN cat /etc/apt/sources.list
# RUN sed -i 's/archive.ubuntu.com/old-released.archive.ubuntu.com/' /etc/apt/sources.list
# RUN sed -i 's/security.ubuntu.com/old-released.security.ubuntu.com/' /etc/apt/sources.list
# RUN sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list
# RUN apt-get -y update && apt-get install -y --no-install-recommends apt-utils
RUN dpkg --add-architecture i386 && \
apt-get -y update && \
apt-get -y install software-properties-common &&\
# apt-add-repository universe && \
apt-get install -y --no-install-recommends apt-utils && \
apt install -y \
libc6:i386 \
libc6-dbg:i386 \
libc6-dbg \
lib32stdc++6 \
g++-multilib \
cmake \
# ipython3 \
vim \
net-tools \
iputils-ping \
libffi-dev \
libssl-dev \
python3-dev \
# python3-pip \
build-essential \
ruby \
ruby-dev \
tmux \
strace \
ltrace \
# nasm \
wget \
gdb \
# gdb-multiarch \
netcat \
socat \
git \
# patchelf \
gawk \
file \
# python3-distutils \
tzdata \
bison

COPY get-pip.py /

RUN python3 get-pip.py

RUN rm -rf /var/lib/apt/list/*

RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata

RUN wget https://github.com/radareorg/radare2/releases/download/4.4.0/radare2_4.4.0_amd64.deb && \
dpkg -i radare2_4.4.0_amd64.deb && rm radare2_4.4.0_amd64.deb


RUN python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -U pip && \
python3 -m pip config set global.index-url http://mirrors.aliyun.com/pypi/simple && \
python3 -m pip config set install.trusted-host mirrors.aliyun.com && \
python3 -m pip install setuptools --upgrade --no-cache-dir &&\
python3 -m pip install --no-cache-dir --use-feature=2020-resolver\
ropgadget \
pwntools \
z3-solver \
smmap2 \
apscheduler \
ropper \
unicorn \
keystone-engine \
capstone \
angr \
pebble \
# r2pipe \
filebytes \
keystone-engine \
ropper
#python3 -m pip install ropper --no-cache-dir

# RUN gem install one_gadget seccomp-tools && rm -rf /var/lib/gems/2.*/cache/*
RUN gem install one_gadget && rm -rf /var/lib/gems/2.*/cache/*

RUN pip3 -V

WORKDIR /root/

COPY pwndbg /root/pwndbg
COPY Pwngdb /root/Pwngdb
RUN pwd
RUN ls
# RUN git clone --depth 1 https://github.com/pwndbg/pwndbg && \
# cd pwndbg && chmod +x setup.sh && ./setup.sh
RUN cd /root/pwndbg && chmod +x setup.sh && ./setup.sh

#RUN git clone --depth 1 https://github.com/scwuaptx/Pwngdb.git /root/Pwngdb && \
# cd /root/Pwngdb && cat /root/Pwngdb/.gdbinit >> /root/.gdbinit
RUN cd /root/Pwngdb && cat /root/Pwngdb/.gdbinit >> /root/.gdbinit
# && \
# sed -i "s?source ~/peda/peda.py?# source ~/peda/peda.py?g" /root/.gdbinit

#RUN git clone --depth 1 https://github.com/niklasb/libc-database.git libc-database && \
# cd libc-database && ./get || echo "/libc-database/" > ~/.libcdb_path

ENV LANG C.UTF-8

RUN touch /root/.tmux.conf && \
echo "set -g history-limit 5000" >> /root/.tmux.conf && \
echo "set -g mouse on" >> /root/.tmux.conf

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100 --slave /usr/bin/pip pip /usr/bin/pip3 &&\
update-alternatives --install /usr/bin/python python /usr/bin/python2 90 --slave /usr/bin/pip pip /usr/bin/pip2

RUN sed -i "s?source ~/peda/peda.py?# source ~/peda/peda.py?g" /root/.gdbinit

RUN mkdir ~/work
WORKDIR /root/work

EXPOSE 9999

ENTRYPOINT ["tmux"]