一、尝试解决的办法
①更新x11vnc至最新版本
root@kali:~# apt-get install x11vnc
②为x11vnc设置密码
root@kali:~# x11vnc -storepasswd
Enter VNC password:
Verify password:
Write password to /root/.vnc/passwd? [y]/n y
Password written to: /root/.vnc/passwd
③设置客户端vnc属性
在properties--experts--选项中:
设置ColorLevel:Full ,设置KeepAliveResponseTimeout:0
二、修改配置文件
root@kali:/etc/sysctl.d# vi /root/.vnc/xstartup #添加最后一行
xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
gnome-session & #使用gnome界面
三、重启服务
root@kali:~# systemctl restart x11vnc.service
root@kali:~# systemctl status x11vnc.service
● x11vnc.service - Start x11vnc at startup
Loaded: loaded (/lib/systemd/system/x11vnc.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2021-06-27 11:19:53 CST; 8s ago
Main PID: 9570 (x11vnc)
Tasks: 2 (limit: 3478)
Memory: 7.9M
CGroup: /system.slice/x11vnc.service
├─9570 /usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900>
└─9571 /usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900>
6月 27 11:19:58 kali x11vnc[9571]: 27/06/2021 11:19:58
6月 27 11:19:58 kali x11vnc[9571]: The VNC desktop is: kali:0
6月 27 11:19:58 kali x11vnc[9571]: PORT=5900
6月 27 11:19:58 kali x11vnc[9571]: ******************************************************************************
6月 27 11:19:58 kali x11vnc[9571]: Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?
6月 27 11:19:58 kali x11vnc[9571]: The scheme stores pixel data offscreen on the VNC viewer side for faster
6月 27 11:19:58 kali x11vnc[9571]: retrieval. It should work with any VNC viewer. Try it by running:
6月 27 11:19:58 kali x11vnc[9571]: x11vnc -ncache 10 ...
6月 27 11:19:58 kali x11vnc[9571]: One can also add -ncache_cr for smooth 'copyrect' window motion.
6月 27 11:19:58 kali x11vnc[9571]: More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching
四、root@kali:~# x11vnc -ncache 10 #输入提示命令,清除缓存
###############################################################
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@ @#
#@ ** WARNING ** WARNING ** WARNING ** WARNING ** @#
#@ @#
#@ YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!! @#
#@ @#
#@ This means anyone with network access to this computer @#
#@ may be able to view and control your desktop. @#
#@ @#
#@ >>> If you did not mean to do this Press CTRL-C now!! <<< @#
#@ @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@ @#
#@ You can create an x11vnc password file by running: @#
#@ @#
#@ x11vnc -storepasswd password /path/to/passfile @#
#@ or x11vnc -storepasswd /path/to/passfile @#
#@ or x11vnc -storepasswd @#
#@ @#
#@ (the last one will use ~/.vnc/passwd) @#
#@ @#
#@ and then starting x11vnc via: @#
#@ @#
#@ x11vnc -rfbauth /path/to/passfile @#
#@ @#
#@ an existing ~/.vnc/passwd file from another VNC @#
#@ application will work fine too. @#
#@ @#
#@ You can also use the -passwdfile or -passwd options. @#
#@ (note -passwd is unsafe if local users are not trusted) @#
#@ @#
#@ Make sure any -rfbauth and -passwdfile password files @#
#@ cannot be read by untrusted users. @#
#@ @#
#@ Use x11vnc -usepw to automatically use your @#
#@ ~/.vnc/passwd or ~/.vnc/passwdfile password files. @#
#@ (and prompt you to create ~/.vnc/passwd if neither @#
#@ file exists.) Under -usepw, x11vnc will exit if it @#
#@ cannot find a password to use. @#
#@ @#
#@ @#
#@ Even with a password, the subsequent VNC traffic is @#
#@ sent in the clear. Consider tunnelling via ssh(1): @#
#@ @#
#@ http://www.karlrunge.com/x11vnc/#tunnelling @#
#@ @#
#@ Or using the x11vnc SSL options: -ssl and -stunnel @#
#@ @#
#@ Please Read the documentation for more info about @#
#@ passwords, security, and encryption. @#
#@ @#
#@ http://www.karlrunge.com/x11vnc/faq.html#faq-passwd @#
#@ @#
#@ To disable this warning use the -nopw option, or put @#
#@ 'nopw' on a line in your ~/.x11vncrc file. @#
#@ @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
###############################################################
27/06/2021 11:20:52 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 9707
27/06/2021 11:20:52 XOpenDisplay("") failed.
27/06/2021 11:20:52 Trying again with XAUTHLOCALHOSTNAME=localhost ...
27/06/2021 11:20:52
27/06/2021 11:20:52 *** XOpenDisplay failed. No -display or DISPLAY.
27/06/2021 11:20:52 *** Trying ":0" in 4 seconds. Press Ctrl-C to abort.
27/06/2021 11:20:52 *** 1 2 3 4
27/06/2021 11:20:56 *** XOpenDisplay of ":0" successful.
27/06/2021 11:20:56
27/06/2021 11:20:56 Using X display :0
27/06/2021 11:20:56 rootwin: 0x3ad reswin: 0x4600001 dpy: 0x327852e0
27/06/2021 11:20:56
27/06/2021 11:20:56 ------------------ USEFUL INFORMATION ------------------
27/06/2021 11:20:56 X DAMAGE available on display, using it for polling hints.
27/06/2021 11:20:56 To disable this behavior use: '-noxdamage'
27/06/2021 11:20:56
27/06/2021 11:20:56 Most compositing window managers like 'compiz' or 'beryl'
27/06/2021 11:20:56 cause X DAMAGE to fail, and so you may not see any screen
27/06/2021 11:20:56 updates via VNC. Either disable 'compiz' (recommended) or
27/06/2021 11:20:56 supply the x11vnc '-noxdamage' command line option.
27/06/2021 11:20:56
27/06/2021 11:20:56 Wireframing: -wireframe mode is in effect for window moves.
27/06/2021 11:20:56 If this yields undesired behavior (poor response, painting
27/06/2021 11:20:56 errors, etc) it may be disabled:
27/06/2021 11:20:56 - use '-nowf' to disable wireframing completely.
27/06/2021 11:20:56 - use '-nowcr' to disable the Copy Rectangle after the
27/06/2021 11:20:56 moved window is released in the new position.
27/06/2021 11:20:56 Also see the -help entry for tuning parameters.
27/06/2021 11:20:56 You can press 3 Alt_L's (Left "Alt" key) in a row to
27/06/2021 11:20:56 repaint the screen, also see the -fixscreen option for
27/06/2021 11:20:56 periodic repaints.
27/06/2021 11:20:56
27/06/2021 11:20:56 XFIXES available on display, resetting cursor mode
27/06/2021 11:20:56 to: '-cursor most'.
27/06/2021 11:20:56 to disable this behavior use: '-cursor arrow'
27/06/2021 11:20:56 or '-noxfixes'.
27/06/2021 11:20:56 using XFIXES for cursor drawing.
27/06/2021 11:20:56 GrabServer control via XTEST.
27/06/2021 11:20:56
27/06/2021 11:20:56 Scroll Detection: -scrollcopyrect mode is in effect to
27/06/2021 11:20:56 use RECORD extension to try to detect scrolling windows
27/06/2021 11:20:56 (induced by either user keystroke or mouse input).
27/06/2021 11:20:56 If this yields undesired behavior (poor response, painting
27/06/2021 11:20:56 errors, etc) it may be disabled via: '-noscr'
27/06/2021 11:20:56 Also see the -help entry for tuning parameters.
27/06/2021 11:20:56 You can press 3 Alt_L's (Left "Alt" key) in a row to
27/06/2021 11:20:56 repaint the screen, also see the -fixscreen option for
27/06/2021 11:20:56 periodic repaints.
27/06/2021 11:20:56
27/06/2021 11:20:56 Client Side Caching: -ncache mode is in effect to provide
27/06/2021 11:20:56 client-side pixel data caching. This speeds up
27/06/2021 11:20:56 iconifying/deiconifying windows, moving and raising
27/06/2021 11:20:56 windows, and reposting menus. In the simple CopyRect
27/06/2021 11:20:56 encoding scheme used (no compression) a huge amount
27/06/2021 11:20:56 of extra memory (20-100MB) is used on both the server and
27/06/2021 11:20:56 client sides. This mode works with any VNC viewer.
27/06/2021 11:20:56 However, in most you can actually see the cached pixel
27/06/2021 11:20:56 data by scrolling down, so you need to re-adjust its size.
27/06/2021 11:20:56 See http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching.
27/06/2021 11:20:56 If this mode yields undesired behavior (poor response,
27/06/2021 11:20:56 painting errors, etc) it may be disabled via: '-ncache 0'
27/06/2021 11:20:56 You can press 3 Alt_L's (Left "Alt" key) in a row to
27/06/2021 11:20:56 repaint the screen, also see the -fixscreen option for
27/06/2021 11:20:56 periodic repaints.
27/06/2021 11:20:56
27/06/2021 11:20:56 XKEYBOARD: number of keysyms per keycode 7 is greater
27/06/2021 11:20:56 than 4 and 51 keysyms are mapped above 4.
27/06/2021 11:20:56 Automatically switching to -xkb mode.
27/06/2021 11:20:56 If this makes the key mapping worse you can
27/06/2021 11:20:56 disable it with the "-noxkb" option.
27/06/2021 11:20:56 Also, remember "-remap DEAD" for accenting characters.
27/06/2021 11:20:56
27/06/2021 11:20:56 X FBPM extension not supported.
27/06/2021 11:20:56 X display is capable of DPMS.
27/06/2021 11:20:56 --------------------------------------------------------
27/06/2021 11:20:56
27/06/2021 11:20:56 Default visual ID: 0x21
27/06/2021 11:20:56 Read initial data from X display into framebuffer.
27/06/2021 11:20:56 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/3200
27/06/2021 11:20:56
27/06/2021 11:20:56 X display :0 is 32bpp depth=24 true color
27/06/2021 11:20:56
27/06/2021 11:20:56 Autoprobing TCP port
27/06/2021 11:20:56 Autoprobing selected TCP port 5904
27/06/2021 11:20:56 Autoprobing TCP6 port
27/06/2021 11:20:56 rfbListenOnTCP6Port: error in bind IPv6 socket: Address already in use
27/06/2021 11:20:56 Autoprobing selected TCP6 port 5901
27/06/2021 11:20:56 Listening also on IPv6 port 5904 (socket 10)
27/06/2021 11:20:56
27/06/2021 11:20:56 Xinerama is present and active (e.g. multi-head).
27/06/2021 11:20:56 Xinerama: number of sub-screens: 1
27/06/2021 11:20:56 Xinerama: no blackouts needed (only one sub-screen)
27/06/2021 11:20:56
27/06/2021 11:20:56 fb read rate: 724 MB/sec
27/06/2021 11:20:56 fast read: reset -wait ms to: 10
27/06/2021 11:20:56 fast read: reset -defer ms to: 10
27/06/2021 11:20:56 The X server says there are 12 mouse buttons.
27/06/2021 11:20:56 screen setup finished.
27/06/2021 11:20:56
27/06/2021 11:20:56 WARNING: You are running x11vnc WITHOUT a password. See
27/06/2021 11:20:56 WARNING: the warning message printed above for more info.
27/06/2021 11:20:56
The VNC desktop is: kali:4
PORT=5904
27/06/2021 11:21:31 Got connection from client 10.0.0.1
27/06/2021 11:21:31 other clients:
27/06/2021 11:21:31 Normal socket connection
27/06/2021 11:21:31 Disabled X server key autorepeat.
27/06/2021 11:21:31 to force back on run: 'xset r on' (3 times)
27/06/2021 11:21:31 incr accepted_client=1 for 10.0.0.1:49802 sock=11
27/06/2021 11:21:31 Client Protocol Version 3.8
27/06/2021 11:21:31 Protocol version sent 3.8, using 3.8
27/06/2021 11:21:31 rfbProcessClientSecurityType: executing handler for type 1
27/06/2021 11:21:31 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
27/06/2021 11:21:32 created xdamage object: 0x460001d
27/06/2021 11:21:32 copy_tiles: allocating first_line at size 26
27/06/2021 11:21:33 client_set_net: 10.0.0.1 0.0147
27/06/2021 11:21:33 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000018)
27/06/2021 11:21:33 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000016)
27/06/2021 11:21:33 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000015)
27/06/2021 11:21:33 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000000F)
27/06/2021 11:21:33 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFFFEC6)
27/06/2021 11:21:33 Enabling full-color cursor updates for client 10.0.0.1
27/06/2021 11:21:33 Enabling NewFBSize protocol extension for client 10.0.0.1
27/06/2021 11:21:33 Using ZRLE encoding for client 10.0.0.1
27/06/2021 11:21:33 Pixel format for client 10.0.0.1:
27/06/2021 11:21:33 32 bpp, depth 24, little endian
27/06/2021 11:21:33 true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
27/06/2021 11:21:33 no translation needed
27/06/2021 11:21:33 client 1 network rate 1159.6 KB/sec (258277.7 eff KB/sec)
27/06/2021 11:21:33 client 1 latency: 1.5 ms
27/06/2021 11:21:33 dt1: 0.0396, dt2: 0.0503 dt3: 0.0015 bytes: 103449
27/06/2021 11:21:33 link_rate: LR_LAN - 1 ms, 1159 KB/s
27/06/2021 11:21:35 set_ncache_xrootpmap: loading background pixmap: 0x3ad
27/06/2021 11:21:35 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000018)
27/06/2021 11:21:35 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000000F)
27/06/2021 11:21:35 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000016)
27/06/2021 11:21:35 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000015)
27/06/2021 11:21:35 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFFFEC6)
27/06/2021 11:21:35 Enabling full-color cursor updates for client 10.0.0.1
27/06/2021 11:21:35 Enabling NewFBSize protocol extension for client 10.0.0.1
27/06/2021 11:21:35 Switching from ZRLE to hextile Encoding for client 10.0.0.1
27/06/2021 11:21:40 created selwin: 0x460001e
27/06/2021 11:21:40 called initialize_xfixes()
27/06/2021 11:26:32 idle keyboard: turning X autorepeat back on.
五、vncserver在调用的时候,会根据你的配置来启用server端的监听端口, 从5900开始,加上你的桌面号
The VNC desktop is: kali:4
PORT=5904
六、尝试切换5904端口连接,解决了闪退问题。

0 Comments