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

improve rules that often match #655

Merged
merged 5 commits into from
Jan 9, 2023
Merged

improve rules that often match #655

merged 5 commits into from
Jan 9, 2023

Conversation

mr-tz
Copy link
Collaborator

@mr-tz mr-tz commented Jan 6, 2023

I've analyzed the top 50 or so rule matches over 5000 recent random samples.
In these rules I noticed room for improvement. Happy to discuss as needed.

@@ -28,4 +28,3 @@ rule:
- api: LdrFindResourceEx_U
- api: kernel32.SizeofResource
- api: kernel32.FreeResource
- api: user32.LoadString
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think that's really what we are after normally. Anyone thing it's worth creating a new rule for it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

agree that this should be removed

@@ -1,17 +0,0 @@
rule:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ref: #143, I've only seen this hit in library code (which Python flirt often doesn't recognize)

@@ -1,10 +1,10 @@
rule:
meta:
name: create or open registry key
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

analogous to create or open file, we have a lot more specific rules that use this (now library) rule, e.g. set registry value or delete registry value

Comment on lines 18 to 19
- number: 0x800000FF
- number: 0xFF
- operand[1].number: 0x800000FF
- operand[1].number: 0xFF
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you explain this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

trying to be more explicit here, but yeah, there can only be an immediate in the second operand, so I guess this is not useful here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

any preference? be explicit here or undo change and stick to number?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think just plain old number is probably sufficient. i dont feel strongly, though.

@mr-tz mr-tz merged commit b48fcd5 into master Jan 9, 2023
@mr-tz mr-tz deleted the 2023-01-rules-improvements branch January 9, 2023 13:07
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.

2 participants