Merge branch 'master' of github.com:beefproject/beef

This commit is contained in:
Wade Alcorn
2012-01-06 12:55:13 +10:00
12 changed files with 245 additions and 54 deletions

View File

@@ -277,13 +277,21 @@ beef.browser = {
isC15: function() {
return (!!window.chrome && !window.webkitPerformance) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10)==15)?true:false);
},
/**
* Returns true if Chrome 16.
* @example: beef.browser.isC16()
*/
isC16: function() {
return (!!window.chrome && !window.webkitPerformance) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10)==16)?true:false);
},
/**
* Returns true if Chrome.
* @example: beef.browser.isC()
*/
isC: function() {
return this.isC5() || this.isC6() || this.isC7() || this.isC8() || this.isC9() || this.isC10() || this.isC11() || this.isC12() || this.isC13() || this.isC14() || this.isC15();
return this.isC5() || this.isC6() || this.isC7() || this.isC8() || this.isC9() || this.isC10() || this.isC11() || this.isC12() || this.isC13() || this.isC14() || this.isC15() || this.isC16();
},
/**
@@ -346,6 +354,7 @@ beef.browser = {
C13: this.isC13(), // Chrome 13
C14: this.isC14(), // Chrome 14
C15: this.isC15(), // Chrome 15
C16: this.isC16(), // Chrome 16
C: this.isC(), // Chrome any version
FF2: this.isFF2(), // Firefox 2
@@ -398,6 +407,7 @@ beef.browser = {
if (this.isC13()) { return '13' }; // Chrome 13
if (this.isC14()) { return '14' }; // Chrome 14
if (this.isC15()) { return '15' }; // Chrome 15
if (this.isC16()) { return '16' }; // Chrome 16
if (this.isFF2()) { return '2' }; // Firefox 2

View File

@@ -66,7 +66,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_page_title_hash = { 'Page Title' => encoded_page_title }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_page_title_hash,
'from' => 'Initialization'
}
@@ -81,7 +81,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_page_uri_hash = { 'Page URI' => encoded_page_uri }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_page_uri_hash,
'from' => 'Initialization'
}
@@ -96,7 +96,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_page_referrer_hash = { 'Page Referrer' => encoded_page_referrer }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_page_referrer_hash,
'from' => 'Initialization'
}
@@ -111,7 +111,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_host_name_hash = { 'Hostname/IP' => encoded_host_name }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_host_name_hash,
'from' => 'Initialization'
}
@@ -126,7 +126,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_os_name_hash = { 'OS Name' => encoded_os_name }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_os_name_hash,
'from' => 'Initialization'
}
@@ -141,7 +141,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
browser_name_hash = { 'Browser Name' => friendly_browser_name }
browser_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => browser_name_hash,
'from' => 'Initialization'
}
@@ -156,7 +156,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
browser_version_hash = { 'Browser Version' => encoded_browser_version }
browser_version_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => browser_version_hash,
'from' => 'Initialization'
}
@@ -170,7 +170,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
browser_uastring_hash = { 'Browser UA String' => browser_uastring }
browser_uastring_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => browser_uastring_hash,
'from' => 'Initialization'
}
@@ -185,7 +185,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_cookies_hash = { 'Cookies' => encoded_cookies }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_cookies_hash,
'from' => 'Initialization'
}
@@ -200,7 +200,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_browser_plugins_hash = { 'Browser Plugins' => encoded_browser_plugins }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_browser_plugins_hash,
'from' => 'Initialization'
}
@@ -215,7 +215,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_internal_ip_hash = { 'Internal IP' => encoded_internal_ip }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_internal_ip_hash,
'from' => 'Initialization'
}
@@ -230,7 +230,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_internal_hostname_hash = { 'Internal Hostname' => encoded_internal_hostname }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_internal_hostname_hash,
'from' => 'Initialization'
}
@@ -245,7 +245,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_system_platform_hash = { 'System Platform' => encoded_system_platform }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_system_platform_hash,
'from' => 'Initialization'
}
@@ -270,7 +270,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_screen_params_hash = { 'Screen Params' => encoded_screen_params }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_screen_params_hash,
'from' => 'Initialization'
}
@@ -293,7 +293,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_window_size_hash = { 'Window Size' => encoded_window_size }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_window_size_hash,
'from' => 'Initialization'
}
@@ -308,7 +308,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_java_enabled_hash = { 'Java Enabled' => encoded_java_enabled }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_java_enabled_hash,
'from' => 'Initialization'
}
@@ -323,7 +323,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_vbscript_enabled_hash = { 'VBScript Enabled' => encoded_vbscript_enabled }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_vbscript_enabled_hash,
'from' => 'Initialization'
}
@@ -338,7 +338,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_has_flash_hash = { 'Has Flash' => encoded_has_flash }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_flash_hash,
'from' => 'Initialization'
}
@@ -353,7 +353,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_has_googlegears_hash = { 'Has GoogleGears' => encoded_has_googlegears }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_googlegears_hash,
'from' => 'Initialization'
}
@@ -368,7 +368,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_has_web_socket_hash = { 'Has WebSockets' => encoded_has_web_socket }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_web_socket_hash,
'from' => 'Initialization'
}
@@ -383,7 +383,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_has_activex_hash = { 'Has ActiveX' => encoded_has_activex }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_activex_hash,
'from' => 'Initialization'
}
@@ -398,7 +398,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_has_session_cookies_hash = { 'Session Cookies' => encoded_has_session_cookies }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_session_cookies_hash,
'from' => 'Initialization'
}
@@ -413,7 +413,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
encoded_has_persistent_cookies_hash = { 'Persistent Cookies' => encoded_has_persistent_cookies }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_persistent_cookies_hash,
'from' => 'Initialization'
}

View File

@@ -38,6 +38,7 @@
<%= script_tag 'ui/panel/Logout.js' %>
<%= script_tag 'ui/panel/WelcomeTab.js' %>
<%= script_tag 'ui/panel/DecoderTab.js' %>
<%= stylesheet_tag 'ext-all.css' %>
<%= stylesheet_tag 'base.css' %>

View File

@@ -0,0 +1,164 @@
//
// Copyright 2012 Wade Alcorn wade@bindshell.net
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
DecoderTab = function() {
/*
* The panel used to encode/decode text.
********************************************/
var decoder_panel = new Ext.FormPanel({
title: 'Decoder',
id: 'decoder-panel',
hideLabels : false,
border: false,
padding: '3px 5px 0 5px',
items:[{
fieldLabel: 'Text',
xtype: 'textarea',
id: 'inputText',
name: 'inputText',
width: '100%',
height: '40%',
allowBlank: true
},{
fieldLabel: 'Result',
xtype: 'textarea',
id: 'resultText',
name: 'resultText',
width: '100%',
height: '40%',
allowBlank: true
}],
buttons: [{
text: 'Encode',
handler: function() {
var form = Ext.getCmp('decoder-panel').getForm();
var form_values = form.getValues();
var input_text = form_values['inputText'];
var result="";
switch (form_values['decodeType']) {
case "base64":
break;
case "rot13":
result = input_text.replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);});
break;
case "addslashes":
result = input_text.replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
break;
case "stripslashes":
result = input_text.replace(/\\(.?)/g, function (s, n1) {switch (n1) {case '\\':return '\\';case '0':return '\u0000';case '':return '';default:return n1;}});
break;
case "reverse":
break;
case "escape":
result = escape(input_text);
break;
case "unescape":
result = unescape(input_text);
break;
case "encodeuri":
result = encodeURI(input_text);
break;
case "decodeuri":
result = decodeURI(input_text);
break;
default:
}
form.setValues({resultText: result});
}
},{
text: 'Decode',
handler: function() {
var form = Ext.getCmp('decoder-panel').getForm();
var form_values = form.getValues();
var input_text = form_values['inputText'];
var result="";
switch (form_values['decodeType']) {
case "base64":
break;
case "rot13":
result = input_text.replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);});
break;
case "addslashes":
result = input_text.replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
break;
case "stripslashes":
result = input_text.replace(/\\(.?)/g, function (s, n1) {switch (n1) {case '\\':return '\\';case '0':return '\u0000';case '':return '';default:return n1;}});
break;
case "reverse":
break;
case "escape":
result = escape(input_text);
break;
case "unescape":
result = unescape(input_text);
break;
case "encodeuri":
result = encodeURI(input_text);
break;
case "decodeuri":
result = decodeURI(input_text);
break;
default:
}
form.setValues({resultText: result});
}
}]
});
decode_combo = new Ext.form.ComboBox({
name: 'decodeType',
disableKeyFilter: false,
fieldLabel: 'Type',
forceSelection: true,
emptyText: '--select--',
triggerAction: 'all',
mode: 'local',
store: new Ext.data.SimpleStore({
id: 0,
fields: ['value', 'text'],
data: [
//['base64', 'Base64'],
//['reverse', 'Reverse'],
['rot13', 'Rot13'],
//['fromcharcode', 'String.fromCharCode'],
['addslashes', 'Add Slashes'],
['stripslashes', 'Strip Slashes'],
['escape', 'escape()'],
['unescape', 'unescape()'],
['encodeuri', 'encodeURI()'],
['decodeuri', 'decodeURI()']
]
}),
valueField: 'value',
displayField: 'text',
hiddenName: 'decodeType'
});
decoder_panel.add(decode_combo);
DecoderTab.superclass.constructor.call(this, {
region: 'center',
items: [decoder_panel],
autoScroll: true,
border: false
});
};
Ext.extend(DecoderTab,Ext.Panel, {});

