Skip to content

Conversation

h00die
Copy link
Contributor

@h00die h00die commented Sep 23, 2025

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

  • Start msfconsole
  • get a shell/meterp on a box
  • post/multi/recon/persistence_suggester
  • set session #
  • run
  • Verify persistence mechanisms are suggested
  • Document looks good

@h00die h00die added the module label Sep 23, 2025
@msutovsky-r7 msutovsky-r7 self-assigned this Sep 24, 2025
Comment on lines +136 to +138
# 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
Copy link
Contributor

@adfoster-r7 adfoster-r7 Sep 25, 2025

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

Copy link
Contributor Author

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

Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor

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 🕵️

Copy link
Contributor Author

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.

@msutovsky-r7 msutovsky-r7 added docs rn-modules release notes for new or majorly enhanced modules labels Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs module rn-modules release notes for new or majorly enhanced modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants