quasar / Quasar

Remote Administration Tool for Windows
MIT License
8.6k stars 2.44k forks source link

Keylogger miss some keys combination #243

Open DragonzMaster opened 9 years ago

DragonzMaster commented 9 years ago

If I Hold Control[Ctrl] Key and press 'a' for example it logged and while holding Ctrl i pressed another letter 'c' for example it is logged like : [Control + A] instead of : [Control + A] [Control + C]


the problem occurs also when i press Ctrl key and for example Up arrow and will holding Ctrl I pressed Down arrow it is logged like : [Control + Up] [Down] Instead of : [Control + Up] [Control + Down]

ghost commented 9 years ago

This is because of how the keys are processed. The keys are logged on a KeyUp event, so when you press Ctrl + A and you are still holding control key down, it will clear the keys when you let up on 'A', so Control won't be recorded the next time you press 'C' (Unless you let up off of control).

One way to fix this would be to record the keystates of modifier keys with GetKeyState/GetAsyncKeyState functions, when the keys are being cleared from the pressedkeys lists, and inject them back into the list if they are still down. (We would have to inject the key to avoid multiple keypresses from being logged, and to also ensure that special keys that use [ctrl + alt] modifiers, aren't logged if they have a unique character that doesn't represent a key)

ghost commented 9 years ago

Now that I think about it I'm not sure this would be easy to do, as far as logging keys accurately, given the logic already implemented.

yankejustin commented 9 years ago

@d3agle I've come to realize that keylogging is never easy! hahaha There are a few solutions I can think of. Maybe we should restrict the clearing of modifiers even more.

ghost commented 9 years ago

@yankejustin, Indeed. How can we restrict the modifiers even more? I've thought about some solutions but because we are handling the logging of keys in the KeyUp event, we might have to change the way we log the keys altogether.

bitterypaul commented 9 years ago

Does the keylogger catch all the keystrokes and combinations

yankejustin commented 9 years ago

@bitterypaul Not 100% sure if this is still an issue. @d3agle Is this issue still relevant?

ghost commented 9 years ago

@yankejustin, Yes it is, I took a look at the HotkeySet class and it looks like we might be able to control logging combinations of keys to accomplish this :D

ghost commented 9 years ago

I mean, it's not really an "issue" per say, however it's something that could be looked into a bit more. I'm not really sure how we would do this to be honest, but I may take a look at it a little later today.

@yankejustin, How is your registry editor coming along? :D

yankejustin commented 9 years ago

@d3agle Good. Currently about to implement the ability to add RegistryKeys to the ListView. After that works, I will transfer the logic over to the Client so it will finally retrieve RegistryKeys from the Client. :)

Edit: Implementing the logic into the Client. Adding the correct packets, classes, and logic for RegistryKey traversal. Going to submit a PR later today containing my progress (mostly done but needs more GUI work for the server)... Perhaps @MaxXor can make a branch for the RegistryEditor so I can put the work there. :)

MaxXor commented 9 years ago

@yankejustin I've created one, named regedit. But please keep discussion about Registry Editor in it's own issue.