Module: Rex::Post::Meterpreter::Datagram::SocketInterface

Includes:
SocketAbstraction::SocketInterface
Defined in:
lib/rex/post/meterpreter/channels/datagram.rb

Instance Attribute Summary

Attributes included from SocketAbstraction::SocketInterface

#channel

Instance Method Summary collapse

Methods included from SocketAbstraction::SocketInterface

#close, #getpeername, #getsockname

Instance Method Details

#recvfrom_nonblock(length, flags = 0) ⇒ Object


36
37
38
39
40
# File 'lib/rex/post/meterpreter/channels/datagram.rb', line 36

def recvfrom_nonblock(length, flags = 0)
  data = super(length, flags)[0]
  sockaddr = super(length, flags)[0]
  [data, sockaddr]
end

#send(buf, flags, a = nil, b = nil) ⇒ Object

This should work just like a UDPSocket.send method

send(mesg, flags, host, port) => numbytes_sent click to toggle source send(mesg, flags, sockaddr_to) => numbytes_sent send(mesg, flags) => numbytes_sent


49
50
51
# File 'lib/rex/post/meterpreter/channels/datagram.rb', line 49

def send(buf, flags, a = nil, b = nil)
  channel.send(buf, flags, a, b)
end

#type?Boolean

Returns:

  • (Boolean)

32
33
34
# File 'lib/rex/post/meterpreter/channels/datagram.rb', line 32

def type?
  'udp'
end