Skip to content

Conversation

zeze-zeze
Copy link

@zeze-zeze zeze-zeze commented Oct 13, 2025

Copy link

google-cla bot commented Oct 13, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@@ -0,0 +1,17 @@
rule:
meta:
name: log keystrokes via directx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have you named this "...via directx"? i don't see that mentioned for the msdn pages for these functions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confused GetRawInputData with DirectX, and I fixed by changing the file name.
The reference for GetRawInputData: http://www.rohitab.com/discuss/topic/35415-c-getrawinputdata-keylogger/
for DirectX: https://www.gironsec.com/blog/2017/07/keylogger-using-directx/

I will create another PR for DirectX one after this is merged.

@williballenthin
Copy link
Collaborator

thank you for the contribution @zeze-zeze!

@zeze-zeze zeze-zeze changed the title feat: log keystrokes via directx feat: log keystrokes via rawinput Oct 13, 2025
@zeze-zeze
Copy link
Author

zeze-zeze commented Oct 17, 2025

Does this differ to https://github.com/mandiant/capa-rules/blob/master/nursery/log-keystrokes-via-raw-input-data.yml#L18 and/or https://github.com/mandiant/capa-rules/blob/master/nursery/register-raw-input-devices.yml#L13?

I didn't check the one in nursery. This PR has the same target to log-keystrokes-via-raw-input-data.yml

And I should have pushed to nursery. First time contribute to this project.

@mike-hunhoff
Copy link
Collaborator

@zeze-zeze thank you for your contribution! Please verify that the existing rules highlighted by @mr-tz match your example 52d8e95c9883cd16d7b44e3a7adc22d6.exe_. If so, graduate the existing rules by updating each rule with your example file 52d8e95c9883cd16d7b44e3a7adc22d6.exe_ and moving them to the proper directories outside of nursery. Let us know if you have any questions 😄

@zeze-zeze
Copy link
Author

zeze-zeze commented Oct 20, 2025

log-keystrokes-via-raw-input-data.yml is more restrict, but it doesn't match my keylogger example 52d8e95c9883cd16d7b44e3a7adc22d6.exe_.

register-raw-input-devices matches the example, but it is less restrict than mine.

Which rule should I move from nursery 🤯

@mike-hunhoff
Copy link
Collaborator

mike-hunhoff commented Oct 20, 2025

log-keystrokes-via-raw-input-data.yml is more restrict, but it doesn't match my keylogger example 52d8e95c9883cd16d7b44e3a7adc22d6.exe_.

register-raw-input-devices matches the example, but it is less restrict to mine.

Which rule should I move from nursery 🤯

Do we need to make log-keystrokes-via-raw-input-data.yml less restrict?

Let's for sure move register-raw-input-devices out of the nursery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants