ubuntu18.04 pwn环境搭建

摘要:之前搭过环境没有整理过,找时间简单整理了一下。说明一下,本人是在刚装好的虚拟机搭建的。再者就是,还是python2的pwntools香!
ctf pwn环境参考
内容参考大佬们网址:
https://bbs.pediy.com/thread-257558.htm

https://www.jianshu.com/p/a7e2da50263e

使用软件:VMware 15 pro

版本:ububtu 18.04

安装vm tools

sudo apt-get install vim

执行所有升级

sudo apt-get update
sudo apt-get upgrade -y

安装编译Python源程序所需的包

sudo apt install build-essential -y
sudo apt install libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev -y
sudo apt-get install zlib1g-dev
下载Python 3.7源程序压缩包
(说明,起初下载python3是想用它装pwntools,可结果,还是python2装的香!,所有 这部分可以略过)

wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz

解压缩

tar -xzvf Python-3.7.1.tgz

配置

cd Python-3.7.1
./configure --enable-optimizations

编译和安装Python 3.7

sudo make
sudo make install

安装、升级、卸载pip和更换pip源

sudo apt-get install python3-pip

sudo pip3 install --upgrade pip

sudo apt-get remove python3-pip

sudo pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

安装git

sudo apt install git

进行git配置

sudo git config --global user.name ‘自定义用户名’
sudo git config --global user.email ‘邮箱’

查看配置

git config --list

连接github参考:https://www.cnblogs.com/wangjunget/p/9721202.html

Pwn常用软件(python2)

pwntools

sudo apt-get install python python-pip python-dev libssl-dev libffi-dev build-essential

sudo pip install -U setuptools

sudo pip install --upgrade pip

sudo pip install --upgrade pwntools

测试:

import pwn
pwn.asm(“xor eax,eax”)
b’1\xc0’

(配置过程中遇到问题 python-tox 不匹配,用了以下命令解决
sudo pip install six --user -U
sudo pip install ipython --user -U)

方法二:

1、安装Capstone

  1. git clone https://github.com/aquynh/capstone
  2. cd capstone
  3. make
  4. make install

2、安装pwntools

  1. git clone https://github.com/Gallopsled/pwntools
  2. cd pwntools
  3. python setup.py install

安装gdb

sudo apt-get install gdb

更换gdb版本

wget http://ftp.gnu.org/gnu/gdb/gdb-9.1.tar.xz

tar -xf gdb-9.1.tar.xz

cd gdb-9.1/

./configure

make

make install

sudo cp gdb/gdb /usr/local/bin/gdb

pwngdb/peda/gef

安装pwndbg:

git clone https://github.com/pwndbg/pwndbg

cd pwndbg

./setup.sh

安装peda:

git clone https://github.com/longld/peda.git ~/peda

echo “source ~/peda/peda.py” >> ~/.gdbinit

安装gef:

wget -q -O- https://github.com/hugsy/gef/raw/master/scripts/gef.sh| sh

wget -q -O ~/.gdbinit-gef.py https://github.com/hugsy/gef/raw/master/gef.py

echo source ~/.gdbinit-gef.py >> ~/.gdbinit

32位程序支持

sudo apt-get install libc6-dev-i386

32位依赖库

apt-get install lib32ncurses5

apt-get install lib32z1

qemu

sudo apt-get install qemu

sudo apt-get install qemu-system qemu-user-static binfmt-support

安装依赖库:

sudo apt-get install -y gcc-arm-linux-gnueabi

sudo apt-get install qemu libncurses5-dev gcc-arm-linux-gnueabi build-essential gdb-arm-none-eabi synaptic gcc-aarch64-linux-gnu eclipse-cdt git

LibcSearcher

sudo pip install capstone

git clone https://github.com/lieanu/LibcSearcher.git

cd LibcSearcher

python setup.py develop

ROPgadget和one_gadget

安装ROPgadget:

sudo apt-get install python-capstone

git clone https://github.com/JonathanSalwan/ROPgadget.git

cd ROPgadget

sudo python setup.py install

安装one_gadget:

sudo apt install ruby

sudo gem install one_gadget

如有侵权,请联系本人删除

你可能感兴趣的:(ubuntu18.04 pwn环境搭建)