一、切换root身份,默认无密码

sudo su root

二、为root设置密码

passwd

三、源配置,中科大

root@kali:~# vi /etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 2020.2 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 20200508-14:31]/ kali-last-snapshot contrib main non-free

#deb cdrom:[Debian GNU/Linux 2020.2 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 20200508-14:31]/ kali-last-snapshot contrib main non-free

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
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

四、更新

root@kali:~# apt-get clean && apt-get update

五、下载x11vnc工具

root@kali:~# apt install x11vnc -y

六、设置密码

root@kali:~# x11vnc -storepasswd 123456 /etc/x11vnc.pass
stored passwd in file: /etc/x11vnc.pass

七、编写开机自启文件

root@kali:~# vim /lib/systemd/system/x11vnc.service
Description=Start x11vnc at startup
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target

八、设置开机自启动

root@kali:~# systemctl enable x11vnc.service
Created symlink /etc/systemd/system/multi-user.target.wants/x11vnc.service → /lib/systemd/system/x11vnc.service.

九、重启

root@kali:~# reboot

十、查看端口

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      609/sshd: /usr/sbin 
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      669/x11vnc          
tcp6       0      0 :::22                   :::*                    LISTEN      609/sshd: /usr/sbin 
tcp6       0      0 :::5900                 :::*                    LISTEN      669/x11vnc 

十一、用vnc客户端连接

Categories: kali

0 Comments

发表评论

Avatar placeholder

邮箱地址不会被公开。 必填项已用*标注