+ 7

(C#) GetAsyncKeyState - Causes AntiVirus to flag as keylogger

I'm trying to write a small program that reads a few keystrokes. I used GetAsyncKeyState from user32 to read the keys states. But I can't build and run my app because the antivirus flags the program ass keylogger. Of course I can disable it temporarily, but I need it to run on a PC with antivirus enabled. Do you guys have any idea what can I do to fix this issue? Thank you!

16th Oct 2017, 11:17 AM
Alex VĂźrlan
Alex VĂźrlan - avatar
5 Answers
+ 10
@luka was right. There's probably no other way to circumvent it unless you're going the hacker way as it's like asking how to avoid getting detected by peforming a malicious action. You can either whitelist it manually or sign the executable. I believe the user will understand it if you make it clear beforehand.
16th Oct 2017, 11:34 AM
Zephyr Koo
Zephyr Koo - avatar
+ 8
Wow glad you're taking the initiative to further explore! 👍 Yup you're heading the right direction and please update us if you can get it to work. 😉
16th Oct 2017, 12:26 PM
Zephyr Koo
Zephyr Koo - avatar
+ 6
Thank you for answering this fast. â˜ș Well, I can do this for me (building / debugging). But the app needs to run on other computers. And on most of then the antivirus is against it.
16th Oct 2017, 11:24 AM
Alex VĂźrlan
Alex VĂźrlan - avatar
+ 6
@Zephyr Koo - I get what are you saying. Also, the words "sign the executable" triggered my attention. :D So I googled a little bit and I'm reading about this two topics: https://en.wikipedia.org/wiki/Code_signing https://en.wikipedia.org/wiki/Portable_Executable Let me know if I'm on the right track. THANK you so much for the info!
16th Oct 2017, 11:59 AM
Alex VĂźrlan
Alex VĂźrlan - avatar