前言
在IT界,或者说所有涉及到软件编程的工作岗位的人,估计都知道GitHub的大名。
GitHub是世界顶级开发者的聚集地,在这里几乎可以找到任何想要的东西。上面分享有许多优秀、著名的开源项目,在遵守其License的前提下,我们可以免费使用、下载这些开源项目。这也是GitHub最为吸引人的地方。
它是程序员们的天堂~
大部分地区都是能上github的,但是作者上学的地方很多知识或技术网站都访问不了,谷歌也用不了,好多资源找不到,让本不发达的地区获取信息更加困难,计算机相关专业的学生学习前沿知识雪上加霜…
作为一名网安(信安)专业的学生,Git不到工具心态会炸!
好了废话说多了,我们进入正题:
Ctf-Pwn环境搭建
ubuntu镜像下载地址(推荐的是清华镜像站):
https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/
这里作者用的是ubuntu18.04 搭建pwn环境
(搭好pwn环境的虚拟机可以在一些资源站上找到,比较难找,而且对其配置不熟悉终究不是自己的,当然自己搭建感觉也不错,在报错中冒险,一定要保持好心态!)
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo gedit /etc/apt/sources.list
# 阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
##測試版源
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# 源碼
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
##測試版源
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# 清华大学源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
##測試版源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# 源碼
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
##測試版源
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
sudo apt-get update
sudo apt-get upgrade
然后我们可以开始搭建Pwn环境了
这里是python2
(如果只想用python3前两个可以选择不装,如果是想用python2后面的安装pip3 install需修改为pip install)
推荐python2 python3都装
sudo apt install python
sudo apt install python-pip
pip3 install --upgrade pip
pip3 install --upgrade setuptools
sudo apt install git
sudo apt install ruby
sudo apt-get install vim
sudo apt-get update
sudo apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
python3 -m pip install --upgrade pwntools
git clone https://gitee.com/hongsofwing/pwn.git ~/pwndbg
cd pwndbg/
./setup.sh
回到原路径
cd ../
下载
git clone https://gitee.com/mirrors_scwuaptx/Pwngdb.git ~/pwngdb
cp ~/pwngdb/.gdbinit ~/
git clone https://gitee.com/liweijun0302/peda.git ~/peda
vim ~/.gdbinit
注意:
pwngdb+pwndbg联合使用,插件更多,如heapinfo,heapbase,parseheap等
选择使用peda,pwndbg 请分别注释,不要同时使用两个,会报错
sudo gem install one_gadget
sudo vim ~/.bashrc
PATH=$PATH:~/.local/bin
source ~/.bashrc
git clone https://gitee.com/lrcno6/LibcSearcher.git
cd LibcSearcher
#python2
sudo python setup.py develop
#python3
sudo python3 setup.py develop
cd ../
sudo pip install capstone
git clone https://gitee.com/p0p1ng/ROPgadget.git
cd ROPgadget
sudo -H python3 setup.py install
Pwntools与LibcSearcher正常!
大家也可以将自己的python3版本升级为python3.8,参考我的另一个博文:
https://blog.csdn.net/Lcw_linyx/article/details/124203366
附图:
最后分享一个网站:
https://gitee.com
这是国内开源项目的大站,可以说是国内版github,全文所用的大部分开源项目都来源于它,上面也能找到许多github上的资源,感兴趣的小伙伴可以去看看。