# File lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel.rb, line 51 def getpeername return super if not channel tmp,caddr,cport = channel.client.sock.getpeername maddr,mport = [ channel.params.peerhost, channel.params.peerport ] [ tmp, "#{maddr}", "#{mport}" ] end
# File lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel.rb, line 36 def getsockname return super if not channel # Find the first host in our chain (our address) hops = 0 csock = channel.client.sock while(csock.respond_to?('channel')) csock = csock.channel.client.sock hops += 1 end tmp,caddr,cport = csock.getsockname tmp,raddr,rport = csock.getpeername maddr,mport = [ channel.params.localhost, channel.params.localport ] [ tmp, "#{caddr}#{(hops > 0) ? "-_#{hops}_" : ""}-#{raddr}", "#{mport}" ] end
Generated with the Darkfish Rdoc Generator 2.