Skip to content

Commit 06cc759

Browse files
author
Brent Cook
committed
Use the correct help output for the ps command
It should not look like this: ``` meterpreter > ps -h Usage: ps [ options ] OPTIONS: -S Search string to filter by -h This help menu ``` It should not not look like this: ``` meterpreter > ps -h Use the command with no arguments to see all running processes. The following options can be used to filter those results: OPTIONS: -A <opt> Filters processes on architecture (x86 or x86_64) -S <opt> String to search for (converts to regex) -U <opt> Filters processes on the user using the supplied RegEx -h Help menu. -s Show only SYSTEM processes ```
1 parent 9713fe7 commit 06cc759

File tree

1 file changed

+1
-9
lines changed
  • lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi

1 file changed

+1
-9
lines changed

lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,7 @@ def cmd_ps(*args)
436436
return true
437437
end
438438
when '-h'
439-
print_line "Usage: ps [ options ]"
440-
print_line
441-
print_line "OPTIONS:"
442-
print_line " -S Search string to filter by"
443-
print_line " -h This help menu"
444-
print_line
439+
cmd_ps_help
445440
return 0
446441
when "-A"
447442
print_line "Filtering on arch..."
@@ -491,7 +486,6 @@ def cmd_ps(*args)
491486
'SearchTerm' => search_term)
492487

493488
processes.each { |ent|
494-
495489
session = ent['session'] == 0xFFFFFFFF ? '' : ent['session'].to_s
496490
arch = ent['arch']
497491

@@ -503,8 +497,6 @@ def cmd_ps(*args)
503497
row = [ ent['pid'].to_s, ent['name'], arch, session, ent['user'], ent['path'] ]
504498

505499
tbl << row #if (search_term.nil? or row.join(' ').to_s.match(search_term))
506-
507-
508500
}
509501

510502
if (processes.length == 0)

0 commit comments

Comments
 (0)