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 @@ -360,6 +360,11 @@ def cmd_hosts(*args)
360
360
onlyup = true
361
361
when '-o'
362
362
output = args . shift
363
+ when '-O'
364
+ if ( order_by = args . shift . to_i - 1 ) < 0
365
+ print_error ( 'Please specify a column number starting from 1' )
366
+ return
367
+ end
363
368
when '-R' , '--rhosts'
364
369
set_rhosts = true
365
370
when '-S' , '--search'
@@ -386,6 +391,7 @@ def cmd_hosts(*args)
386
391
print_line " -h,--help Show this help information"
387
392
print_line " -u,--up Only show hosts which are up"
388
393
print_line " -o <file> Send output to a file in csv format"
394
+ print_line " -O <column> Order rows by specified column number"
389
395
print_line " -R,--rhosts Set RHOSTS from the results of the search"
390
396
print_line " -S,--search Search string to filter by"
391
397
print_line " -i,--info Change the info of a host"
@@ -425,8 +431,9 @@ def cmd_hosts(*args)
425
431
# If we got here, we're searching. Delete implies search
426
432
tbl = Rex ::Text ::Table . new (
427
433
{
428
- 'Header' => "Hosts" ,
429
- 'Columns' => col_names ,
434
+ 'Header' => "Hosts" ,
435
+ 'Columns' => col_names ,
436
+ 'SortIndex' => order_by
430
437
} )
431
438
432
439
# Sentinal value meaning all
You can’t perform that action at this time.
0 commit comments