Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for clipboard rules #293

Closed
mwilliams31 opened this issue Mar 10, 2021 · 0 comments · Fixed by #763
Closed

Improvements for clipboard rules #293

mwilliams31 opened this issue Mar 10, 2021 · 0 comments · Fixed by #763

Comments

@mwilliams31
Copy link
Collaborator

I ran into a FP for read-clipboard-data that sparked some ideas for improvement. The FP was in a sample that contained a bunch of API calls whose results weren't used. I don't have time to write/test new rules so I'm documenting my research efforts here in case someone wants to run with it.

Here's some documentation that could be inserted as references for multiple rules:

In the documentation you'll notice the following APIs are frequently used:

kernel32.GlobalAlloc
kernel32.GlobalLock
kernel32.GlobalUnlock

These could be incorporated as optional features for some clipboard rules. They are present in the existing rules' examples. If they show up often enough, maybe they get moved from optional to required to reduce FPs.

Another thought involved targeting specific data formats for the GetClipboardData rule. Malware commonly targets text:

0x1 = CF_TEXT
0xD = CF_UNICODETEXT

Both formats are represented in the existing rule examples. Using these formats, the rule could become a basic block component of a larger function rule. The new rule could also incorporate the loop characteristic to target the read operation.

Lastly, we might consider consolidating the replace-clipboard-data and write-clipboard-data rules. The replace rule includes user32.EmptyClipboard but I wonder if user32.SetClipboardData would overwrite data existing data that wasn't emptied. The EmptyClipboard API could be optional in the write-clipboard-data rule.

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 a pull request may close this issue.

1 participant