View File

@@ -41,6 +41,7 @@ MainPanel = function(){
this.grid = new DataGrid('/ui/logs/all.json',30);
this.grid.border = false;
this.welcome_tab = new WelcomeTab;
this.decoder_tab = new DecoderTab;
MainPanel.superclass.constructor.call(this, {
id:'main-tabs',
@@ -69,6 +70,13 @@ MainPanel = function(){
hideMode:'offsets',
items:[
this.grid
]},{
id:'decoder-view',
layout:'border',
title:'Decoder',
hideMode:'offsets',
items:[
this.decoder_tab
]
}]
});

View File

@@ -275,7 +275,7 @@ class ShellInterface
encoded_page_title_hash = { 'Page Title' => encoded_page_title }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_page_title_hash,
'from' => 'Initialization'
}
@@ -290,7 +290,7 @@ class ShellInterface
encoded_page_uri_hash = { 'Page URI' => encoded_page_uri }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_page_uri_hash,
'from' => 'Initialization'
}
@@ -305,7 +305,7 @@ class ShellInterface
encoded_page_referrer_hash = { 'Page Referrer' => encoded_page_referrer }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_page_referrer_hash,
'from' => 'Initialization'
}
@@ -320,7 +320,7 @@ class ShellInterface
encoded_host_name_hash = { 'Hostname/IP' => encoded_host_name }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_host_name_hash,
'from' => 'Initialization'
}
@@ -335,7 +335,7 @@ class ShellInterface
encoded_os_name_hash = { 'OS Name' => encoded_os_name }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_os_name_hash,
'from' => 'Initialization'
}
@@ -350,7 +350,7 @@ class ShellInterface
browser_name_hash = { 'Browser Name' => friendly_browser_name }
browser_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => browser_name_hash,
'from' => 'Initialization'
}
@@ -365,7 +365,7 @@ class ShellInterface
browser_version_hash = { 'Browser Version' => encoded_browser_version }
browser_version_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => browser_version_hash,
'from' => 'Initialization'
}
@@ -379,7 +379,7 @@ class ShellInterface
browser_uastring_hash = { 'Browser UA String' => browser_uastring }
browser_uastring_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => browser_uastring_hash,
'from' => 'Initialization'
}
@@ -394,7 +394,7 @@ class ShellInterface
encoded_cookies_hash = { 'Cookies' => encoded_cookies }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Hooked Page',
'data' => encoded_cookies_hash,
'from' => 'Initialization'
}
@@ -409,7 +409,7 @@ class ShellInterface
encoded_browser_plugins_hash = { 'Browser Plugins' => encoded_browser_plugins }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_browser_plugins_hash,
'from' => 'Initialization'
}
@@ -424,7 +424,7 @@ class ShellInterface
encoded_internal_ip_hash = { 'Internal IP' => encoded_internal_ip }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_internal_ip_hash,
'from' => 'Initialization'
}
@@ -439,7 +439,7 @@ class ShellInterface
encoded_system_platform_hash = { 'System Platform' => encoded_system_platform }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_system_platform_hash,
'from' => 'Initialization'
}
@@ -454,7 +454,7 @@ class ShellInterface
encoded_internal_hostname_hash = { 'Internal Hostname' => encoded_internal_hostname }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_internal_hostname_hash,
'from' => 'Initialization'
}
@@ -476,7 +476,7 @@ class ShellInterface
encoded_screen_params_hash = { 'Screen Params' => encoded_screen_params }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Host',
'data' => encoded_screen_params_hash,
'from' => 'Initialization'
}
@@ -497,7 +497,7 @@ class ShellInterface
encoded_window_size_hash = { 'Window Size' => encoded_window_size }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_window_size_hash,
'from' => 'Initialization'
}
@@ -512,7 +512,7 @@ class ShellInterface
encoded_java_enabled_hash = { 'Java Enabled' => encoded_java_enabled }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_java_enabled_hash,
'from' => 'Initialization'
}
@@ -527,7 +527,7 @@ class ShellInterface
encoded_vbscript_enabled_hash = { 'VBScript Enabled' => encoded_vbscript_enabled }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_vbscript_enabled_hash,
'from' => 'Initialization'
}
@@ -542,7 +542,7 @@ class ShellInterface
encoded_has_flash_hash = { 'Has Flash' => encoded_has_flash }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_flash_hash,
'from' => 'Initialization'
}
@@ -557,7 +557,7 @@ class ShellInterface
encoded_has_googlegears_hash = { 'Has GoogleGears' => encoded_has_googlegears }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_googlegears_hash,
'from' => 'Initialization'
}
@@ -572,7 +572,7 @@ class ShellInterface
encoded_has_web_socket_hash = { 'Has GoogleGears' => encoded_has_web_socket }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_web_socket_hash,
'from' => 'Initialization'
}
@@ -587,7 +587,7 @@ class ShellInterface
encoded_has_activex_hash = { 'Has ActiveX' => encoded_has_activex }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_activex_hash,
'from' => 'Initialization'
}
@@ -602,7 +602,7 @@ class ShellInterface
encoded_has_session_cookies_hash = { 'Session Cookies' => encoded_has_session_cookies }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_session_cookies_hash,
'from' => 'Initialization'
}
@@ -617,7 +617,7 @@ class ShellInterface
encoded_has_persistent_cookies_hash = { 'Persistent Cookies' => encoded_has_persistent_cookies }
page_name_row = {
'category' => 'Browser Hook Initialization',
'category' => 'Browser',
'data' => encoded_has_persistent_cookies_hash,
'from' => 'Initialization'
}

