-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
MSFCONSOLE -X Multiple Instance Failure #4549
Comments
I bet you're hitting #4340. That needs to be resolved before fulling kicking out msfcli, and the sooner the better. Try this, drop a |
It seems that your recommendation fixed it. I can run multiple instances of the command below without experiencing the issues mentioned previously. Thanks! msfconsole -x "sleep 3;use auxiliary/scanner/snmp/snmp_login;set rhosts 127.0.0.1;run;exit -y;" |
Okay. I'm going to drop a temp fix in for -x that always drops a leading |
Hah, this is more complicated than expected. I'm trying to induce the behavior, and it's stubbornly avoiding it. I will get into periods where all the modules load fine, then not, then again, and I'm not seeing any obvious differences in framework.log after some instrumentation. It's very streaky and is starting to feel like a Baccarat game. |
For example, no changes between runs:
I'm going to wrap |
This is a weak attempt to solve a race condition between modules loading and cmd_use being fired. Upon startup, saved configurations, running resource scripts, and running commands will sometimes jump ahead of the module loading procedure. I have not discovered where the race actually is and how to cause the race to happen. However, the timing seems to be fairly close to a second; by waiting three seconds after trying use again, we seem to be in the clear, at least according to testing. Fixes rapid7#4549, but better solutions are welcome!
Hey @T-S-A I have a fix up that seems effective. Hopefully @wvu or @kernelsmith or someone will test and land, or see that the fix is kinda silly and complain about it. :) |
Thanks! |
Due to msfcli going away soon, I've started upgrading automation code to use msfconsole -x. This new method has a serious issue that needs to be overcome.
For example, if you run msfconsole -x "use auxiliary/scanner/snmp/snmp_login;set rhosts 127.0.0.1;run;exit -y;" by itself, the msfconsole loads and runs the module fine, but if you try to run that same command three times, causing multiple msfconsole instances to load at the same time, msfconsole will start throwing errors like, "[-] Failed to load module: auxiliary/scanner/snmp/snmp_login" and "[-] Unknown command: run."
With msfcli, I could run 10+ instances at the same time with no problems, but with msfconsole -x, trying to run a few instances at the same time causes serious issues which results in most of the instances failing.
Thanks!
The text was updated successfully, but these errors were encountered: