把Kali Linux 2019.2 作为开发环境的一些配置

介绍

使用Kali Linux需要做一些初始化配置才能用的更顺手

修改apt-get的源为阿里云

vim /etc/apt/sources.list

#deb http://http.kali.org/kali kali-rolling main non-free contrib
deb https://mirrors.aliyun.com/kali kali-rolling main non-free contrib

修改时区

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo 'Asia/Shanghai' >/etc/timezone

输入法fcitx拼音,Sogou输入法

apt-get update && apt-get upgrade
apt-get install fcitx
apt install fcitx-libs fcitx-libs-qt
# 去 https://pinyin.sogou.com/linux/?r=pinyin 下载64位的deb包
dpkg -i sogoupinyin_2.2.0.0108_amd64.deb
# apt-get install fcitx fcitx-googlepinyin fcitx-pinyin fcitx-module-cloudpinyin

虚拟专用网络客户端

apt-get install network-manager-pptp
apt-get install network-manager-strongswan
apt-get install network-manager-vpnc
/etc/init.d/network-manager restart

Kali Linux 安装 zerotier的方法

当kali linux安装zerotier的时候使用

curl -s https://install.zerotier.com/ | sudo bash

并不能安装成功,系统会提示未匹配的系统
其实我们知道kali linux是基于debian定制的,那么把kali的标识加入安装脚本后让其识别为debian系统
这样就可以正常安装了
先下载脚本

curl -s https://install.zerotier.com/ > zerotier.sh
vim zerotier.sh

然后在增加

# 约175行左右
elif [ "$dvers" = "10" -o "$dvers" = "11" -o "$dvers" = "sid" -o "$dvers" = "buster" ]; then
# 改为
elif [ "$dvers" = "10" -o "$dvers" = "11" -o "$dvers" = "sid" -o "$dvers" = "buster"  -o "$dvers" = "kali-rolling" ]; then
# 保持后执行
sudo bash zerotier.sh

即可正常安装

Kali Linux 安装VNC+noVNC并设置开机自动启动

vnc server选择使用
noVNC让vnc可以通过web访问

vnc server

sudo apt-get install vnc4server
# 先要运行一遍vncserver 会提示你设置一个密码 (第二轮的密码是vnc的仅查看密码可以输入N不设置)
vncserver
# 设置密码巴拉巴拉
# 关闭vnc
# vncserver -kill :1

修改vnc的配置(kali linux桌面用的xfce)

vim ~/.vnc/xstartup

#!/bin/bash

export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

if [ -e "$HOME/.Xresources" ]
then
    xrdb "$HOME/.Xresources"
fi

startxfce4 &

noVNC

noVNC安装

git clone https://github.com/novnc/noVNC.git /usr/local/noVNC
cd /usr/local/noVNC
nohup ./utils/launch.sh --vnc localhost:5901 &

设置VNC和noVNC开机自动启动

由于debian的新版本已经没有 /etc/rc.local 导致我们不能非常简单方便的增加开机自动运行
还好有系统有预留开启”/etc/rc.local”的方法

vim /etc/rc.local
# 加入vncserver 和 noVNC的启动项目
vim /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

#vnc
#/usr/bin/vncserver -depth 24 -geometry 1280x800 :1
/sbin/runuser -l root -c "vncserver :1"
nohup /usr/local/noVNC/utils/launch.sh --vnc localhost:5901 &

exit 0

# 启用 "/etc/rc.local"的支持
systemctl enable rc-local
systemctl start rc-local
systemctl status rc-local

(过期)安装vncserver远程桌面

sudo apt-get install vnc4server

vncserver

#修改配置文件
# vi ~/.vnc/xstartup

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

killall Xtightvnc
vncserver

kali linux安装docker

# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/debian/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
vim /etc/apt/sources.list.d/docker.list
deb https://mirrors.aliyun.com/docker-ce/linux/debian wheezy stable
# Step 4: 更新并安装 Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce

发表回复