TigerVNC / tigervnc

High performance, multi-platform VNC client and server
https://tigervnc.org
GNU General Public License v2.0
5.01k stars 929 forks source link

"Access denied" from WinVNC on connect #1003

Open JeremiahDixon opened 4 years ago

JeremiahDixon commented 4 years ago

Currently I am trying to create some code using TigerVNC to work with Sikuli to do userbot testing on a bunch of different headless vm's. The code works when connecting via local machine but catches an exception of "End of Stream" When trying to connect to a remote Tiger VNC server. So I started testing with just the VNC viewer and I get the same error when just trying to use the viewer via command line. I have enabled logging and I will post the logging below. I also tried updating to the latest nightly.

This is from one headless vm to another headless vm which I remote desktop into, both Windows Server 2012. Both have the latest nightly download installed.

LOG:

Thu Apr 23 18:34:03 2020
 DecodeManager: Detected 4 CPU core(s)
 DecodeManager: Creating 4 decoder thread(s)
 TcpSocket:   Connecting to ***** port 5900
 CConn:       Connected to host ***** port 5900
 CConnection: reading protocol version
 CConnection: Server supports RFB protocol version 3.8
 CConnection: Using RFB protocol version 3.8
 CConnection: processing security types message
 CConnection: Server offers security type VeNCrypt(19)
 CConnection: Server offers security type VeNCrypt(19)
 CConnection: Server offers security type VncAuth(2)
 CConnection: Choosing security type VeNCrypt(19)
 CConnection: processing security message
 CConnection: processing security message
 CConnection: processing security message
 CConnection: processing security message
 CConnection: processing security message
 CVeNCrypt:   Server offers security type TLSVnc (258)
 CConnection: processing security message
 CVeNCrypt:   Server offers security type VncAuth (2)
 CVeNCrypt:   Choosing security type TLSVnc (258)
 CConnection: processing security message
 TLS:         Anonymous session has been set
 CConnection: processing security message
 CConnection: processing security message
 TLS:         TLS handshake completed with
              (TLS1.2)-(ANON-ECDH)-(AES-256-CBC)-(SHA1)

Thu Apr 23 18:34:04 2020
 CConnection: processing security result message
 CConnection: processing security result message
 CConn:       End of stream

Any help would be awesome, thanks!

--- Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/91298370-access-denied-from-winvnc-on-connect?utm_campaign=plugin&utm_content=tracker%2F3557444&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F3557444&utm_medium=issues&utm_source=github).
CendioOssman commented 4 years ago

That message means the server closed the connection. So could you share the server log with us? We have instructions in the wiki on how to generate one on Windows.

JeremiahDixon commented 4 years ago

That message means the server closed the connection. So could you share the server log with us? We have instructions in the wiki on how to generate one on Windows.

Here is the logging from the server I can get, let me know if this is what you're asking for, thank you!

Fri Apr 24 14:54:19 2020
 Config:      set immutable Log
 VNCServerST: creating single-threaded server ***(IP)***
 Registry:    duplicated FFFFFFFF80000001 to FFFFFFFF80000001
 MsgWindow:   creating window "VNCTray"
 Registry:    createKey(FFFFFFFF80000001,Software\TigerVNC\WinVNC4) =
              00000000000001E8
 Registry:    RegCloseKey(FFFFFFFF80000001)
 RegConfig:   registry changed
 Config:      set Password(Binary) to 20084d06aa472ca9
 Config:      set SecurityTypes(String) to VeNCrypt,TLSVnc,VncAuth
 Config:      set QueryConnect(Bool) to 0(0)
 Config:      set QueryOnlyIfLoggedOn(Bool) to 0(0)
 Config:      set PortNumber(Int) to 5900
 Config:      set IdleTimeout(Int) to 0
 Config:      set LocalHost(Bool) to 0(0)
 Config:      set Hosts(String) to +,+***(IP)***,
 Config:      set AcceptKeyEvents(Bool) to 1(1)
 Config:      set RawKeyboard(Bool) to 0(0)
 Config:      set AcceptPointerEvents(Bool) to 1(1)
 Config:      set AcceptCutText(Bool) to 1(1)
 Config:      set SendCutText(Bool) to 1(1)
 Config:      set DisableLocalInputs(Bool) to 0(0)
 Config:      set DisconnectClients(Bool) to 1(1)
 Config:      set AlwaysShared(Bool) to 0(0)
 Config:      set NeverShared(Bool) to 0(0)
 Config:      set DisconnectAction(String) to None
 Config:      set RemoveWallpaper(Bool) to 0(0)
 Config:      set DisableEffects(Bool) to 0(0)
 Config:      set UpdateMethod(Int) to 0
 Config:      set PollConsoleWindows(Bool) to 1(1)
 Config:      set UseCaptureBlt(Bool) to 1(1)
 RegConfig:   unable to process UseHooks
 Config:      set Protocol3.3(Bool) to 0(0)
 ManagedListener: set server to 0000000001A4F6C8
 ManagedListener: set port to 5900
 MsgWindow:   null _this in 00000000002B053A, message 24
 MsgWindow:   null _this in 00000000002B053A, message 81
 MsgWindow:   null _this in 00000000002B053A, message 83
 MsgWindow:   created window "VNCTray" (00000000002B053A)
 ManagedListener: failed to bind socket: Only one usage of each socket address
              (protocol/network address/port) is normally permitted. (10048)
 ManagedListener: set filter to +,+***(IP)***,
 VNCServerWin32: Refreshing tray icon
 ManagedListener: failed to bind socket: Only one usage of each socket address
              (protocol/network address/port) is normally permitted. (10048)
 VNCServerWin32: Entering message loop
 VNCServerWin32: Listener not registered
 Registry:    RegCloseKey(00000000000001E8)
 VNCServerST: shutting down server ***(IP)***
 main:        WinVNC service destroyed
 main:        WinVNC process quitting
