Module: Msf::Exploit::TFTPServer

Included in:
CmdStagerTFTP
Defined in:
lib/msf/core/exploit/tftp.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


34
35
36
# File 'lib/msf/core/exploit/tftp.rb', line 34

def tftp
  @tftp
end

Instance Method Details

#initialize(info = {}) ⇒ Object


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

def initialize(info = {})
  super

  @tftp = nil
end

#start_service(tag, exe) ⇒ Object


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

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

#stop_serviceObject


29
30
31
32
# File 'lib/msf/core/exploit/tftp.rb', line 29

def stop_service
  print_status("Stopping TFTP server") if datastore['VERBOSE']
  @tftp.stop
end