View File

@@ -34,6 +34,7 @@ module Metasploit
@lock = false
@lastauth = nil
@unit_test = false
opts = {
:host => @config['host'] || '127.0.0.1',
:port => @config['port'] || 55552,
@@ -63,6 +64,9 @@ module Metasploit
ret
end
def unit_test_init
@unit_test = true
end
# login into metasploit
def login
get_lock()
@@ -74,7 +78,7 @@ module Metasploit
return false
end
print_info 'Successful connection with Metasploit.' if not @lastauth
print_info 'Successful connection with Metasploit.' if (!@lastauth && !@unit_test)
@lastauth = Time.now

View File

@@ -22,5 +22,5 @@ beef:
description: "Open a new tab and execute the Javascript code on it. The Chrome Extension needs to have the 'tabs' permission, as well as access to the domain."
authors: ["Kos", "antisnatchor"]
target:
working: ["C"]
user_notify: ["C"]
not_working: ["All"]

View File

@@ -23,3 +23,4 @@ beef:
authors: ["Kos", "antisnatchor"]
target:
working: ["C"]
not_working: ["All"]

View File

@@ -8,3 +8,4 @@ beef:
authors: ["Kos", "antisnatchor"]
target:
working: ["C"]
not_working: ["All"]

View File

@@ -4,7 +4,8 @@ beef:
enable: true
category: "Chrome Extensions"
name: "Send Gvoice SMS"
description: "Send a text message (SMS) through the Google Voice account of the victim, if she's logged in Google."
description: "Send a text message (SMS) through the Google Voice account of the victim, if she's logged in to Google."
authors: ["Kos", "antisnatchor"]
target:
user_notify: ["ALL"]
user_notify: ["C"]
not_working: ["ALL"]

View File

@@ -20,7 +20,7 @@ class TC_Metasploit < Test::Unit::TestCase
def setup
$root_dir="../../"
$:.unshift File.join( %w{ ../../ } )
$:.unshift File.join( %w{ ../../ } )
end
#
@@ -45,6 +45,7 @@ class TC_Metasploit < Test::Unit::TestCase
load_config
require 'extensions/metasploit/extension.rb'
@api = BeEF::Extension::Metasploit::RpcClient.instance
@api.unit_test_init()
end
#
@@ -73,7 +74,7 @@ class TC_Metasploit < Test::Unit::TestCase
# Verify that the login is working
#
def test_login
new_api
new_api
assert(@api.login)
end