diff --git a/modules/phonegap/phonegap_alert_user/command.js b/modules/phonegap/phonegap_alert_user/command.js new file mode 100644 index 000000000..1d287980a --- /dev/null +++ b/modules/phonegap/phonegap_alert_user/command.js @@ -0,0 +1,27 @@ +// +// Copyright (c) 2006-2014 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - http://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + +// Phonegap_alert_user +// +beef.execute(function() { + var title = "<%== @title %>"; + var message = "<%== @message %>"; + var buttonName = "<%== @buttonName %>"; + + + function onAlert() { + result = "Alert dismissed"; + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result ); + } + + navigator.notification.alert( + message, + onAlert, + title, + buttonName + ); + +}); diff --git a/modules/phonegap/phonegap_alert_user/config.yaml b/modules/phonegap/phonegap_alert_user/config.yaml new file mode 100644 index 000000000..bd577f08a --- /dev/null +++ b/modules/phonegap/phonegap_alert_user/config.yaml @@ -0,0 +1,17 @@ +# +# Copyright (c) 2006-2014 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +# Phonegap_prompt_user +# +beef: + module: + phonegap_alert_user: + enable: true + category: "Phonegap" + name: "Alert User" + description: "Show user an alert" + authors: ["staregate"] + target: + working: ["All"] diff --git a/modules/phonegap/phonegap_alert_user/module.rb b/modules/phonegap/phonegap_alert_user/module.rb new file mode 100644 index 000000000..a47bc7f9d --- /dev/null +++ b/modules/phonegap/phonegap_alert_user/module.rb @@ -0,0 +1,39 @@ +# +# Copyright (c) 2006-2014 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +# Phonegap_prompt_user +# + +class Phonegap_alert_user < BeEF::Core::Command + + def self.options + return [{ + 'name' => 'title', + 'description' => 'Alert title', + 'ui_label'=>'Title', + 'value' => 'Beef', + 'width' => '300px' + },{ + 'name' => 'message', + 'description' => 'Message', + 'ui_label'=>'Message', + 'value' => 'Game over!', + 'width' => '300px' + },{ + 'name' => 'buttonName', + 'description' => 'Default button name', + 'ui_label'=>'Button name', + 'value' => 'Done', + 'width' => '100px' + }] + end + + def callback + content = {} + content['Result'] = @datastore['result'] + save content + end + +end