1. 程式人生 > 其它 >docker從0搭建ubuntu16.04pwn環境

docker從0搭建ubuntu16.04pwn環境

技術標籤:CTF安全

1 建立docker並且掛載本地

掛載本地是可以直接用本地的檔案

docker run -it -v 本地目錄:docker目錄 ubuntu /bin/bash

2 建立使用者

建立使用者
方便後續安裝
不然後面的pwndbg可能用不了

useradd username
passwd username

3 更新一下軟體包

之後的都在root下面進行。

apt update
apt upgrade
apt-get update
apt-get upgrade

4 安裝一下vim

apt-get install vim

5 安裝一下基礎軟體

sudo apt-get install python2.
7 python-pip python-dev git libssl-dev libffi-dev build-essential sudo apt-get install git gdb gdb-multiarch "binfmt*" -y

6 pwbdbg && pwngdb

cd /home
git clone https://github.com/scwuaptx/Pwngdb.git 
cp /home/Pwngdb/.gdbinit /home

git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh

vim ~
/.gdbinit 然後寫入 source ~/pwndbg/gdbinit.py

一定要寫成這樣子的
在這裡插入圖片描述

7 安裝pwntools

pip install pwntools

8 安裝其他

apt install gcc-multilib

也可以修改更新源

備份一下源

cp /etc/apt/sources.list /etc/apt/sources_init.list

進入/etc/apt/sources.list

vim /etc/apt/sources.list

把裡面的東西都刪掉,然更換成新的源
這裡用的阿里源

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-
src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

然後更新

apt-get update
apt-get upgrade