Skip to content

Commit bcf0062

Browse files
committed
Make SocketInterface things be Rex::Sockets
1 parent 91417e6 commit bcf0062

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lib/rex/post/meterpreter/channels/socket_abstraction.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,8 @@ module Meterpreter
1818
###
1919
module SocketAbstraction
2020

21-
class << self
22-
def cls
23-
raise NotImplementedError
24-
end
25-
end
26-
2721
module SocketInterface
28-
def type?
29-
raise NotImplementedError
30-
end
22+
include Rex::Socket
3123

3224
def getsockname
3325
return super if not channel
@@ -46,9 +38,8 @@ def getsockname
4638

4739
def getpeername
4840
return super if not channel
49-
address_family,_caddr,_cport = channel.client.sock.getpeername_as_array
5041
maddr,mport = [ channel.params.peerhost, channel.params.peerport ]
51-
[ address_family, "#{maddr}", "#{mport}" ]
42+
::Socket.sockaddr_in(mport, maddr)
5243
end
5344

5445
%i{localhost localport peerhost peerport}.map do |meth|

0 commit comments

Comments
 (0)