Tab complete non-loopback interfaces' addresses
parent
f5947e8ef5
commit
65c00dffac
|
@ -806,7 +806,7 @@ class Core
|
|||
end
|
||||
|
||||
# This is not respecting the Protected access control, but this seems to be the only way
|
||||
# to rename a job. If you know a more appropriate way, patches accepted.
|
||||
# to rename a job. If you know a more appropriate way, patches accepted.
|
||||
framework.jobs[job_id].send(:name=, job_name)
|
||||
print_status("Job #{job_id} updated")
|
||||
|
||||
|
@ -2973,11 +2973,18 @@ class Core
|
|||
res << addr
|
||||
end
|
||||
when 'LHOST'
|
||||
rh = self.active_module.datastore["RHOST"]
|
||||
rh = self.active_module.datastore['RHOST'] || framework.datastore['RHOST']
|
||||
if rh and not rh.empty?
|
||||
res << Rex::Socket.source_address(rh)
|
||||
else
|
||||
res << Rex::Socket.source_address()
|
||||
res << Rex::Socket.source_address
|
||||
# getifaddrs was introduced in 2.1.2
|
||||
if Socket.respond_to?(:getifaddrs)
|
||||
ifaddrs = Socket.getifaddrs.find_all { |ifaddr|
|
||||
((ifaddr.flags & Socket::IFF_LOOPBACK) == 0) && ifaddr.addr.ip?
|
||||
}
|
||||
res += ifaddrs.map { |ifaddr| ifaddr.addr.ip_address }
|
||||
end
|
||||
end
|
||||
else
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue