Replies: 3 comments 6 replies
-
I found myself nodding along as I read this proposal - you've explained it well and I think I can see how it could be implemented. To support further discussion, especially around this feature's relative value, can you suggest a couple rules that might use this feature? and/or where you'd expect this to be useful? |
Beta Was this translation helpful? Give feedback.
-
In other threads, we've discussed the possibility of recognizing functions (usually by signature) and I presume the output of this would be the function's name. I wonder if this name information might also be used as a source to the location matcher (e.g. |
Beta Was this translation helpful? Give feedback.
-
implementing what other locations should be supported? |
Beta Was this translation helpful? Give feedback.
-
Description
An idea borrowed from some local yara rules.
Using location information within a capa rule could be used to restrict the scope (function/basic block) to a single location.
A pseudo-rule will explain better.
The following rule would be restricted to searching the
scope
(basic block) that exists at the entrypoint of the executable.Possible location candidates
A second example could resemble the following:
(This introduces an issue of having to match exported function names)
The logic could be more generic if the export name is not known
Which borrows (roughly) from the counting feature.
Implementation Considerations
Location data (for the locations I used in the above examples) all exist within the executable header. This is something that could be parsed via python and not a feature that has to be extracted by each engine.
This logic will break on shellcode, but that could be patched transparently so the rules will still work as intended.
Other
Another use case could be use/abuse of sideloaded DLL's. Where some DLL exported function does not match a known-good basic block or function signature.
This logic begins to drift closer to detection than sticking to Capa's core tenant of identifying binary capabilities. Slippery slope.
Drawbacks would be:
Beta Was this translation helpful? Give feedback.
All reactions