From 55d85069602524ff04716d5c00d9b71c258be4fa Mon Sep 17 00:00:00 2001 From: Sergey Gorbaty Date: Tue, 7 May 2013 17:10:12 -0700 Subject: [PATCH] Added primitive phonegap plugin detection --- .../phonegap_plugin_detection/command.js | 49 +++++++++++++++++++ .../phonegap_plugin_detection/config.yaml | 17 +++++++ .../phonegap_plugin_detection/module.rb | 14 ++++++ 3 files changed, 80 insertions(+) create mode 100644 modules/phonegap/phonegap_plugin_detection/command.js create mode 100644 modules/phonegap/phonegap_plugin_detection/config.yaml create mode 100644 modules/phonegap/phonegap_plugin_detection/module.rb diff --git a/modules/phonegap/phonegap_plugin_detection/command.js b/modules/phonegap/phonegap_plugin_detection/command.js new file mode 100644 index 000000000..557566d76 --- /dev/null +++ b/modules/phonegap/phonegap_plugin_detection/command.js @@ -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", <%= @command_id %>, 'result='+result ); + +}); \ No newline at end of file diff --git a/modules/phonegap/phonegap_plugin_detection/config.yaml b/modules/phonegap/phonegap_plugin_detection/config.yaml new file mode 100644 index 000000000..a5a09713e --- /dev/null +++ b/modules/phonegap/phonegap_plugin_detection/config.yaml @@ -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"] diff --git a/modules/phonegap/phonegap_plugin_detection/module.rb b/modules/phonegap/phonegap_plugin_detection/module.rb new file mode 100644 index 000000000..f9567f8bf --- /dev/null +++ b/modules/phonegap/phonegap_plugin_detection/module.rb @@ -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