You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, not sure if thats good enough as a standalone plugin, but I tried to re-implement apihooks. however, since there a lot of "hooks" in legitimate dlls I couldn't get it to output less false positives, ofc I am open to ideas.
also, some hooks are not relevant anymore e.g KiFastSystemCall.
even the current implementation of check_inline_hooks throw false positives, anyways that was a fun experience :D
I have left some of the pseudo-code commented for now, if you think it can be improved or removed totally.
Also I have 2 questions:
I have read a paper of @atcuno about hooktracer but couldn't find code online.
second question is something I also tried asking on your slack, maybe I misunderstand something but worth a try: From my understanding, unhooked_system_calls plugin will enumerate all of the processes to find differences, if every process is hooked it will not be flagged as malware. a follow-up to this, a DLL is loaded to a shared memory and if it's patched the OS creates a private copy for the process, so cant we compare the hooks against the known shared read-only memory for the DLL? if not why?
I tried running it on fresh windows 10 machine now and the false positives is very high, however they can quickly be examined and succumb to less with few statistics with something like splunk/custom python.
e.g in this file: inlinehooks.json
it can be seen about 95% of the hooks come from 2 module related to crypto. in other high priority functions such ntdll.dll!LdrLoadDll the Disasm field is the same between all hooks, which can also indicate something that is non-malicious. but yeah thats far from being fullproof, although the code can be reused in other plugins (e.g avpatch). also - the json dataset can be used to compare the hooks to another trusted memory image of the same machine golden image.
SolitudePy
changed the title
inlinehooks plugin
inlinehooks plugin & change to avpatch
Jun 7, 2025
@ikelos hey, this is a windows plugin. also as I said in my first message by itself its not really complete due to high volume of false positives (still can be used as a helper though).
Oh, sorry I saw it was waiting on @atcuno and figured it must be a linux program. Sorry, trying to clear down outstanding issues as quickly as I can. If this isn't ready for prime-time we can mark it as a draft? That way it'll be visible here, for people to try out, and if there's more work that can reduce the false positive rate, it can get turned back into a full PR... 5:)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, not sure if thats good enough as a standalone plugin, but I tried to re-implement apihooks. however, since there a lot of "hooks" in legitimate dlls I couldn't get it to output less false positives, ofc I am open to ideas.
also, some hooks are not relevant anymore e.g KiFastSystemCall.
even the current implementation of check_inline_hooks throw false positives, anyways that was a fun experience :D
I have left some of the pseudo-code commented for now, if you think it can be improved or removed totally.
Also I have 2 questions:
I have read a paper of @atcuno about hooktracer but couldn't find code online.
second question is something I also tried asking on your slack, maybe I misunderstand something but worth a try:
From my understanding, unhooked_system_calls plugin will enumerate all of the processes to find differences, if every process is hooked it will not be flagged as malware. a follow-up to this, a DLL is loaded to a shared memory and if it's patched the OS creates a private copy for the process, so cant we compare the hooks against the known shared read-only memory for the DLL? if not why?Anyways, about the plugin: