File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -586,6 +586,11 @@ def cmd_services(*args)
586
586
return
587
587
end
588
588
output_file = ::File . expand_path ( output_file )
589
+ when '-O'
590
+ if ( order_by = args . shift . to_i - 1 ) == -1
591
+ print_error ( 'Please specify a column number starting from 1' )
592
+ return
593
+ end
589
594
when '-R' , '--rhosts'
590
595
set_rhosts = true
591
596
when '-S' , '--search'
@@ -604,6 +609,7 @@ def cmd_services(*args)
604
609
print_line " -r <protocol> Only show [tcp|udp] services"
605
610
print_line " -u,--up Only show services which are up"
606
611
print_line " -o <file> Send output to a file in csv format"
612
+ print_line " -O <column> Order rows by specified column number"
607
613
print_line " -R,--rhosts Set RHOSTS from the results of the search"
608
614
print_line " -S,--search Search string to filter by"
609
615
print_line
@@ -651,8 +657,9 @@ def cmd_services(*args)
651
657
col_names = col_search
652
658
end
653
659
tbl = Rex ::Text ::Table . new ( {
654
- 'Header' => "Services" ,
655
- 'Columns' => [ 'host' ] + col_names ,
660
+ 'Header' => "Services" ,
661
+ 'Columns' => [ 'host' ] + col_names ,
662
+ 'SortIndex' => order_by
656
663
} )
657
664
658
665
# Sentinal value meaning all
You can’t perform that action at this time.
0 commit comments