[GH-ISSUE #243] Keylogger miss some keys combination #111

Open
opened 2026-02-27 15:48:52 +03:00 by kerem · 10 comments
Owner

Originally created by @DragonzMaster on GitHub (May 30, 2015).
Original GitHub issue: https://github.com/quasar/Quasar/issues/243

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]

Originally created by @DragonzMaster on GitHub (May 30, 2015). Original GitHub issue: https://github.com/quasar/Quasar/issues/243 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]
Author
Owner

@ghost commented on GitHub (May 30, 2015):

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)

<!-- gh-comment-id:107030904 --> @ghost commented on GitHub (May 30, 2015): 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)
Author
Owner

@ghost commented on GitHub (May 30, 2015):

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.

<!-- gh-comment-id:107042476 --> @ghost commented on GitHub (May 30, 2015): 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.
Author
Owner

@yankejustin commented on GitHub (May 30, 2015):

@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.

<!-- gh-comment-id:107048767 --> @yankejustin commented on GitHub (May 30, 2015): @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.
Author
Owner

@ghost commented on GitHub (May 31, 2015):

@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.

<!-- gh-comment-id:107203213 --> @ghost commented on GitHub (May 31, 2015): @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.
Author
Owner

@bitterypaul commented on GitHub (Jul 31, 2015):

Does the keylogger catch all the keystrokes and combinations

<!-- gh-comment-id:126710006 --> @bitterypaul commented on GitHub (Jul 31, 2015): Does the keylogger catch all the keystrokes and combinations
Author
Owner

@yankejustin commented on GitHub (Jul 31, 2015):

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

<!-- gh-comment-id:126736096 --> @yankejustin commented on GitHub (Jul 31, 2015): @bitterypaul Not 100% sure if this is still an issue. @d3agle Is this issue still relevant?
Author
Owner

@ghost commented on GitHub (Jul 31, 2015):

@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

<!-- gh-comment-id:126752132 --> @ghost commented on GitHub (Jul 31, 2015): @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
Author
Owner

@ghost commented on GitHub (Aug 3, 2015):

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

<!-- gh-comment-id:127273044 --> @ghost commented on GitHub (Aug 3, 2015): 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
Author
Owner

@yankejustin commented on GitHub (Aug 3, 2015):

@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. :)

<!-- gh-comment-id:127314345 --> @yankejustin commented on GitHub (Aug 3, 2015): @d3agle Good. Currently about to implement the ability to add <code>RegistryKeys</code> to the <code>ListView</code>. After that works, I will transfer the logic over to the Client so it will finally retrieve <code>RegistryKeys</code> from the Client. :) <b><i>Edit</i></b>: 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. :)
Author
Owner

@MaxXor commented on GitHub (Aug 3, 2015):

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

<!-- gh-comment-id:127404889 --> @MaxXor commented on GitHub (Aug 3, 2015): @yankejustin I've created one, named `regedit`. But please keep discussion about Registry Editor in it's own issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Quasar#111
No description provided.