Open mcdope opened 1 year ago
TeamViewer does not provide a way to check for active connections, except in the GUI which is obv not an option.
So for TV we are left with either parsing logs, or checking for active connections to the process - both not reliable enough.
xrdp can be detected via envvars
For gnome-remote-desktop it seems there is also no way to check for incoming connection
For VNC: to many different servers
Maybe really the best to build a list of processnames, check if they run, and if they run: check them for incoming connection. Could lead some FPs though I guess.
For gnome-remote-desktop it seems there is also no way to check for incoming connection
For VNC: to many different servers
Maybe really the best to build a list of processnames, check if they run, and if they run: check them for incoming connection. Could lead some FPs though I guess.
To check via proc:
Active Teamviewer connection result in a process that does not exist without connection established
ss -ntp | grep TeamViewer
ESTAB 0 0 127.0.0.1:47192 127.0.0.1:5939 users:(("TeamViewer",pid=93958,fd=44))
ESTAB 0 0 127.0.0.1:50652 127.0.0.1:5939 users:(("TeamViewer_Desk",pid=103648,fd=14))
gnome-remote-desktop in VNC mode can also be detected that way, doesnt work in RDP though
ESTAB 0 21128 [::ffff:192.168.1.101]:5900 [::ffff:192.168.1.103]:46328 users:(("gnome-remote-de",pid=38390,fd=58))
Hmpf I dont get x11vnc working to test it...
As far as TeamViewer and VNC go, there doesn't seem to be any way to detect an active incoming TeamViewer or VNC connection short of checking active.
ss -tnp
for example will show a lineusers:(("TeamViewer_Desk",pid=406339,fd=14))
when there is an active incoming connection.Full output from Konsole via an established TeamViewer console (looks the same on xvnc):
...and output from w (also the same for Teamviewer and VNC):
_Originally posted by @steelsnake in https://github.com/mcdope/pam_usb/discussions/124#discussioncomment-5434844_