KaliLinux安装

​ 持续更新中~

KaliLinux配置

更换国内软件源

​ kali默认软件源安装可比较慢,推荐配置国内源提高速度

  1. su root 进入root 模式
  2. vim /etc/apt/sources.list 编辑软件源配置文件
  3. 按 i 进入 vim 的编辑模式,用#将deb一行的内容注释掉,然后换成国内源地址
  4. 软件源(选择一个即可)
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
31
# 官方源(国内较慢)
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

# 中科大源
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib

# 阿里云源
deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib

# 清华大学源
deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free

# 浙大源
deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free

# 东软大学源
deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib

# 新加坡kali源(国内较慢)
deb http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
deb-src http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib

# 163 Kali源
deb http://mirrors.163.com/debian wheezy main non-free contrib
deb-src http://mirrors.163.com/debian wheezy main non-free contrib
  1. Esc,然后输入 wq 保存退出即可
  2. 使用apt-get update更新索引
  3. 使用apt-get upgrade更新软件

pip换源(清华源)

1
2
3
mkdir ~/.pip 或 mkdir -p ~/.config/pip
cd ~/.pip 或 cd ~/.config/pip
vim pip.conf

修改pip.conf的内容为

1
2
3
4
5
6
7
8
9
10
11
[global]

index-url=https://pypi.tuna.tsinghua.edu.cn/simple

timeout = 6000

[install]

trusted-host=pypi.tuna.tsinghua.edu.cn

disable-pip-version-check = true

其他源

1
2
3
4
5
6
7
8
9
10
11
12
# 豆瓣
https://pypi.douban.com/
# 华中理工大学
https://pypi.hustunique.com/
# 山东理工大学
https://pypi.sdutlinux.org/
# 中国科学技术大学
https://pypi.mirrors.ustc.edu.cn/
# 阿里云
https://mirrors.aliyun.com/pypi/simple/
# 清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/

Bash开启网络重定向选项

​ kalilinux预装的bash可能未开启bash的网络重定向功能,-e不能使用,反弹shell时也会提示/dev/tcp不存在,就没法利用bash反弹shell了,为了使用bash的网络重定向功能,需要重新编译bash并加上–enable-net-redirections

  1. 查询当前使用bash版本
1
bash --version
  1. 下载对应版本的bash
1
wget https://ftp.gnu.org/gnu/bash/bash-5.1.16.tar.gz
  1. 解压并进入到解压后的目录
1
2
tar zxvf bash-5.1.16.tar.gz
cd bash-5.1.16
  1. 配置
1
./configure --prefix=/usr/local/bash --enable-net-redirections
  1. 编译和安装
1
2
make
sudo make install
  1. 更换使用的shell并重启
1
2
3
sudo echo "/usr/local/bash/bin/bash" >> /etc/shells
sudo chsh -s /usr/local/bash/bin/bash # 这一步如果失败就手动修改/etc/passwd中的shell路径
sudo reboot

其他软件的安装

xrdp

​ 官方给出的xrdp配置脚本

1
2
3
4
5
6
7
8
9
10
#!/bin/sh
echo "[i] Updating and upgrading Kali (this will take a while)"
apt-get update
apt-get dist-upgrade -y

echo "[i] Installing Xfce4 & xrdp (this will take a while as well)"
apt-get install -y kali-desktop-xfce xorg xrdp

echo "[i] Configuring xrdp to listen to port 3390 (but not starting the service)"
sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini

​ 将其保存为xrdp-install.sh文件后,执行sudo bash xrdp-install.sh即可

​ 以下为一些可能用到的命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 命令行启动
sudo systemctl set-default multi-user.target

# 图形化界面启动
sudo systemctl set-default graphical.target

# 设置开机自启
sudo systemctl enable xrdp

# 启动与关闭
sudo systemctl start xrdp
sudo systemctl stop xrdp

# 避免ssl证书无法验证,将xrdp用户加入ssl-cert用户组
sudo adduser xrdp ssl-cert

# 修改配置后记得重启
reboot

​ 安装远程连接xrdp的客户端(二选一即可)

1
2
sudo apt install gnome-boxes
sudo apt install remmina

参考