1、apt换源

1
2
3
mv /etc/apt/source.list /etc/apt/source.list.bak
vim /etc/apt/source.list
apt update
1
2
3
4
5
6
7
8
清华源(Ubuntu24.04 LTS,具体的根据自己机器的版本来配就可以,也可以安装其他源):
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse

注:这里如果证书报错可以将https换成http

2、python安装

python2

1
2
3
apt install python
apt install curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py

python3

1
2
apt install python3
apt install python3-pip

3、pwntools安装

1
pip install pwntools

4、pwndbg安装

1
2
3
4
5
apt install gdb (系统没有gdb时使用)
apt install git
git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh

5、pwngdb

与pwndbg一样是gdb的辅助增强插件,但是与pwndbg有冲突,需要手动修改一下

1
2
cd ~/ 
git clone https://github.com/scwuaptx/Pwngdb.git

~/.gdbint文件配置如下

1
2
3
4
5
6
7
8
9
10
11
source /home/pwnki/pwndbg/gdbinit.py 
#source ~/peda/peda.py //使用 pwndbg 就要把 peda 注释掉,反过来也一样
source ~/Pwngdb/pwngdb.py
source ~/Pwngdb/angelheap/gdbinit.py

define hook-run
python
import angelheap
angelheap.init_angelheap()
end
end

6、ropper

1
2
3
sudo pip install capstone
sudo pip install filebytes
pip install ropper

7、seccomp-tools

1
2
3
sudo apt-get install ruby
sudo apt-get install gem
sudo gem install seccomp-tools

8、one_gadget

1
sudo gem install one_gadget

9、glibc-all-in-one

1
git clone https://github.com/matrix1001/glibc-all-in-one.git

安装不同版本的libc

1
2
3
update list (生成list表,表中是可以安装的libc文件)
./download 需要安装的libc
cd libs (这里包含所下载的libc文件)

10、patchelf

1
apt install patchelf

使用patchelf使用不同libc版本调试程序

1
2
3
4
patchelf --set-interpreter + 链接器路径(如./2.23-0ubuntu11.3_amd64/ld-2.23.so)  
patchelf --print-needed ./需要修改的文件
patchelf --repalce-needed 上面输出的依赖文件(如libc.so.6) 要使用的共享对象的位置(如./2.23-0ubuntu11.3_amd64/libc-2.23.so) ./需要修改的文件
ldd 需要修改的文件 (此命令用来查看是否修改成功)