2017-07-17 14:10:48 +07:00
|
|
|
|
# 2.6 Pwntools
|
2017-08-17 21:36:23 +07:00
|
|
|
|
|
|
|
|
|
* [安装](#安装)
|
2017-08-18 19:51:19 +07:00
|
|
|
|
* [使用pwntools](#使用pwntools)
|
2017-08-17 21:36:23 +07:00
|
|
|
|
|
2017-08-18 19:51:19 +07:00
|
|
|
|
pwntools是一个CTF框架和漏洞利用开发库,用Python开发,由rapid设计,旨在让使用者简单快速的编写exp脚本。包含了本地执行、远程连接读写、shellcode生成、ROP链的构建、ELF解析、符号泄露众多强大功能。
|
2017-08-17 21:36:23 +07:00
|
|
|
|
|
|
|
|
|
## 安装
|
|
|
|
|
|
|
|
|
|
1. 安装binutils:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
git clone https://github.com/Gallopsled/pwntools-binutils
|
|
|
|
|
sudo apt-get install software-properties-common
|
|
|
|
|
sudo apt-add-repository ppa:pwntools/binutils
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get install binutils-arm-linux-gnu
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
2. 安装capstone:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
git clone https://github.com/aquynh/capstone
|
|
|
|
|
cd capstone
|
|
|
|
|
make
|
|
|
|
|
sudo make install
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
3. 安装pwntools:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
sudo apt-get install libssl-dev
|
|
|
|
|
sudo pip install pwntools
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
测试安装是否成功:
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
>>> import pwn
|
|
|
|
|
>>> pwn.asm("xor eax,eax")
|
|
|
|
|
'1\xc0'
|
|
|
|
|
```
|
|
|
|
|
|
2017-08-18 19:51:19 +07:00
|
|
|
|
## 使用pwntools
|
2017-08-17 21:36:23 +07:00
|
|
|
|
|