Fixes #6308: Fall back to 127.0.0.1 when SocketError is raised from the resolver
This commit is contained in:
parent
eccd62717e
commit
65ed4bfa8b
|
@ -36,7 +36,12 @@ module Metasploit3
|
|||
|
||||
def generate
|
||||
port = (datastore['RPORT'] || '0').to_i
|
||||
host = Rex::Socket.resolv_nbo_i(datastore['RHOST'] || '127.0.0.1')
|
||||
host = nil
|
||||
begin
|
||||
host = Rex::Socket.resolv_nbo_i(datastore['RHOST'] || '127.0.0.1')
|
||||
rescue SocketError
|
||||
host = Rex::Socket.resolv_nbo_i('127.0.0.1')
|
||||
end
|
||||
|
||||
payload =
|
||||
"\x9c\x2b\xa0\x07\x94\x1a\xc0\x0b\x92\x10\x20\x01\x90\x10\x20\x02" +
|
||||
|
|
|
@ -36,7 +36,12 @@ module Metasploit3
|
|||
|
||||
def generate
|
||||
port = (datastore['LPORT'] || '0').to_i
|
||||
host = Rex::Socket.resolv_nbo_i(datastore['LHOST'] || '127.0.0.1')
|
||||
host = nil
|
||||
begin
|
||||
host = Rex::Socket.resolv_nbo_i(datastore['LHOST'] || '127.0.0.1')
|
||||
rescue SocketError
|
||||
host = Rex::Socket.resolv_nbo_i('127.0.0.1')
|
||||
end
|
||||
|
||||
payload =
|
||||
"\x9c\x2b\xa0\x07\x98\x10\x20\x01\x96\x1a\xc0\x0b\x94\x1a\xc0\x0b" +
|
||||
|
|
Loading…
Reference in New Issue