Remove superfluous method
Obsoleted by session.session_host, which does the same thingunstable
parent
47eb387886
commit
0707730fe0
|
@ -125,32 +125,5 @@ class Metasploit3 < Msf::Exploit::Local
|
|||
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the victim's *internal* IP address if it can
|
||||
#
|
||||
def detect_address
|
||||
tpeer = session.tunnel_peer.split(/:/)[0]
|
||||
ifaces = session.net.config.interfaces
|
||||
|
||||
ifaces.each do |iface|
|
||||
next if iface.ip == "127.0.0.1"
|
||||
# If these two match up, there's no NAT or anything getting in our
|
||||
# way, go ahead and just use it.
|
||||
return tpeer if iface.ip == tpeer
|
||||
end
|
||||
|
||||
# otherwise, we have to take a leap of faith and assume the first
|
||||
# address that isn't localhost is something the victim hosts will
|
||||
# be able to route to.
|
||||
address = ifaces.map{|i|i.addrs.first}.find { |a| a != "127.0.0.1" }
|
||||
if address.nil?
|
||||
# The session is giving us bogus interface data, something is
|
||||
# amiss. But since we can't really do anything about it, bail.
|
||||
raise RuntimeError.new "Couldn't determine an address to use for the share"
|
||||
end
|
||||
|
||||
address
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue