moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.74k stars 244 forks source link

How could I detect if pyinput is being used on a Windows machine via remote desktop protocol? #525

Closed echeateron closed 1 year ago

echeateron commented 1 year ago

I'm the owner of the remote machine (host), but I've no control on the client machine.

moses-palmer commented 1 year ago

Unfortunately I have no experience in administering or monitoring Windows machines, so I can't really help you.

In the general case, I don't think it would be possible to detect pynput specifically, but perhaps it's possible to detect when the win32 API function SetWindowsHookEx is used? That is what this library uses to start listening to input events.

echeateron commented 1 year ago

Then it might be possible to install a software to detect SetWindowsHookEx usage on client machine.

But, I've no control over the client machines, and I can't install any software on them. And they could be a Linux, OsX or a Windows machine.

I've control over the host machine only (Windows). Do you think that the host machine could detect the usage of SetWindowsHookEx by the RDP client machine?

Thanks!

moses-palmer commented 1 year ago

As I mentioned, I have no experience in administering or monitoring Windows machines, but the since the code, as I understand it, runs on your host, you should be able to detect it. Determining whether an instance of pynput is running on the clients is, I think, not possible.