We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70bbacf commit dd6e759Copy full SHA for dd6e759
lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb
@@ -421,9 +421,20 @@ def cmd_pgrep(*args)
421
return true
422
end
423
424
- pids = processes.collect { |p| p['pid'] }
425
- pids.each do | pid |
426
- print_line(pid.to_s)
+ # XXX fix Rex parser to properly handle adjacent short flags
+ f_flag = args.include?('-f') || args.include?('-lf') || args.include?('-fl')
+ l_flag = args.include?('-l') || args.include?('-lf') || args.include?('-fl')
427
+
428
+ processes.each do |p|
429
+ if l_flag
430
+ if f_flag
431
+ print_line("#{p['pid']} #{p['path']}")
432
+ else
433
+ print_line("#{p['pid']} #{p['name']}")
434
+ end
435
436
+ print_line("#{p['pid']}")
437
438
439
true
440
0 commit comments