Files
metasploit-gs/lib/msf/core/exploit/tftp_server.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
538 B
Ruby
Raw Normal View History

# -*- coding: binary -*-
2010-05-26 22:39:56 +00:00
module Msf
###
#
# This mixin provides a TFTPServer
#
###
module Exploit::TFTPServer
def initialize(info = {})
super
2013-08-30 16:28:33 -05:00
2010-05-26 22:39:56 +00:00
@tftp = nil
end
2013-08-30 16:28:33 -05:00
2010-05-26 22:39:56 +00:00
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)")
2010-05-26 22:39:56 +00:00
@tftp.start
2010-08-14 04:58:27 +00:00
add_socket(@tftp.sock)
2010-05-26 22:39:56 +00:00
@tftp
end
2013-08-30 16:28:33 -05:00
2010-05-26 22:39:56 +00:00
def stop_service
vprint_status("Stopping TFTP server")
2010-05-26 22:39:56 +00:00
@tftp.stop
end
2013-08-30 16:28:33 -05:00
2010-05-26 22:39:56 +00:00
attr_accessor :tftp
end
end