Class: Rex::Post::Meterpreter::Extensions::Lanattacks::Tftp::Tftp

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/post/meterpreter/extensions/lanattacks/tftp/tftp.rb

Overview

TFTP Server functionality

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Tftp

Returns a new instance of Tftp.



19
20
21
# File 'lib/rex/post/meterpreter/extensions/lanattacks/tftp/tftp.rb', line 19

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



46
47
48
# File 'lib/rex/post/meterpreter/extensions/lanattacks/tftp/tftp.rb', line 46

def client
  @client
end

Instance Method Details

#add_file(filename, data) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/rex/post/meterpreter/extensions/lanattacks/tftp/tftp.rb', line 33

def add_file(filename, data)
  request = Packet.create_request(COMMAND_ID_LANATTACKS_ADD_TFTP_FILE)
  request.add_tlv(TLV_TYPE_LANATTACKS_OPTION_NAME, filename)
  request.add_tlv(TLV_TYPE_LANATTACKS_RAW, data, false, true) #compress it
  client.send_request(request)
  true
end

#resetObject



28
29
30
31
# File 'lib/rex/post/meterpreter/extensions/lanattacks/tftp/tftp.rb', line 28

def reset
  client.send_request(Packet.create_request(COMMAND_ID_LANATTACKS_RESET_TFTP))
  true
end

#startObject



23
24
25
26
# File 'lib/rex/post/meterpreter/extensions/lanattacks/tftp/tftp.rb', line 23

def start
  client.send_request(Packet.create_request(COMMAND_ID_LANATTACKS_START_TFTP))
  true
end

#stopObject



41
42
43
44
# File 'lib/rex/post/meterpreter/extensions/lanattacks/tftp/tftp.rb', line 41

def stop
  client.send_request(Packet.create_request(COMMAND_ID_LANATTACKS_STOP_TFTP))
  true
end