Module: Msf::Exploit::TFTPServer

Defined in:
lib/msf/core/exploit/tftp_server.rb

Overview

This mixin provides a TFTPServer

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tftpObject

Returns the value of attribute tftp


33
34
35
# File 'lib/msf/core/exploit/tftp_server.rb', line 33

def tftp
  @tftp
end

Instance Method Details

#initialize(info = {}) ⇒ Object


13
14
15
16
17
# File 'lib/msf/core/exploit/tftp_server.rb', line 13

def initialize(info = {})
  super

  @tftp = nil
end

#start_service(tag, exe) ⇒ Object


19
20
21
22
23
24
25
26
# File 'lib/msf/core/exploit/tftp_server.rb', line 19

def start_service(tag, exe)
  @tftp = Rex::Proto::TFTP::Server.new
  @tftp.register_file(tag, exe)
  vprint_status("Starting TFTP server to host \"#{tag}\" (#{exe.length} bytes)")
  @tftp.start
  add_socket(@tftp.sock)
  @tftp
end

#stop_serviceObject


28
29
30
31
# File 'lib/msf/core/exploit/tftp_server.rb', line 28

def stop_service
  vprint_status("Stopping TFTP server")
  @tftp.stop
end