狗儿

热爱的话就坚持吧~

0%

pwntools docker

只是最基础的pwn环境,环境突然坏掉时,小白们可以用这个docker应急,不适应于大佬们。

安装docker

1
2
3
4
5
6
7
8
9
10
11
#CentOS 6
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum update -y
yum -y install docker-io
service docker start
chkconfig docker on

#CentOS 7、Debian、Ubuntu
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker

Dockerfile

pwntools/pwntools获取Dockerfile,如下:

1
2
3
4
5
6
FROM pwntools/pwntools:base

USER root
RUN pip install --upgrade git+https://github.com/Gallopsled/pwntools@stable
RUN PWNLIB_NOTERM=1 pwn update
USER pwntools

将上面内容保存到Dockerfile中。

1
[root@centos7 ~]# vim Dockerfile

构建、启动、进入

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#构建,此时要在Dockerfile所在目录执行
[root@centos7 ~]# docker build .

#启动
[root@centos7 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 2615542bfae5 44 seconds ago 689MB
pwntools/pwntools base 7ae380081ac0 11 months ago 657MB
[root@centos7 ~]# docker run -i -t 7ae380081ac0 /bin/bash

#进入
[root@centos7 ~]# docker container ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
418a2df1501c 7ae380081ac0 "/bin/bash" 10 minutes ago Up 10 minutes gallant_gould
[root@centos7 ~]# docker exec -it 418a2df1501c /bin/bash

退出容器按ctrl+P+Q

容器内安装vim

1
2
pwntools@418a2df1501c:~$ sudo apt update
pwntools@418a2df1501c:~$ sudo apt install vim

其他

本docker是基于ubuntu的,如果你还需要什么插件,可以自行安装。