-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
RFC: establish a separate module category for persistence modules #19592
Comments
agree with this. |
I think |
Any comments from an R7 person about this? I love the idea, it always felt a little clunky having them mixed in with other modules. This should be pretty easy for someone to accomplish, from a base thought its just a bunch of I like |
I also like
I think a new class would be necessary to handle new top-level directories within the |
I think I like the idea of restructuring modules in directories for organization vs creating a new module type altogether. We still occasionally find features that are missing or inconsistent between module types now (e.g. evasion) and creating yet another would contribute to the problem. I also think that long term, we'd be better off moving in the opposite direction and consolidating module classes and types in some case. Post, Auxiliary and Exploits sometimes get blurred now and it'd be nice if all three could for example have a check method, actions, and open sessions. So to fix the problem of organizsation, I think moving them to a directory structure such as |
I like not making a separate module type, it's a huge pain tbh. I like organizationally putting these in their own root folder under modules as previously discussed. It helps set appropriate expectations as outlined by @bcoles (no new privs, shell at a potentially unpredictable future time, new shells are used). I'll likely close the current PR and start a new one since there are a lot of commits and files that are no longer relevant in it |
While I prefer the
I think this path is going to be a fools errand. These small overrides make the code ugly and harder to follow and much more patchwork than it is already. I doubt I've finished following the rabbit hole. Unfortunately I think @smcintyre-r7 's sage hint that this was not the way to go is right. I don't like Unless someone else wants to take the lead on this, I'll pivot to that route. |
Summary
We have a lot of modules to establish persistence (and will likely gain more: #16791 #19359 #19698).
Although the modules are consistently named
*_persistence*
, the categorization is inconsistent - sometimes aspost/<platform>/manage/
, but usually within theexploit/<platform>/local/
directory.Almost all of these modules establish persistence by creating a new session at an unknown time in the future. These are not exploits - they are post-exploitation modules more akin to management post modules.
Persistence modules were previously classified as local
exploit
modules as traditionally any module which could result in a newsession
was considered to be an "exploit" module; however, this old practice has been repeatedly undermined and the definition is no longer useful. For example:exploit/<platform>/file/
modules) and return a sessionmodules/post/multi/manage/shell_to_meterpreter.rb
returns a sessionmodules/post/windows/manage/persistence_exe.rb
returns a session (There is an open issue to convert this module to an exploit module Migrate post/windows/manage /persistence_exe to an Exploit #18053)Is it useful to separate persistence modules into a separate category/subdirectory?
Basic example
modules/post/<platform>/persistence/
?modules/exploits/<platform>/persistence/
?modules/persistence/<platform>/
? (with a newMsf::Persistence
class?)Motivation
Although there is no real harm in leaving persistence modules in the
local
exploit category, the typical use case for persistence modules is sufficiently different to exploit modules that a separate category may be desirable to eliminate ambiguity.Once segregated,
exploit/<platform>/local
exploits will be local exploits only:Additionally, as most exploit modules within Framework return a session immediately, where as persistence modules return zero or more sessions at an unknown time in the future, segregation may be beneficial to facilitate intuitive handler workflows. For example, persistence modules could be configured with default module options to launch backgrounded long-running session handlers.
The text was updated successfully, but these errors were encountered: