diff --git a/modules/auxiliary/dos/http/apache_mod_isapi.rb b/modules/auxiliary/dos/http/apache_mod_isapi.rb index a5a0504938..11b9d72e43 100644 --- a/modules/auxiliary/dos/http/apache_mod_isapi.rb +++ b/modules/auxiliary/dos/http/apache_mod_isapi.rb @@ -66,8 +66,8 @@ class Metasploit3 < Msf::Auxiliary def run serverIP = datastore['RHOST'] - if (datastore['RPORT'] != 80) - serverIP += ":" + datastore['RPORT'] + if (datastore['RPORT'].o_i != 80) + serverIP += ":" + datastore['RPORT'].to_s end isapiURI = datastore['ISAPI'] diff --git a/modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb b/modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb index e708ff5671..df27a76719 100644 --- a/modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb +++ b/modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb @@ -1,4 +1,3 @@ -## # $Id$ ## @@ -167,7 +166,7 @@ class Metasploit3 < Msf::Auxiliary @evilchars = [''] end - print_status("Connecting to host " + ip + " on port " + datastore['RPORT']) + print_status("Connecting to host " + ip + " on port " + datastore['RPORT'].to_s) if (startstage == 1) process_phase(1, "Fuzzing without command") diff --git a/modules/auxiliary/fuzzers/http/http_form_field.rb b/modules/auxiliary/fuzzers/http/http_form_field.rb index c77a6972bd..0ca9e4b3fd 100644 --- a/modules/auxiliary/fuzzers/http/http_form_field.rb +++ b/modules/auxiliary/fuzzers/http/http_form_field.rb @@ -97,14 +97,14 @@ class Metasploit3 < Msf::Auxiliary 'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Keep-Alive' => '300', 'Connection' => 'keep-alive', - 'Referer' => proto + datastore['RHOST'] + ":" + datastore['RPORT'], + 'Referer' => proto + datastore['RHOST'] + ":" + datastore['RPORT'].to_s, 'Content-Type' => 'application/x-www-form-urlencoded', } } @get_data_headers = { 'Host' => host, 'User-Agent' => useragent, - 'Referer' => proto + datastore['RHOST'] + ":" + datastore['RPORT'], + 'Referer' => proto + datastore['RHOST'] + ":" + datastore['RPORT'].to_s, } end diff --git a/modules/auxiliary/scanner/http/frontpage_login.rb b/modules/auxiliary/scanner/http/frontpage_login.rb index e83a8b8352..0f31f4f87c 100644 --- a/modules/auxiliary/scanner/http/frontpage_login.rb +++ b/modules/auxiliary/scanner/http/frontpage_login.rb @@ -47,7 +47,7 @@ class Metasploit3 < Msf::Auxiliary if datastore['RPORT'].to_i == 80 or datastore['RPORT'].to_i == 443 port = "" else - port = ":" + datastore['RPORT'] + port = ":" + datastore['RPORT'].to_s end info = (datastore['SSL'] ? "https" : "http") + "://#{target_host}#{port}/" diff --git a/modules/exploits/multi/http/jboss_maindeployer.rb b/modules/exploits/multi/http/jboss_maindeployer.rb index 16c5eb8fa5..3a2121053a 100644 --- a/modules/exploits/multi/http/jboss_maindeployer.rb +++ b/modules/exploits/multi/http/jboss_maindeployer.rb @@ -193,7 +193,7 @@ class Metasploit3 < Msf::Exploit::Remote # UPLOAD # resource_uri = '/' + app_base + '.war' - service_url = 'http://' + datastore['SRVHOST'] + ':' + datastore['SRVPORT'] + resource_uri + service_url = 'http://' + datastore['SRVHOST'] + ':' + datastore['SRVPORT'].to_s + resource_uri print_status("Starting up our web service on #{service_url} ...") start_service({'Uri' => { 'Proc' => Proc.new { |cli, req| @@ -203,7 +203,7 @@ class Metasploit3 < Msf::Exploit::Remote }}) if (datastore['WARHOST']) - service_url = 'http://' + datastore['WARHOST'] + ':' + datastore['SRVPORT'] + resource_uri + service_url = 'http://' + datastore['WARHOST'] + ':' + datastore['SRVPORT'].to_s + resource_uri end print_status("Asking the JBoss server to deploy (via MainDeployer) #{service_url}") diff --git a/modules/exploits/osx/mdns/upnp_location.rb b/modules/exploits/osx/mdns/upnp_location.rb index c800a9921d..eb78cc4ad8 100644 --- a/modules/exploits/osx/mdns/upnp_location.rb +++ b/modules/exploits/osx/mdns/upnp_location.rb @@ -128,7 +128,7 @@ class Metasploit3 < Msf::Exploit::Remote begin socket = Rex::Socket.create_udp - upnp_location = "http://" + datastore['LHOST'] + ":" + datastore['SRVPORT'] + upnp_location = "http://" + datastore['LHOST'] + ":" + datastore['SRVPORT'].to_s print_status("Listening for UPNP requests on: #{upnp_location}") print_status("Sending UPNP Discovery replies...") diff --git a/modules/exploits/windows/browser/aol_icq_downloadagent.rb b/modules/exploits/windows/browser/aol_icq_downloadagent.rb index 53dcb0ae55..bf5a841ca2 100644 --- a/modules/exploits/windows/browser/aol_icq_downloadagent.rb +++ b/modules/exploits/windows/browser/aol_icq_downloadagent.rb @@ -65,7 +65,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/PAYLOAD" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/PAYLOAD" if (request.uri.match(/PAYLOAD/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/apple_quicktime_rtsp.rb b/modules/exploits/windows/browser/apple_quicktime_rtsp.rb index 1280e2d1f8..5f1e6bb39e 100644 --- a/modules/exploits/windows/browser/apple_quicktime_rtsp.rb +++ b/modules/exploits/windows/browser/apple_quicktime_rtsp.rb @@ -103,7 +103,7 @@ class Metasploit3 < Msf::Exploit::Remote shellcode = Rex::Text.to_unescape(p.encoded) url = ((datastore['SSL']) ? "https://" : "http://") url << ((datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(client.peerhost) : datastore['SRVHOST']) - url << ":" + datastore['SRVPORT'] + url << ":" + datastore['SRVPORT'].to_s url << get_resource js = <<-ENDJS #{js_heap_spray} diff --git a/modules/exploits/windows/browser/apple_quicktime_smil_debug.rb b/modules/exploits/windows/browser/apple_quicktime_smil_debug.rb index ab954f39a4..ffcb83b511 100644 --- a/modules/exploits/windows/browser/apple_quicktime_smil_debug.rb +++ b/modules/exploits/windows/browser/apple_quicktime_smil_debug.rb @@ -123,7 +123,7 @@ class Metasploit3 < Msf::Exploit::Remote shellcode = Rex::Text.to_unescape(p.encoded) url = ((datastore['SSL']) ? "https://" : "http://") url << ((datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(client.peerhost) : datastore['SRVHOST']) - url << ":" + datastore['SRVPORT'] + url << ":" + datastore['SRVPORT'].to_s url << get_resource fname = rand_text_alphanumeric(4) diff --git a/modules/exploits/windows/browser/awingsoft_winds3d_sceneurl.rb b/modules/exploits/windows/browser/awingsoft_winds3d_sceneurl.rb index 1aa6e54043..d0e9086ad9 100644 --- a/modules/exploits/windows/browser/awingsoft_winds3d_sceneurl.rb +++ b/modules/exploits/windows/browser/awingsoft_winds3d_sceneurl.rb @@ -59,7 +59,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/payload" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/payload" if (request.uri.match(/payload/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/blackice_downloadimagefileurl.rb b/modules/exploits/windows/browser/blackice_downloadimagefileurl.rb index 7b66cf0522..d0262769f4 100644 --- a/modules/exploits/windows/browser/blackice_downloadimagefileurl.rb +++ b/modules/exploits/windows/browser/blackice_downloadimagefileurl.rb @@ -99,7 +99,7 @@ class Metasploit3 < Msf::Exploit::Remote url = "http://" url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - url += ":" + datastore['SRVPORT'] + get_resource() + "/" + url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/" #VBScript variables clsid = "79956462-F148-497F-B247-DF35A095F80B" diff --git a/modules/exploits/windows/browser/c6_messenger_downloaderactivex.rb b/modules/exploits/windows/browser/c6_messenger_downloaderactivex.rb index 9169c668b8..8afddb8464 100644 --- a/modules/exploits/windows/browser/c6_messenger_downloaderactivex.rb +++ b/modules/exploits/windows/browser/c6_messenger_downloaderactivex.rb @@ -75,7 +75,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/#{@payload_rand}" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/#{@payload_rand}" if (request.uri.match(/#{@payload_rand}/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/dxstudio_player_exec.rb b/modules/exploits/windows/browser/dxstudio_player_exec.rb index a533fed09f..674d6f1b03 100644 --- a/modules/exploits/windows/browser/dxstudio_player_exec.rb +++ b/modules/exploits/windows/browser/dxstudio_player_exec.rb @@ -65,7 +65,7 @@ class Metasploit3 < Msf::Exploit::Remote url_base = "http://" url_base += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - url_base += ":" + datastore['SRVPORT'] + get_resource() + url_base += ":" + datastore['SRVPORT'].to_s + get_resource() payload_url = url_base + "/payload" diff --git a/modules/exploits/windows/browser/enjoysapgui_comp_download.rb b/modules/exploits/windows/browser/enjoysapgui_comp_download.rb index de9261004d..1c5d02f04c 100644 --- a/modules/exploits/windows/browser/enjoysapgui_comp_download.rb +++ b/modules/exploits/windows/browser/enjoysapgui_comp_download.rb @@ -68,7 +68,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/payload" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/payload" if (request.uri.match(/payload/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/macrovision_unsafe.rb b/modules/exploits/windows/browser/macrovision_unsafe.rb index bad26f5c4d..7a9d46b7db 100644 --- a/modules/exploits/windows/browser/macrovision_unsafe.rb +++ b/modules/exploits/windows/browser/macrovision_unsafe.rb @@ -58,7 +58,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/payload" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/payload" if (request.uri.match(/payload/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/ms08_041_snapshotviewer.rb b/modules/exploits/windows/browser/ms08_041_snapshotviewer.rb index 6713d6d3a5..869d94a10d 100644 --- a/modules/exploits/windows/browser/ms08_041_snapshotviewer.rb +++ b/modules/exploits/windows/browser/ms08_041_snapshotviewer.rb @@ -65,7 +65,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/payload" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/payload" if (request.uri.match(/payload/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/safari_xslt_output.rb b/modules/exploits/windows/browser/safari_xslt_output.rb index d652d72cc7..e67ba8b8ea 100644 --- a/modules/exploits/windows/browser/safari_xslt_output.rb +++ b/modules/exploits/windows/browser/safari_xslt_output.rb @@ -76,7 +76,7 @@ class Metasploit3 < Msf::Exploit::Remote url = "http://" url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - url += ":" + datastore['SRVPORT'] + get_resource() + "/" + url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/" content = <<-EOS diff --git a/modules/exploits/windows/browser/symantec_altirisdeployment_downloadandinstall.rb b/modules/exploits/windows/browser/symantec_altirisdeployment_downloadandinstall.rb index c4bc738e43..9e7140bd2f 100644 --- a/modules/exploits/windows/browser/symantec_altirisdeployment_downloadandinstall.rb +++ b/modules/exploits/windows/browser/symantec_altirisdeployment_downloadandinstall.rb @@ -69,7 +69,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/PAYLOAD" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/PAYLOAD" if (request.uri.match(/PAYLOAD/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/symantec_appstream_unsafe.rb b/modules/exploits/windows/browser/symantec_appstream_unsafe.rb index fe0f55d008..7eff754f6e 100644 --- a/modules/exploits/windows/browser/symantec_appstream_unsafe.rb +++ b/modules/exploits/windows/browser/symantec_appstream_unsafe.rb @@ -61,7 +61,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/payload" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/payload" if (request.uri.match(/payload/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/systemrequirementslab_unsafe.rb b/modules/exploits/windows/browser/systemrequirementslab_unsafe.rb index 23ad1a2a93..e251f12c07 100644 --- a/modules/exploits/windows/browser/systemrequirementslab_unsafe.rb +++ b/modules/exploits/windows/browser/systemrequirementslab_unsafe.rb @@ -59,7 +59,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/payload" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/payload" if (request.uri.match(/payload/)) return if ((p = regenerate_payload(cli)) == nil) diff --git a/modules/exploits/windows/browser/zenturiprogramchecker_unsafe.rb b/modules/exploits/windows/browser/zenturiprogramchecker_unsafe.rb index 5db120f064..18f7d8171a 100644 --- a/modules/exploits/windows/browser/zenturiprogramchecker_unsafe.rb +++ b/modules/exploits/windows/browser/zenturiprogramchecker_unsafe.rb @@ -64,7 +64,7 @@ class Metasploit3 < Msf::Exploit::Remote payload_url = "http://" payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST'] - payload_url += ":" + datastore['SRVPORT'] + get_resource() + "/payload" + payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/payload" if (request.uri.match(/payload/)) return if ((p = regenerate_payload(cli)) == nil)