Land #5483 : Use the correct help output for the ps command
commit
26785b34f1
|
@ -429,20 +429,15 @@ class Console::CommandDispatcher::Stdapi::Sys
|
|||
# Parse opts
|
||||
@@ps_opts.parse(args) { |opt, idx, val|
|
||||
case opt
|
||||
when '-S'
|
||||
search_term = val
|
||||
if search_term.nil?
|
||||
print_error("Enter a search term")
|
||||
return true
|
||||
end
|
||||
when '-h'
|
||||
print_line "Usage: ps [ options ]"
|
||||
print_line
|
||||
print_line "OPTIONS:"
|
||||
print_line " -S Search string to filter by"
|
||||
print_line " -h This help menu"
|
||||
print_line
|
||||
return 0
|
||||
when '-S'
|
||||
search_term = val
|
||||
if search_term.nil?
|
||||
print_error("Enter a search term")
|
||||
return true
|
||||
end
|
||||
when '-h'
|
||||
cmd_ps_help
|
||||
return true
|
||||
when "-A"
|
||||
print_line "Filtering on arch..."
|
||||
searched_procs = Rex::Post::Meterpreter::Extensions::Stdapi::Sys::ProcessList.new
|
||||
|
@ -491,7 +486,6 @@ class Console::CommandDispatcher::Stdapi::Sys
|
|||
'SearchTerm' => search_term)
|
||||
|
||||
processes.each { |ent|
|
||||
|
||||
session = ent['session'] == 0xFFFFFFFF ? '' : ent['session'].to_s
|
||||
arch = ent['arch']
|
||||
|
||||
|
@ -503,8 +497,6 @@ class Console::CommandDispatcher::Stdapi::Sys
|
|||
row = [ ent['pid'].to_s, ent['name'], arch, session, ent['user'], ent['path'] ]
|
||||
|
||||
tbl << row #if (search_term.nil? or row.join(' ').to_s.match(search_term))
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (processes.length == 0)
|
||||
|
@ -518,6 +510,8 @@ class Console::CommandDispatcher::Stdapi::Sys
|
|||
end
|
||||
|
||||
def cmd_ps_help
|
||||
print_line "Usage: ps [ options ]"
|
||||
print_line
|
||||
print_line "Use the command with no arguments to see all running processes."
|
||||
print_line "The following options can be used to filter those results:"
|
||||
|
||||
|
|
Loading…
Reference in New Issue