Site-T

SUP-project


  • Home
  • Archive
  • Tags
  •  

© 2019 Time Looper

Theme Typography by Makito

Proudly published with Hexo

sup-008 从零开始配置ubuntu服务器

Posted at 2019-09-24 collection 

从零开始配置服务器/linux虚拟机

终端颜色调整

如果想要启用颜色模式,需要打开 ~/.bashrc文件,将force_color_promot=yes前面的注释去掉即可。如果有自定义颜色需求自行搜索指令。

下载换源

更改软件安装源:如果是图形化界面的话可以搜索software&updates选项进行换源

否则你需要在/etc/apt/sources.list里面进行更改。

mv /etc/apt/sources.list /etc/apt/sources.list.bakup

若使用阿里云可将其中内容修改为:(基本上就是改一下原本的网址,保留后面的内容)

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted
deb http://mirrors.aliyun.com/ubuntu/ bionic universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates universe
deb http://mirrors.aliyun.com/ubuntu/ bionic multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ bionic-security universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-security multiverse

更改pip 源:

修改 ~/.pip/pip.conf

[global]
index-url = http://mirrors.aliyun.com/pypi/simple
[install]
trusted-host = http://mirrors.aliyun.com/pypi

pwntools安装

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 pip
python3 -m pip install --upgrade git+https://github.com/Gallopsled/pwntools.git@dev3

目前遇到的问题是pip install --upgrade pip后pip 不能执行,报错cannot import main,采取的方法是修改/usr/bin/pip。

方法一:
将原来的from pip import main 改为from pip._internal import main
方法二:
将原来的:

from pip import main
if __name__ == '__main__':
    sys.exit(main())

改为:

from pip import __main__
if __name__ == '__main__':
    sys.exit(__main__._main())

另外注意修改后的main是两个下划线。参考博客

pwndbg 插件安装

git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh
cd ..

LibcSearcher 插件安装

git clone https://github.com/lieanu/LibcSearcher.git
cd LibcSearcher
sudo python setup.py develop
cd ..

ubuntu x64上运行32位程序

sudo apt-get install lib32stdc++6

由于实在忍受不了每次手动写入命令行所以自制了一个文件可以用来直接安装环境

Putty 初次配置及使用

基本上如果能用Xshell不建议用这个软件,但谁叫这软件免费呢……

1. 设置私钥

如果你没有私钥可以使用puttygen程序来生成,生成后公钥保存在服务器段,私钥保存在本地即可。

导入OpenSSH可以使用 load键,然后直接Save Private Key 即可;将ppk转换成OpenSSH格式则要你在菜单栏的conversions中选择export OpenSSH key导出。

2. 建立连接

connection -> data :Auto-login username 设置登录名

connection -> SSH -> Auth: Private key file: 设置私钥的地址

Session: 输入ip 端口号,并给配置命名后保存配置。

设置完成后就可以Load配置以启动了。

3. 文件传输

pscp local_file usrname@ip:remote_file 上传到相应服务器的地址下

pscp usrname@ip:remote_file local_file 下载到本地。

执行下载指令需要安装 sudo apt install putty-tools

Share 

 Previous post: sup-009 符号化执行与Z3约束 Next post: sup-extra 二进制组周练题解汇总 

© 2019 Time Looper

Theme Typography by Makito

Proudly published with Hexo