Bin环境配置

Bin环境配置

Linux环境:Ubuntu20

一、ROOT

sudo passwd root

1
2
3
4
5
6
7
8
9
# 修改PAM文件
sed -i "s/.*root quiet_success$/#&/" /etc/pam.d/gdm-autologin
sed -i "s/.*root quiet_success$/#&/" /etc/pam.d/gdm-password
# 修改profile
sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile
# 重启自动进入Root
touch /etc/gdm3/custom.conf
echo -e "[daemon]\nAutomaticLoginEnable=true\nAutomaticLogin=root" | sudo tee -a /etc/gdm3/custom.conf
reboot

二、环境基础配置

一键配置脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# 1. 配置Root远程登录
# 安装ssh server端
apt-get install -y openssh-server
# 修改sshd_config文件
sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
# 重启ssh服务
systemctl restart ssh

# 2. SSH登录密钥配置
mkdir -p /root/.ssh #新建一个.ssh文件夹
touch /root/.ssh/authorized_keys #新建一个.authorized_keys
chmod 600 /root/.ssh/authorized_keys #该权限是保证git用户免密登录推送文件必要步骤
chmod 700 /root/.ssh
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDBe/UsMlJRIL+Z4w0DTr9nRmKu8Tt9cPoKj/t7fOHWItBPxMaVryrq732nIkZlCrtpJNkZJsfN9Fq2oGHyA/x3qrXBjhNiFUx2NTRHPlcfVMfTf+XB34oa4eAHOEWpkxCDZe+W0nV3va8sp7poSQqA+GD+YmidZ8dR57TQdfnTTFB9SIW7DZBATRseUzf/PtPRTVh7Jn/963M/JHVhV+OHXJ0BRCvu0YBg/oqxPkWJ41kZOZJP6KfDVICgoERgULRdnYWLNUUNlLOQ4LPDG3fhQHJgN2L9hqjf0bk5Zx5ZA9Uy093AAdkyElY2rkxeN9hwOZT/YFEbvUAT0v2kDtf1TM8lfuO3ibD2j9Pxetv/jUKNthliSmdeB/+tD6hkJ6/mdjvoIgqATY2YlEIM7YYTAZ4mVaqAbYKx3HHDRlj7Jd2wUEGuOFcuzvqIsIHTfSzcydvUBW04zLUKAl/Zacp0mi+wmbgyX3gZYO6nhFCjmQPaO2KyNLrArYepWifDnlk= d4wn@D4wn' > /root/.ssh/authorized_keys

# 3. 安装Miniconda
wget -P /root/ https://repo.anaconda.com/miniconda/Miniconda3-py38_23.1.0-1-Linux-x86_64.sh
chmod +x /root/Miniconda3-py38_23.1.0-1-Linux-x86_64.sh
bash /root/Miniconda3-py38_23.1.0-1-Linux-x86_64.sh -b -p /root/miniconda3
/root/miniconda3/bin/conda init $(echo $SHELL | awk -F '/' '{print $NF}')

# 4. 安装其它软件
apt-get install -y vim
apt-get install -y git
# 注意, 这里后缀一定不能加上.git
git clone https://github.com/pwndbg/pwndbg /root/Desktop/pwndbg
chmod 777 /root/Desktop/pwndbg/setup.sh
cd /root/Desktop/pwndbg && ./setup.sh
# 允许编译32位程序
apt install gcc-multilib

Bin环境配置
https://d4wnnn.github.io/2023/10/01/Security/Bin环境配置/
作者
D4wn
发布于
2023年10月1日
许可协议