TightVNC: How to list all connected users

6.6k views Asked by At

I'm using TightVNC (Version 2.8.5) to connect to machines. While using it the clipboard between my Computer and the remote Computer is transfered in both directions. I need that function, so it's ok for me. Today I noticed that the clipboard changed (likely because another user also connected via TightVNC).
I didn't find a possibility to find out who connected or watched me - that's worrying me...

How can I find out which other users

  • are currently connected via TightVNC?
  • were connected in the past? (Logfile)
2

There are 2 answers

0
jkrtw On BEST ANSWER

On Windows you can find at least from what IP another connection is established. On tightVNC server launch command prompt and try:

netstat -an | find "ESTABLISHED" | find ":5900"

0
Michael Hutter On

Get all current VNC Connections to your Computer including the hostname:

C:\>FOR /f "tokens=3*delims= " %a IN ('netstat -n^|find "5900"') DO @FOR /f "tokens=1*delims=:" %d IN ('echo %a^|find /v "5900"') DO @for /f "tokens=3delims= " %e in ('tracert -h 1 %d ^| find "max"') do @echo VNC connection from %e (%d) [%b]
 

Get all current VNC Connections from your Computer including the hostname:

FOR /f "tokens=3*delims= " %a IN ('netstat -n^|find "5900"') DO @FOR /f "tokens=1*delims=:" %d IN ('echo %a^|find "5900"') DO @for /f "tokens=3delims= " %e in ('tracert -h 1 %d ^| find "max"') do @echo VNC connection to %e (%d) [%b]
 

And here is a batch file ShowVncConnections.bat for that purpose:

@echo off
FOR /f %%a in ('hostname') DO set hostname=%%a
FOR /f "tokens=3*delims= " %%a IN ('netstat -n^|find "5900"') DO @FOR /f "tokens=1*delims=:" %%d IN ('echo %%a^|find "5900"') DO @for /f "tokens=3delims= " %%e in ('tracert -h 1 %%d ^| find "max"') do @echo VNC connection from %hostname% to %%e (%%d) [%%b]
FOR /f "tokens=3*delims= " %%a IN ('netstat -n^|find "5900"') DO @FOR /f "tokens=1*delims=:" %%d IN ('echo %%a^|find /v "5900"') DO @for /f "tokens=3delims= " %%e in ('tracert -h 1 %%d ^| find "max"') do @echo VNC connection from %%e (%%d) to %hostname% [%%b]
pause

Produced Output:

VNC connection from MyComputer to AIP00000298 (172.20.17.55) [ESTABLISHED]
VNC connection from MyComputer to BMABN0014.aip.dagherp.local (172.20.17.67) [WAITING]
VNC connection from BMABN3145 (172.20.18.5) to MyComputer [ESTABLISHED]