How'd you do it?
meterpreter > run post/windows/manage/migrate
[-] Error in script: ArgumentError wrong number of arguments (1 for 0)
meterpreter > run post/windows/gather/credentials/credential_collector
[-] Error in script: ArgumentError wrong number of arguments (1 for 0)
*_~/.msf4/logs/framework.log *_
/opt/metasploit-framework/bin/../embedded/framework/msfconsole:48:in `<main>'
[04/23/2016 09:05:51] [d(0)] core: Reloading module windows/manage/migrate...
[04/23/2016 09:05:51] [w(0)] core: The module windows/manage/migrate is ambiguous with windows/manage/migrate.
[04/23/2016 09:05:51] [e(0)] core: Error in script: ArgumentError wrong number of arguments (1 for 0)
[04/23/2016 09:05:51] [d(0)] core: Callstack: /opt/metasploit-framework/embedded/framework/modules/payloads/singles/cmd/mainframe/reverse_shell_jcl.rb:247:in `to_s'
root:~]# uname -a
Linux kali 4.4.0-kali1-686 #1 SMP Debian 4.4.6-1kali1 (2016-03-18) i686 GNU/Linux
msf exploit(ms08_067_netapi) > version
Framework: 4.11.22-dev-98f89ca23a67811457a9292023c930dfc6c28558
Console : 4.11.22-dev-98f89ca23a67811457a9292023c930dfc6c28558
Kali - Rolling
For some reason you are getting errors running the mainframe reverse_shell_jcl.rb payload. It's funny that this runs as a side-effect when you run a script, put I see what to fix now. Thanks!
Thanks Mate,
From the logs it appears all my issues are from this "reverse_shell_jcl.rb" file.
Also running things like "run getgui" will also produce these issues.
I also have these issues while using a completely different exploit (windows/http/oracle9i_xdb_pass) with a Meterpreter Reverse TCP Payload.
/23/2016 09:31:31] [d(0)] core: Reloading module windows/manage/migrate...
[04/23/2016 09:31:31] [w(0)] core: The module windows/manage/migrate is ambiguous with windows/manage/migrate.
[04/23/2016 09:31:32] [e(0)] core: Error in script: ArgumentError wrong number of arguments (1 for 0)
[04/23/2016 09:31:32] [d(0)] core: Callstack: /opt/metasploit-framework/embedded/framework/modules/payloads/singles/cmd/mainframe/reverse_shell_jcl.rb:247:into_s'
/opt/metasploit-framework/embedded/framework/modules/payloads/singles/cmd/mainframe/reverse_shell_jcl.rb:247:in replace_var'
Any ETA on a fix? I am currently completing my OSCP and use these , well daily :(
Appreciate all the hard work and effort.
Thanks,
Testing the fix out now.
Ah your a legend! Thank you heaps! bug fix in under 3 hours, who can complain! :+1:
Please let me know if you would like me to test anything on my end. I can make the modifications manually if necessary.
Thanks again!
A quick workaround without any code changes is to ensure you 'set LPORT 443' or similar _after_ having set a payload, not before. We have code that assumes LPORT is always an integer, and a quirk in the datastore prevents the type info from working until the first module has declared it. IOW, this will work from a fresh msfconsole instance:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LPORT 443
This will fail:
use exploit/multi/handler
set LPORT 443
set payload windows/meterpreter/reverse_tcp
Thank you very much for the workaround - It explains a lot actually. I was using a msfconsole.rc file which was automatically setting the LPORT, so as I opened msfconsole it was entered automatically and thus putting this bug into play from the beginning prior to me even entering any commands.
I guess this is a good habit/process to form anyways. Set payload, then set options.
I have confirmed this workaround, is working.
Thank you again for the hard work.
Kind Regards,

Don't fix mine :/
It would be helpful to include which version you are using to ensure yours has the patch applied. I believe, and don't quote me, only the git clone version has the patch at this point, as a release including this hasn't happened yet
Yeah, I fixed some errors.(While I writing "run persistence" meterpreter give "script doesn't found.". I fixed from "sciptable.rb" for some little wrong word.) But I have such an error :/
If I'll remove metasploit-framework and after if I'll install from github then is it fix? Does anyone knows?
Scripts are deprecated, run the local module
wow :0
How can I run local module "persistence"?
This isn't a support forum, it's for reporting bugs. Ask in IRC, search the web, or browse the local windows modules
Agh, let me push what I have.
:) @wvu-r7. OK. Is the bug solved?
@ulusher: It will be soon.
@wvu-r7 Well. Is there such a problem in Pro version?
See #7887.
It's definitely time we put a proper nail in the coffin of those scripts. Is the run command used for anything other that Meterp scripts inside of Meterp? If not, perhaps we should put a warning in there saying "What you're doing isn't supported"?
Yea, i'm thinking something like #7887 https://github.com/wvu-r7/metasploit-framework/blob/b44e7ff73344c00bcb20a705f6ddb9a55fd80e78/lib/msf/base/sessions/scriptable.rb#L107 will do quite nicely