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
Enable using modules when deferred loading is turned on #18171
Enable using modules when deferred loading is turned on #18171
Conversation
def num_payload_stages | ||
framework.payloads.stages.length | ||
end | ||
|
||
# | ||
# Returns the number of stagers in the framework. | ||
# | ||
def num_payload_stagers | ||
framework.payloads.stagers.length | ||
end | ||
|
||
# | ||
# Returns the number of singles in the framework. | ||
# |
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 removed these as they weren't being referenced anywhere and when I checked the values they had on master they were incorrect anyway
d4fcf77
to
82a5624
Compare
82a5624
to
6b67ecd
Compare
6b67ecd
to
ef87168
Compare
Release NotesThis fixes an issue when users use a payload when framework is started with the |
Resolves #18198
Following on from #17901 which allowed for lazy loading of payloads, this PR will now allow users to
use
a payload when framework is started with the--defer-module-loads
flag is set, previously this just wouldn't work at all giving this errorThis also adds a new feature flag option
defer_module_loads
which when enabled will defer module loads by default without need to specify the--defer-module-loads
every time you boot frameworkThis also comes with a sizeable improvement on frameworks boot up time
Before:
hyperfine --export-json /dev/stdout --warmup 3 "bundle exec ruby ./msfconsole --no-defer-module-loads -qx 'exit'"
After:
hyperfine --export-json /dev/stdout --warmup 3 "bundle exec ruby ./msfconsole --defer-module-loads -qx 'exit'"
from ~9s to ~3.5s on my machine
Known Issues
use
an exploit can be increased if no payload is configured see exampleshow payloads
takes noticeably longer on some modules, especiallyexploit/multi/handler
as all payloads are compatible with itNote that the increased delay only occurs the first time and this was the worst case scenario
Verification Steps
msfconsole
payload/windows/x64/meterpreter/reverse_tcp
)payload/windows/x64/meterpreter_reverse_tcp
)payload/cmd/windows/http/x64/meterpreter/reverse_tcp
)use exploit/multi/handler
and thenshow payloads
this will force all payloads to be createdmsfvenom
also worksloadpath test/modules
or any other path with modules, check all modules are available and working as intended~/.msf4/modules/
work as expectedtime unknown_command
and check it's roughy in line with master[+] Command "unknown_command" completed in 0.006908999988809228 seconds
was my result on master your mileage may vary