-
Notifications
You must be signed in to change notification settings - Fork 14.6k
persistence suggester #20564
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
base: master
Are you sure you want to change the base?
persistence suggester #20564
Conversation
# Name Potentially Vulnerable? Check Result | ||
- ---- ----------------------- ------------ | ||
1 exploit/linux/persistence/bash_profile Yes The service is running, but could not be validated. Bash profile exists and is writable: /home/ubuntu/.bashrc |
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.
What are your thoughts on enhancing the vulnerable column to treat the check codes a bit differently (we can update the exploit suggester later too if that makes sense as well)
Msf::Exploit::CheckCode::Vulnerable => Verified
Msf::Exploit::CheckCode::Appears => Yes
Msf::Exploit::CheckCode::Detected => Yes
others => No
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 don't believe any persistence module actually returns Vulnerable
, they should all be Appears
, Detected
, and Safe
. Since most of them rely on an event (user click, service restart, box restart, etc I think its unlikely that a module would actually exploit it to prove Vulnerable
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 think there are some Windows persistence modules, which do return Vulnerable
- e.g. registry_persistence.rb
. In any case, maybe the acceptable modules should be sorted according to their check codes? Maybe something like Vulnerable > Appears > Detected
?
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.
windows persistence is a nightmare at the moment. I tried to unclutter it and gave up, @dledda-r7 also tried, and its just a jumbled mess of bleh. several modules overlap, there aren't clear boundaries etc.
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.
regardless, i mean that sounds fine
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 think we should table this change and make it across all *_suggester modules at once. Currently we're keeping consistent behavior which is good for users, and we'd want to be consistent (regardless of shared code) across the modules.
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 don't believe any persistence module actually returns
Vulnerable
, they should all beAppears
,Detected
, andSafe
. Since most of them rely on an event (user click, service restart, box restart, etc I think its unlikely that a module would actually exploit it to proveVulnerable
That exactly the issue I raised during our internal call that created this comment from @adfoster-r7, I believe having a check that separates Vulnerable and Appears / Detected however could bring some benefit.
Besides that, regarding Windows, I think the next steps should include the creation of GitHub issues per-module whenever we find that they either doesn't work (at all or as expected) and if two modules overlap functionalities.
Then we can decide either to drop them (if not fixable) or to fix them or merge them/remove duplicated code.
I wouldn't wait for the windows modules to be all sorted before landing this exploit suggester PR honestly as it probably will require some internal workload from R7 side and I am not too sure we have current rounds to work on it.
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.
Would it be worth while consolidating any code between the persistence suggester and local exploit suggester? Just worried about future folk fixing bugs in one but not the other 🕵️
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.
agreed, @bwatters-r7 at one point said consolidate to a lib once there are 3 instances, so I've used that as my metric.
Part of #20374
Creates a persistence suggester, similar to local exploit suggester, which suggests which persistence mechanisms to use. It only works on persistence which has been updated to use the mixin, so testing on osx/windows right now won't yield many results, but linux is pretty good :)
Verification
msfconsole
post/multi/recon/persistence_suggester
set session #
run