rapid7/metasploit-framework — pull request #2027 by g0tmi1k (2013-06-26 12:52:13+00:00)
Title: Added error handling to msfvenom when generating payloads

Added error handling to msfvenom when generating payloads

**Before**
root@kali ~/metasploit-framework$ ./msfvenom -p windows/meterpreter/reverse_tcp 1 ↵ master
/root/metasploit-framework/lib/msf/core/module.rb:620:in `validate': The following options failed to validate: LHOST. (Msf::OptionValidateError)
from /root/metasploit-framework/lib/msf/core/encoded_payload.rb:65:in `generate'
from /root/metasploit-framework/lib/msf/core/encoded_payload.rb:25:in `create'
from /root/metasploit-framework/lib/msf/base/simple/payload.rb:53:in `generate_simple'
from /root/metasploit-framework/lib/msf/base/simple/payload.rb:137:in `generate_simple'
from ./msfvenom:343:in `

'
root@kali ~/metasploit-framework$

**After**
root@kali ~/metasploit-framework$ ./msfvenom -p windows/meterpreter/reverse_tcp master
Error generating payload: The following options failed to validate: LHOST.
root@kali ~/metasploit-framework$