CTF-PWN 环境配置

CTF-PWN 环境配置

免费

更新时间:2021-12-09

所属分类:PHP源码

评论回复:0

 

pwntools <img />技术小贴 sudo apt install python-pip python3-pip sudo pip install pwntools 提示安装python-dev可以使用aptitude安装 这一步建议挂代理 python >>> import pwn >>> pwn.asm("xor eax,eax") '1\xc0' #安装成功 pwndgb git clone https://github.com/pwndbg/pwndbg cd pwndbg ./setup.sh gef wget -q https://github.com/hugsy/gef/raw/master/gef.py echo “source ~/gef/gef.py” >> ~/.gdbinit peda git clone https://github.com/longld/peda.git ~/peda echo “source ~/peda/peda.py” >> ~/.gdbinitfile ROPgadget 用来构建rop链 git clone https://github.com/JonathanSalwan/ROPgadget.git pip install capstone cd ROPgadget python setup.py install ROPgadget one_gadget 寻找libc文件中的一些shell地址 gem install one_gadget 切换脚本 #!/bin/bash function Mode_change { name=$1 gdbinitfile=/root/.gdbinit #这个路径按照你的实际情况修改 peda="source ~/peda/peda.py" #这个路径按照你的实际情况修改 gef="source ~/gef/gef.py" #这个路径按照你的实际情况修改 pwndbg="source /root/pwndbg/gdbinit.py" #这个路径按照你的实际情况修改 sign=$(cat $gdbinitfile | grep -n "#this place is controled by user's shell") #此处上面的查找内容要和你自己的保持一致 pattern=":£this place is controled by user's shell" number=${sign%$pattern} location=$[number+2] parameter_add=${location}i parameter_del=${location}d message="TEST" if [ $name -eq "1" ];then sed -i "$parameter_del" $gdbinitfile sed -i "$parameter_add $peda" $gdbinitfile echo -e "Please enjoy the peda!\n" elif [ $name -eq "2" ];then sed -i "$parameter_del" $gdbinitfile sed -i "$parameter_add $gef" $gdbinitfile echo -e "Please enjoy the gef!\n" else sed -i "$parameter_del" $gdbinitfile sed -i "$parameter_add $pwndbg" $gdbinitfile echo -e "Please enjoy the pwndbg!\n" fi } echo -e "Please choose one mode of GDB?\n1.peda 2.gef 3.pwndbg" read -p "Input your choice:" num if [ $num -eq "1" ];then Mode_change $num elif [ $num -eq "2" ];then Mode_change $num elif [ $num -eq "3" ];then Mode_change $num else echo -e "Error!\nPleasse input right number!" fi gdb $1 $2 $3 $4 $5 $6 $7 $8 $9 zsh apt-get install zsh git clone https://github.com/robbyrussell/oh-my-zsh.git cd oh-my-zsh/tools ./install.sh 下载安装 zsh-autosuggestions (自动补全可能路径) git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting vi ~/.zshrc plugins=(git zsh-autosuggestions zsh-syntax-highlighting) source .zshrc 改变默认shell chsh -s /bin/zsh 原创文章,作者:小嵘源码,如若转载,请注明出处:https://www.lcpttec.com/ctf-pwn/
下载地址