学习打卡1:pwn环境搭建

督促自己:2020-9-7

pwn环境搭建

换源:

18.04

备份源文件:

cd /etc/apt
sudo cp sources.list sources.list.bak
sudo gedit sources.list

如清华大学开源软件镜像站Ubuntu镜像:mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

#ubuntu18.04
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#ubuntu16.04
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
#ubuntu 19.04
#ps:好像现在不能用了,18.04和19.04兼容,可以复制18.04的源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-proposed main restricted universe multiverse
#ubuntu20.04
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
sudo apt-get update

安装必备软件

sudo apt-get install git vim

安装Zsh与Oh-My-Zsh(可选)

打印已有shell

安装zsh

切换默认shell

打印当前默认shell

cat /etc/shells
sudo apt-get install zsh
chsh -s /bin/zsh
echo $SHELL

安装oh-my-zsh

git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
sudo gedit ~/.zshrc

将配置文件中的主体一栏改为ZSH_THEME=“ys”,也可以改为自己喜欢的主题。

【图片待插入】

高亮效果

当命令不对时会显示红色,命令正确时显示绿色。

cd ~
sudo git clone https://gitee.com/NeedY520/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

打开.zshrc文件

source ~/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 
sudo gedit ~/.zshrc

在最后添加下面内容:

plugins=(zsh-syntax-highlighting)

安装自动补全插件

sudo git clone https://gitee.com/NeedY520/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

编辑.zshrc文件

sudo gedit ~/.zshrc 

找到plugins=(git)这一行,如果没有添加。更改为如下

plugins=(git zsh-syntax-highlighting zsh-autosuggestions)

【图片待插入】

安装sublime3

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

sudo apt-get install apt-transport-https

echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

sudo apt-get update
sudo apt-get install sublime-text
    1.打开工具

    2.点击Help选项下的Enter License,将下面Register码复制粘贴

    3.点击提交,即可!

----- BEGIN LICENSE -----
sgbteam
Single User License
EA7E-1153259
8891CBB9 F1513E4F 1A3405C1 A865D53F
115F202E 7B91AB2D 0D2A40ED 352B269B
76E84F0B CD69BFC7 59F2DFEF E267328F
215652A3 E88F9D8F 4C38E3BA 5B2DAAE4
969624E7 DC9CD4D5 717FB40C 1B9738CF
20B3C4F1 E917B5B3 87C38D9C ACCE7DD8
5F7EF854 86B9743C FADC04AA FB0DA5C0
F913BE58 42FEA319 F954EFDD AE881E0B
------ END LICENSE ------

支持中文

    1.git clone https://github.com/lyfeyaj/sublime-text-imfix.git

    2.cd sublime-text-imfix && ./sublime-imfix

快捷命令:subl

安装pwntools

sudo apt-get update
sudo apt-get install python2.7 python-dev-is-python2 git libssl-dev libffi-dev build-essential
sudo pip install --upgrade pip
#sudo pip install --upgrade pwntools
#换一种方式安装pwntools
git clone https://gitee.com/NeedY520/pwntools.git
cd pwntools
python setup.py install

32为依赖库

sudo apt-get install lib32ncurses5
sudo apt-get install lib32z1

安装Peda Gef Pwndbg

安装pwngdb

cd ~/
git clone https://gitee.com/Z3R3F/Pwngdb.git 
或者 git clone https://github.com/scwuaptx/Pwngdb.git 
cp ~/Pwngdb/.gdbinit ~/

安装pwndbg

git clone https://gitee.com/NeedY520/pwndbg.git
cd pwndbg
./setup.sh

安装peda

git clone https://gitee.com/NeedY520/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit

安装peda-heap

git clone git://github.com/Mipu94/peda-heap.git ~/peda-heap

echo "source ~/peda-heap/peda.py" >> ~/.gdbinit

安装gef


安装LibcSearcher

onegadget

...

ROPgadget

sudo pip install capstone 

git clone https://github.com/lieanu/libc.git ~/LibcSearcher

cd ~/LibcSearcher  

git submodule update --init --recursive

sudo python setup.py develop

sudo apt -y install ruby

sudo gem install one_gadget

错误记录:
安装pwndbg的时候出现:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line 29, in <module>
    from pip._internal.cli.main import main as _main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

学习打卡1:pwn环境搭建_第1张图片
解决方法

curl -fsSL -o- https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.5

参考链接:https://blog.csdn.net/qq_41953012/article/details/115427897

你可能感兴趣的:(学习日志,pwn环境搭建,学习,ubuntu,linux)