moses-palmer / pynput

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

[Question] Does antivurs detect pynput python script as a malware? #539

Open mai1x9 opened 1 year ago

mai1x9 commented 1 year ago

Does av detect python code converted to executable using pynput as suspicious file and block it?

Yarn commented 1 year ago

using pyinstaller, at least some of the time yes with windows defender

moses-palmer commented 1 year ago

@Yarn, thank you for your clarification. Do you have any more information? Did you use any listeners, or did just dynamically linking against the relevant win32 API functions cause the warning?

I will update the FAQ with the information provided.

mai1x9 commented 1 year ago

@Yarn sorry I missed your message.

using pyinstaller, at least some of the time yes with windows defender

Not really, cause pyinstaller exe without pynput library I could see some of the av have flagged it as malware. Look like pyinstaller extracts the data at runtime in TEMP directory and executes from TEMP dir where some of the av detect as malware.

However, considering cz freeze we do not get flagged by av.

@moses-palmer coming back to pynput discussion, I have seen that pynput uses hooking and looking at source code it does indeed uses SetWindowsHookEx call and I could see some of av flag the software as malicious when SetWindowsHookEx is used.

Are there any alternative methods?

thomaslc66 commented 1 year ago

Try with this one just, think it's a bit better.

https://github.com/Nuitka/Nuitka

moses-palmer commented 1 year ago

@mai1x9, as far as I know, SetWindowHookEx is the least intrusive alternative, and the one most reasonably usable from Python.

mai1x9 commented 1 year ago

@mai1x9, as far as I know, SetWindowHookEx is the least intrusive alternative, and the one most reasonably usable from Python.

if possible would be great if any supporting reference where it mentioned least intrusive alternative would be nice.

ash2703 commented 5 months ago

+1 on this

When keyboard.Listener is added, the code is treated as malware and automatically deleted in my MAC