├── .github └── FUNDING.yml ├── README.md ├── google-cache └── GitHub - giantbranch_pwn-env-init.html ├── img ├── google-cache.png ├── image-20210618104843727.png └── png.png ├── pwn_init.sh ├── pwn_init_py2.sh └── pwn_init_py3.sh /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['http://pic.giantbranch.cn/pic/1551450728861.jpg'] 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **写于20210617**: 2 | 3 | 怎么说呢,因为一些原因今天把这个仓库临时删了,再重建,但是我忽略了一点,这个项目的star是153,fork是49,就这样没了,哈哈 4 | 5 | 或许这就是人生,看开点吧,塞翁失马焉知非福,应该什么时候都不缺重头再来的勇气 6 | 7 | 还好谷歌有快照,下面是截图 8 | 9 | ![image-20210618104843727](img/image-20210618104843727.png) 10 | 11 | https://raw.githubusercontent.com/giantbranch/pwn-env-init/master/img/google-cache.png 12 | 13 | # pwn-env-init 14 | 15 | **blog**:https://www.giantbranch.cn/ 16 | 17 | CTF PWN 做题环境一键搭建脚本 18 | 19 | CTF PWN environment one-click build script 20 | 21 | 理论上适用于debian系的linux x64系统,但强烈建议在Ubuntu x64系统上安装使用 22 | 23 | **如果怕麻烦的,可以直接下载我配置好的Ubuntu 16.04,为VMware导出的ovf格式** 24 | 25 | 链接:https://pan.baidu.com/s/1Ia8NPcXy414QOaiH14T3sQ 26 | 提取码:kypa 27 | 28 | **账号密码:** giantbranch:giantbranch 29 | (root密码可以通过sudo passwd root自行修改) 30 | 31 | 截图: 32 | 33 | ![](https://raw.githubusercontent.com/giantbranch/pwn-env-init/master/img/png.png) 34 | 35 | **虚拟机的源码不能源码调试有bug,可通过以下命令修复:** 36 | 37 | ``` 38 | rm glibc-2.23* -rf 39 | sudo apt update 40 | sudo apt source libc6-dev 41 | ``` 42 | 43 | # Use 44 | 45 | 用python2的选py2,用python3的选py3 46 | 47 | ### python2 pwn env 48 | 49 | ``` 50 | wget https://raw.githubusercontent.com/giantbranch/pwn-env-init/master/pwn_init_py2.sh 51 | chmod +x pwn_init_py2.sh 52 | sudo ./pwn_init_py2.sh 53 | ``` 54 | ### python3 pwn env 55 | ``` 56 | wget https://raw.githubusercontent.com/giantbranch/pwn-env-init/master/pwn_init_py3.sh 57 | chmod +x pwn_init_py3.sh 58 | sudo ./pwn_init_py3.sh 59 | ``` 60 | 而pwn_init.sh就作为备份文件吧 61 | 62 | # Instructions 63 | 64 | 1. 为64位系统提供32位运行环境支撑 65 | 2. 下载了libc6的源码,方便源码调试( 可看这https://blog.csdn.net/u012763794/article/details/78457973 ) 66 | 3. 给gdb装上pwndbg和peda插件 67 | 4. 安装pwntools 68 | 5. 安装one_gadget 69 | 6. 下载libc-database 70 | 71 | # Update 72 | 73 | 20200114: 最近在Ubuntu 19.04运行脚本,安装pwntools有问题,more-itertools已经不支持python2了,所以分成py2和py3版本,python2的解决方案是先安装支持python2的more-itertools 5.0.0 74 | 75 | 20181105: 竟然忘了安装one_gadget 76 | 77 | 20181027: 增加下载libc-database 78 | 79 | 20181003: 修改pip源为豆瓣源,加快pip的安装速度,假如安装的地方不在中国,可以注释掉! 80 | 81 | 20180606: 初始化仓库,上传第一版 82 | 83 | # Attention 84 | 85 | I suggest you modify the /etc/apt/sources.list file to speed up the download. 86 | 87 | # Reward 88 | 89 | paypal: https://www.paypal.me/giantbranch 90 | 91 | ![自愿打赏][1] 92 | 93 | 94 | [1]: http://pic.giantbranch.cn/pic/1551450728861.jpg 95 | -------------------------------------------------------------------------------- /img/google-cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giantbranch/pwn-env-init/f54f3ec95d9f2eab658c056bc51050e2978477e7/img/google-cache.png -------------------------------------------------------------------------------- /img/image-20210618104843727.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giantbranch/pwn-env-init/f54f3ec95d9f2eab658c056bc51050e2978477e7/img/image-20210618104843727.png -------------------------------------------------------------------------------- /img/png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giantbranch/pwn-env-init/f54f3ec95d9f2eab658c056bc51050e2978477e7/img/png.png -------------------------------------------------------------------------------- /pwn_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Author : giantbranch " 4 | echo "" 5 | echo "Github : https://github.com/giantbranch/pwn-env-init" 6 | echo "" 7 | 8 | echo "This is the previous script, please use pwn_init_py2.sh or pwn_init_py3.sh" 9 | echo "If you want to install python2 pwn env, execute pwn_init_py2.sh" 10 | echo "If you want to install python3 pwn env, execute pwn_init_py3.sh" 11 | exit 1 12 | cd ~/ 13 | # change sourse to ustc 14 | echo "I suggest you modify the /etc/apt/sources.list file to speed up the download." 15 | # echo "Press Enter to continue~" 16 | # read -t 5 test 17 | #sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list 18 | # change sourse —— deb-src 19 | sudo sed -i 's/# deb-src/deb-src/' "/etc/apt/sources.list" 20 | # change pip source 21 | mkdir ~/.pip 22 | echo -e "[global]\nindex-url = https://pypi.douban.com/simple/\n[install]\ntrusted-host = pypi.douban.com" > ~/.pip/pip.conf 23 | # support 32 bit 24 | dpkg --add-architecture i386 25 | sudo apt-get update 26 | # sudo apt-get -y install lib32z1 27 | sudo apt-get -y install libc6-i386 28 | # maybe git? 29 | sudo apt-get -y install git gdb 30 | # install pwndbg 31 | git clone https://github.com/pwndbg/pwndbg 32 | cd pwndbg 33 | ./setup.sh 34 | # install peda 35 | git clone https://github.com/longld/peda.git ~/peda 36 | echo "source ~/peda/peda.py" >> ~/.gdbinit 37 | # download the libc source to current directory(you can use gdb with this example command: directory ~/glibc-2.24/malloc/) 38 | sudo apt-get source libc6-dev 39 | # install pwntools 40 | sudo apt-get -y install python python-pip 41 | pip install pwntools 42 | # install one_gadget 43 | sudo apt-get -y install ruby 44 | sudo gem install one_gadget 45 | # download 46 | git clone https://github.com/niklasb/libc-database.git ~/libc-database 47 | echo "Do you want to download libc-database now(Y/n)?" 48 | read input 49 | if [[ $input = "n" ]] || [[ $input = "N" ]]; then 50 | echo "you can cd ~/libc-database and run ./get to download the libc at anytime you want" 51 | else 52 | cd ~/libc-database && ./get 53 | fi 54 | echo "=========================================" 55 | echo "=============Good, Enjoy it.=============" 56 | echo "=========================================" 57 | -------------------------------------------------------------------------------- /pwn_init_py2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eux 4 | 5 | echo "Author : giantbranch " 6 | echo "" 7 | echo "Github : https://github.com/giantbranch/pwn-env-init" 8 | echo "" 9 | 10 | cd ~/ 11 | # change sourse to ustc 12 | echo "I suggest you modify the /etc/apt/sources.list file to speed up the download." 13 | # echo "Press Enter to continue~" 14 | # read -t 5 test 15 | #sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list 16 | # change sourse —— deb-src 17 | sudo sed -i 's/# deb-src/deb-src/' "/etc/apt/sources.list" 18 | # change pip source 19 | if [ ! -d ~/.pip ]; then 20 | mkdir ~/.pip 21 | fi 22 | echo -e "[global]\nindex-url = https://pypi.douban.com/simple/\n[install]\ntrusted-host = pypi.douban.com" > ~/.pip/pip.conf 23 | # support 32 bit 24 | dpkg --add-architecture i386 25 | sudo apt-get update 26 | # sudo apt-get -y install lib32z1 27 | sudo apt-get -y install libc6-i386 28 | # maybe git? 29 | sudo apt-get -y install git gdb 30 | # install pwndbg 31 | git clone https://github.com/pwndbg/pwndbg 32 | cd pwndbg 33 | ./setup.sh 34 | # install peda 35 | git clone https://github.com/longld/peda.git ~/peda 36 | echo "source ~/peda/peda.py" >> ~/.gdbinit 37 | # download the libc source to current directory(you can use gdb with this example command: directory ~/glibc-2.24/malloc/) 38 | sudo apt-get source libc6-dev 39 | # install pwntools 40 | sudo apt-get -y install python python-pip 41 | pip install more-itertools==5.0.0 42 | pip install pwntools 43 | # install one_gadget 44 | sudo apt-get -y install ruby 45 | sudo gem install one_gadget 46 | # download 47 | git clone https://github.com/niklasb/libc-database.git ~/libc-database 48 | echo "Do you want to download libc-database now(Y/n)?" 49 | read input 50 | if [[ $input = "n" ]] || [[ $input = "N" ]]; then 51 | echo "you can cd ~/libc-database and run ./get to download the libc at anytime you want" 52 | else 53 | cd ~/libc-database && ./get 54 | fi 55 | echo "=========================================" 56 | echo "=============Good, Enjoy it.=============" 57 | echo "=========================================" 58 | -------------------------------------------------------------------------------- /pwn_init_py3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eux 4 | 5 | echo "Author : giantbranch " 6 | echo 7 | echo "Github : https://github.com/giantbranch/pwn-env-init" 8 | echo 9 | 10 | cd ~/ 11 | # change sourse to ustc 12 | echo "I suggest you modify the /etc/apt/sources.list file to speed up the download." 13 | echo "Press Enter to continue~" 14 | read -t 5 test 15 | #sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list 16 | # change sourse —— deb-src 17 | sudo sed -i 's/# deb-src/deb-src/' "/etc/apt/sources.list" 18 | # change pip source 19 | if [ ! -d ~/.pip ]; then 20 | mkdir ~/.pip 21 | fi 22 | echo -e "[global]\nindex-url = https://pypi.douban.com/simple/\n[install]\ntrusted-host = pypi.douban.com" > ~/.pip/pip.conf 23 | # support 32 bit 24 | dpkg --add-architecture i386 25 | sudo apt-get update 26 | # sudo apt-get -y install lib32z1 27 | sudo apt-get -y install libc6-i386 28 | # maybe git? 29 | sudo apt-get -y install git gdb 30 | # install pwndbg 31 | git clone https://github.com/pwndbg/pwndbg 32 | cd pwndbg 33 | ./setup.sh 34 | # install peda 35 | git clone https://github.com/longld/peda.git ~/peda 36 | echo "source ~/peda/peda.py" >> ~/.gdbinit 37 | # download the libc source to current directory(you can use gdb with this example command: directory ~/glibc-2.24/malloc/) 38 | sudo apt-get source libc6-dev 39 | # install pwntools 40 | sudo apt-get -y install python3 python3-pip 41 | pip3 install pwntools 42 | # install one_gadget 43 | sudo apt-get -y install ruby 44 | sudo gem install one_gadget 45 | # download 46 | git clone https://github.com/niklasb/libc-database.git ~/libc-database 47 | echo "Do you want to download libc-database now(Y/n)?" 48 | read input 49 | if [[ $input = "n" ]] || [[ $input = "N" ]]; then 50 | echo "you can cd ~/libc-database and run ./get to download the libc at anytime you want" 51 | else 52 | cd ~/libc-database && ./get 53 | fi 54 | echo "=========================================" 55 | echo "=============Good, Enjoy it.=============" 56 | echo "=========================================" 57 | --------------------------------------------------------------------------------