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

feat: memory module #1991

Closed
wants to merge 4 commits into from
Closed

feat: memory module #1991

wants to merge 4 commits into from

Conversation

secDre4mer
Copy link
Contributor

A small YARA module (inspired by https://twitter.com/NinjaParanoid/status/1712743509961380325) that allows rules to query memory protection for live process memory. This allows writing conditions like for any i in (1..#a) : ( memory.Protection(@a[i]) & memory.EXECUTE == memory.EXECUTE) for strings that should only match on executable memory.

OpenBSD (in tests) returned vm_entries with kve_start == kve_end.
This caused the assertion in get_next_memory_block to trigger.
To handle this scenario cleanly, loop until we get a non-empty
block.
@secDre4mer secDre4mer marked this pull request as ready for review October 18, 2023 15:14
@klabksec
Copy link

in addition to mem RWX permissions and region size and all, it would be useful to describe/access characteristics of the current process - dll(s) loaded and their associated file path, any particular port listening or named pipes, number of threads, etc

@plusvic
Copy link
Member

plusvic commented Nov 15, 2023

I see the utility of this new module, but I'm worried about its maintenance and testability. One of the problem with process memory scanning in general is that it's poorly tested, and this adds up to the already existing problem. Testing process scanning is hard, I never put too much effort on that, and I regret it. But at this point I don't want to make this issue bigger than it is.

Also, I prefer not adding new modules to YARA in general, given that YARA-X is probably the future.

@plusvic plusvic closed this May 21, 2024
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.

3 participants