From 0707730fe05120a21419683b33f965538c9edfcd Mon Sep 17 00:00:00 2001 From: James Lee Date: Wed, 1 Aug 2012 01:07:21 -0600 Subject: [PATCH] Remove superfluous method Obsoleted by session.session_host, which does the same thing --- .../windows/local/current_user_psexec.rb | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/modules/exploits/windows/local/current_user_psexec.rb b/modules/exploits/windows/local/current_user_psexec.rb index 99c593f9c3..0839eb3db8 100644 --- a/modules/exploits/windows/local/current_user_psexec.rb +++ b/modules/exploits/windows/local/current_user_psexec.rb @@ -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