File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
lib/rex/post/meterpreter/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: binary -*-
2
+ require 'set'
2
3
require 'rex/post/meterpreter'
3
4
require 'rex/parser/arguments'
4
5
@@ -416,17 +417,17 @@ def cmd_load(*args)
416
417
@@load_opts . parse ( args ) { |opt , idx , val |
417
418
case opt
418
419
when "-l"
419
- exts = [ ]
420
+ exts = SortedSet . new
420
421
msf_path = MeterpreterBinaries . metasploit_data_dir
421
422
gem_path = MeterpreterBinaries . local_dir
422
423
[ msf_path , gem_path ] . each do |path |
423
424
::Dir . entries ( path ) . each { |f |
424
425
if ( ::File . file? ( ::File . join ( path , f ) ) && f =~ /ext_server_(.*)\. #{ client . binary_suffix } / )
425
- exts . push ( $1 ) unless exts . include? ( $1)
426
+ exts . add ( $1)
426
427
end
427
428
}
428
429
end
429
- print ( exts . sort . join ( "\n " ) + "\n " )
430
+ print ( exts . to_a . join ( "\n " ) + "\n " )
430
431
431
432
return true
432
433
when "-h"
@@ -464,19 +465,19 @@ def cmd_load(*args)
464
465
end
465
466
466
467
def cmd_load_tabs ( str , words )
467
- tabs = [ ]
468
+ tabs = SortedSet . new
468
469
msf_path = MeterpreterBinaries . metasploit_data_dir
469
470
gem_path = MeterpreterBinaries . local_dir
470
471
[ msf_path , gem_path ] . each do |path |
471
472
::Dir . entries ( path ) . each { |f |
472
473
if ( ::File . file? ( ::File . join ( path , f ) ) && f =~ /ext_server_(.*)\. #{ client . binary_suffix } / )
473
474
if ( not extensions . include? ( $1) )
474
- tabs . push ( $1 ) unless tabs . include? ( $1)
475
+ tabs . add ( $1)
475
476
end
476
477
end
477
478
}
478
479
end
479
- return tabs
480
+ return tabs . to_a
480
481
end
481
482
482
483
def cmd_use ( *args )
You can’t perform that action at this time.
0 commit comments