-
Notifications
You must be signed in to change notification settings - Fork 463
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
Linux: add member presence checks to linux.checks_afinfo #1038
Linux: add member presence checks to linux.checks_afinfo #1038
Conversation
…o function to stop crashes when none of the required members are present
Hello, do you think redirecting users to https://github.com/AsafEitani/rootkit_plugins/blob/main/plugins/check_seqops.py, or directly merging both plugins would be a solution ? They work toward the same goal in the end :) Regards |
@Abyss-W4tcher - I'd imagine that's certainly a possibility if @AsafEitani wanted to make a PR. My understanding is that @atcuno is looking into the way that this issue should be fixed fundamentally, and it might well be by updating it to do similar things to that seqops plugin. I'm not sure that a framework plugin would every redirect users to a community plugin, but I'd let the core devs make that call. Maybe you and I could help more on the community support side of things and point people to these other resources when it pops up (exactly like you did in the issue comments for #832) 🦊 just a random internet vol user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me, just wondering how useful the debugging message is, given it traverse the loop twice every single item its called on, seemingly with not a great value?
yield var_name, hooked_member, hook_address | ||
# check if object has a least one of the members used for analysis by this function | ||
required_members = ["seq_fops", "seq_ops", "seq_show"] | ||
for member in required_members: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I know it's not a big deal, but this is traversing all the elements do output the debug information, and then does it again (effectively) as part of the any operator. The debug information will probably only be checked if they're all false, so it might not be useful at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree with you. Not the best.
I wanted to have some difference between "The plugin run and there was no output, because there was nothing hooked" and "The plugin run and there was no output, because the kernel version isn't supported".
The later might lead to a false sense of security. I'll work up a better way to show that difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tweaked this now, but might be abusing the PluginRequirementException
- let me know what you think.
…arning is shown and debug logs are cleaner
Hello @ikelos I've tweaked the logic for debug and warning messages. This removes the loops through the same parts twice, and also means that if every check with I may be abusing the I'm just keen to show the difference between "no results, all is fine" and "no results, because the plugin couldn't check". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, looks good, thanks! Much happier about the logging and checks.. 5:)
As to the |
Hello!
Issue #832 is tracking the fact that newer kernels (from around 2018) won't have the required members for the hooking checks to be performed in this way.
This PR adds some checks around the members of the objects in the
_check_afinfo
function so that a more informative warning is displayed rather than simply crashing. Does this seem like a good idea?