Files
metasploit-gs/lib/msf/core/exploit/tftp.rb
T
James Lee f4498c3916 Remove $Id tags
Also adds binary coding magic comment to a few files
2013-05-20 16:21:03 -05:00

38 lines
582 B
Ruby

# -*- coding: binary -*-
require 'rex/proto/tftp'
module Msf
###
#
# This mixin provides a TFTPServer
#
###
module Exploit::TFTPServer
def initialize(info = {})
super
@tftp = nil
end
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
def stop_service
print_status("Stopping TFTP server") if datastore['VERBOSE']
@tftp.stop
end
attr_accessor :tftp
end
end