From f0fab1c431e1c9c2cafa94cbef079bee38df6f4e Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Fri, 16 Mar 2012 11:12:10 +0100 Subject: [PATCH 01/31] Added rest-client gem dependency when running tests --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 99b911ef9..2c7b9651e 100644 --- a/Gemfile +++ b/Gemfile @@ -49,6 +49,8 @@ if ENV['BEEF_TEST'] # sudo apt-get install libxslt-dev libxml2-dev # sudo port install libxml2 libxslt gem "capybara" + #RESTful API tests/generic command module tests + gem "rest-client", "~> 1.6.7" end source "http://rubygems.org" From 45475d625b3caa429f230ce631bb0a08cd1b4d06 Mon Sep 17 00:00:00 2001 From: bcoles Date: Thu, 22 Mar 2012 19:27:36 +1030 Subject: [PATCH 02/31] Updated IE version detection No longer modifies the DOM for every call to: `isIE8()` `isIE9()` `isIE()` --- core/main/client/browser.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index d831892b2..f4d83780b 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -48,9 +48,8 @@ beef.browser = { * Returns true if IE8. * @example: beef.browser.isIE8() */ - isIE8: function() { - $j("body").append(''); - return ($j('#beefiecheck').hasClass('ie8'))?true:false; + isIE8: function() { + return !!window.XMLHttpRequest && !window.chrome && !window.opera && !window.getComputedStyle && !!document.documentMode && !!window.XDomainRequest && !window.performance; }, /** @@ -58,8 +57,7 @@ beef.browser = { * @example: beef.browser.isIE9() */ isIE9: function() { - $j("body").append(''); - return ($j('#beefiecheck').hasClass('ie9'))?true:false; + return !!window.XMLHttpRequest && !window.chrome && !window.opera && !window.getComputedStyle && !!document.documentMode && !!window.XDomainRequest && !!window.performance; }, /** @@ -166,12 +164,20 @@ beef.browser = { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/11\./) != null; }, + /** + * Returns true if FF12 +* @example: beef.browser.isFF12() + */ + isFF12: function() { +return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/12\./) != null; + }, + /** * Returns true if FF. * @example: beef.browser.isFF() */ isFF: function() { - return this.isFF2() || this.isFF3() || this.isFF3_5() || this.isFF3_6() || this.isFF4() || this.isFF5() || this.isFF6() || this.isFF7() || this.isFF8() || this.isFF9() || this.isFF10() || this.isFF11(); + return this.isFF2() || this.isFF3() || this.isFF3_5() || this.isFF3_6() || this.isFF4() || this.isFF5() || this.isFF6() || this.isFF7() || this.isFF8() || this.isFF9() || this.isFF10() || this.isFF11() || this.isFF12(); }, /** @@ -386,6 +392,7 @@ beef.browser = { FF9: this.isFF9(), // Firefox 9 FF10: this.isFF10(), // Firefox 10 FF11: this.isFF11(), // Firefox 11 + FF12: this.isFF12(), // Firefox 12 FF: this.isFF(), // Firefox any version IE6: this.isIE6(), // Internet Explorer 6 @@ -441,7 +448,7 @@ beef.browser = { if (this.isFF9()) { return '9' }; // Firefox 9 if (this.isFF10()) { return '10' }; // Firefox 10 if (this.isFF11()) { return '11' }; // Firefox 11 - + if (this.isFF12()) { return '12' }; // Firefox 12 if (this.isIE6()) { return '6' }; // Internet Explorer 6 if (this.isIE7()) { return '7' }; // Internet Explorer 7 From b230b983361532c16d5e29c425c3dc72a9379906 Mon Sep 17 00:00:00 2001 From: bcoles Date: Sun, 25 Mar 2012 14:13:44 +1030 Subject: [PATCH 03/31] Changed `BeEF::API.registered?()` to use the `:is_matched_params` method Fixes issue #500 --- core/api.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/api.rb b/core/api.rb index 3ad1bf391..0d845d02d 100644 --- a/core/api.rb +++ b/core/api.rb @@ -60,10 +60,9 @@ module BeEF # @param [String] method the method of the class # @param [Array] params an array of parameters that need to be matched # @return [Boolean] whether or not the owner is registered - # @todo Change the param matching to use the new :is_matched_params?() method - Issue #479 def registered?(owner, c, method, params = []) @registry.each{|r| - if r['owner'] == owner and r['class'] == c and r['method'] == method and params == r['params'] + if r['owner'] == owner and r['class'] == c and r['method'] == method and self.is_matched_params?(r, params) return true end } From 8518c8fae9dac929afccf1d7f85ec74e6a500945 Mon Sep 17 00:00:00 2001 From: bcoles Date: Mon, 26 Mar 2012 14:44:36 +1030 Subject: [PATCH 04/31] Renamed History Extraction module to Get Visited Domains Added 4 links for Firefox --- .../{get_history => get_visited_domains}/command.js | 9 ++++++++- .../{get_history => get_visited_domains}/config.yaml | 4 ++-- .../{get_history => get_visited_domains}/module.rb | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) rename modules/browser/{get_history => get_visited_domains}/command.js (95%) rename modules/browser/{get_history => get_visited_domains}/config.yaml (93%) rename modules/browser/{get_history => get_visited_domains}/module.rb (93%) diff --git a/modules/browser/get_history/command.js b/modules/browser/get_visited_domains/command.js similarity index 95% rename from modules/browser/get_history/command.js rename to modules/browser/get_visited_domains/command.js index a7f286c19..d2c04fac1 100644 --- a/modules/browser/get_history/command.js +++ b/modules/browser/get_visited_domains/command.js @@ -79,7 +79,14 @@ if (beef.browser.isFF() == 1) { { 'name': 'Expedia', 'urls': [ 'http://www.expedia.com/static/default/default/scripts/expedia/core/e.js?v=release-2011-11-r4.9.317875' ] }, { 'name': 'Amazon (US)', 'urls': [ 'http://z-ecx.images-amazon.com/images/G/01/browser-scripts/us-site-wide-css-quirks/site-wide-3527593236.css._V162874846_.css' ] }, { 'name': 'Newegg', 'urls': [ 'http://images10.newegg.com/WebResource/Themes/2005/CSS/template.v1.w.5723.0.css' ] }, - { 'name': 'eBay', 'urls': [ 'http://ir.ebaystatic.com/v4js/z/io/gbsozkl4ha54vasx4meo3qmtw.js' ] } + { 'name': 'eBay', 'urls': [ 'http://ir.ebaystatic.com/v4js/z/io/gbsozkl4ha54vasx4meo3qmtw.js' ] }, + { 'category': 'Coding' }, + { 'name': 'GitHub', 'urls': [ 'https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github-fa63b2501ea82170d5b3b1469e26c6fa6c3116dc.css' ] }, + { 'category': 'Security' }, + { 'name': 'Exploit DB', 'urls': [ 'http://www.exploit-db.com/wp-content/themes/exploit/style.css' ] }, + { 'name': 'Packet Storm', 'urls': [ 'http://packetstormsecurity.org/img/pss.ico' ] }, + { 'category': 'Email' }, + { 'name': 'Hotmail', 'urls': [ 'https://secure.shared.live.com/~Live.SiteContent.ID/~16.2.9/~/~/~/~/css/R3WinLive1033.css' ] } ]; /************************* * CONFIGURABLE SETTINGS * diff --git a/modules/browser/get_history/config.yaml b/modules/browser/get_visited_domains/config.yaml similarity index 93% rename from modules/browser/get_history/config.yaml rename to modules/browser/get_visited_domains/config.yaml index 167088243..dfcab7cf8 100644 --- a/modules/browser/get_history/config.yaml +++ b/modules/browser/get_visited_domains/config.yaml @@ -15,10 +15,10 @@ # beef: module: - get_history: + get_visited_domains: enable: true category: "Browser" - name: "History Extraction" + name: "Get Visited Domains" description: "This module will retrieve rapid history extraction through non-destructive cache timing.\nBased on work done at http://lcamtuf.coredump.cx/cachetime/" authors: ["keith_lee @keith55 http://milo2012.wordpress.com"] target: diff --git a/modules/browser/get_history/module.rb b/modules/browser/get_visited_domains/module.rb similarity index 93% rename from modules/browser/get_history/module.rb rename to modules/browser/get_visited_domains/module.rb index 9ffe12fa1..8effcac55 100644 --- a/modules/browser/get_history/module.rb +++ b/modules/browser/get_visited_domains/module.rb @@ -14,7 +14,7 @@ # limitations under the License. # -class Get_history < BeEF::Core::Command +class Get_visited_domains < BeEF::Core::Command def post_execute content = {} From 2bca21a41d372289ef68ba9809ca0bfb03a0dcaf Mon Sep 17 00:00:00 2001 From: bcoles Date: Mon, 26 Mar 2012 16:29:15 +1030 Subject: [PATCH 05/31] Minor updates to XSSRays Part of issue #47 --- core/main/client/net/xssrays.js | 18 +++++++++--------- .../admin_ui/controllers/xssrays/xssrays.rb | 6 +++--- extensions/xssrays/handler.rb | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/main/client/net/xssrays.js b/core/main/client/net/xssrays.js index 2db324759..93091680f 100644 --- a/core/main/client/net/xssrays.js +++ b/core/main/client/net/xssrays.js @@ -50,19 +50,19 @@ beef.net.xssrays = { vectors: [ // {input:"',XSS,'", name: 'Standard DOM based injection single', browser: 'ALL',url:true,form:true,path:true}, -// {input:'",XSS,"', name: 'Standard DOM based injection double', browser: 'ALL',url:true,form:true,path:true}, -// {input: '\'>