JeremiahDixon commented 4 years ago

Here is another log from another attempt.

Fri Apr 24 16:32:27 2020
 Config:      set immutable Log
 VNCServerST: creating single-threaded server SIM-21
 Registry:    duplicated FFFFFFFF80000001 to FFFFFFFF80000001
 MsgWindow:   creating window "VNCTray"
 Registry:    createKey(FFFFFFFF80000001,Software\TigerVNC\WinVNC4) =
              0000000000000200
 Registry:    RegCloseKey(FFFFFFFF80000001)
 RegConfig:   registry changed
 Config:      set Password(Binary) to 20084d06aa472ca9
 Config:      set SecurityTypes(String) to VeNCrypt,TLSVnc,VncAuth
 Config:      set QueryConnect(Bool) to 0(0)
 Config:      set QueryOnlyIfLoggedOn(Bool) to 0(0)
 Config:      set PortNumber(Int) to 5900
 Config:      set IdleTimeout(Int) to 0
 Config:      set LocalHost(Bool) to 0(0)
 Config:      set Hosts(String) to +,+10.74.40.22/32,
 Config:      set AcceptKeyEvents(Bool) to 1(1)
 Config:      set RawKeyboard(Bool) to 0(0)
 Config:      set AcceptPointerEvents(Bool) to 1(1)
 Config:      set AcceptCutText(Bool) to 1(1)
 Config:      set SendCutText(Bool) to 1(1)
 Config:      set DisableLocalInputs(Bool) to 0(0)
 Config:      set DisconnectClients(Bool) to 1(1)
 Config:      set AlwaysShared(Bool) to 0(0)
 Config:      set NeverShared(Bool) to 0(0)
 Config:      set DisconnectAction(String) to None
 Config:      set RemoveWallpaper(Bool) to 0(0)
 Config:      set DisableEffects(Bool) to 0(0)
 Config:      set UpdateMethod(Int) to 0
 Config:      set PollConsoleWindows(Bool) to 1(1)
 Config:      set UseCaptureBlt(Bool) to 1(1)
 RegConfig:   unable to process UseHooks
 Config:      set Protocol3.3(Bool) to 0(0)
 ManagedListener: set server to 0000000001A4F6C8
 ManagedListener: set port to 5900
 MsgWindow:   null _this in 0000000000290346, message 24
 MsgWindow:   null _this in 0000000000290346, message 81
 MsgWindow:   null _this in 0000000000290346, message 83
 ManagedListener: set filter to +,+ ***IP***/32,
 MsgWindow:   created window "VNCTray" (0000000000290346)
 VNCServerWin32: Refreshing tray icon
 VNCServerWin32: Entering message loop

Fri Apr 24 16:33:04 2020
 SocketManager: accepting incoming connection
 TcpSocket:   ACCEPT 1 ***IP***
 Connections: accepted:  ***IP***::57513
 SConnection: reading protocol version
 SConnection: Client needs protocol version 3.8
 SConnection: processing security type message
 SConnection: Client requests security type VeNCrypt(19)
 SConnection: processing security message
 SConnection: processing security message
 SConnection: processing security message
 SConnection: processing security message
 SVeNCrypt:   Client requests security type TLSVnc (258)
 TLS:         Process security message (session 0000000000000000)
 TLS:         Anonymous session has been set
 TLS:         Deferring completion of TLS handshake: Resource temporarily
              unavailable, try again.
 SConnection: processing security message
 TLS:         Process security message (session 0000000003CDA170)
 TLS:         Deferring completion of TLS handshake: Resource temporarily
              unavailable, try again.
 SConnection: processing security message
 TLS:         Process security message (session 0000000003CDA170)
 TLS:         TLS handshake completed with
              (TLS1.2)-(ANON-ECDH)-(AES-256-CBC)-(SHA1)

Fri Apr 24 16:33:06 2020
 SConnection: processing security message
 VNCServerST: starting desktop
 SDisplay:    starting
 TsSessions:  Console session is 1
 VNCSConnST:  closing  ***IP***::57513: Unable to connect session to Console:
              Access is denied. (5)
 EncodeManager: Framebuffer updates: 0
 EncodeManager:   Total: 0 rects, 0 pixels
 EncodeManager:          0 B (1:-1.#IND ratio)
 TLS:         TLS session wasn't terminated gracefully
 Connections: closed: ***IP***:57513
CendioOssman commented 4 years ago

We got the same problem in #935, but it went away when trying a new build. So I guess the issue is back, or the new build only fixed it in some cases.

JeremiahDixon commented 4 years ago

We got the same problem in #935, but it went away when trying a new build. So I guess the issue is back, or the new build only fixed it in some cases.

So you believe it to be a bug with TigerVNC and not something I've done incorrectly?

I just tried going back to 10.0 and it still didn't work.

CendioOssman commented 4 years ago

We assume so for now. There is some permission setting that needs to be set up, but unfortunately I don't know what. And there are currently no developers working on WinVNC so I'm afraid I don't think anyone will be looking at this issue anytime soon. :/

JeremiahDixon commented 4 years ago

I swapped to TightVNC and my Sikuli/VNC code works exactly as I need it to. TigerVNCViewer even works with the TightVNC server.