From 8e6fbcb4b5e71ede59ce413686a7c54318bc5b9c Mon Sep 17 00:00:00 2001 From: William Vu Date: Wed, 12 Jun 2019 19:13:02 -0500 Subject: [PATCH 1/2] Concatenate path and name in Meterpreter pgrep -lf --- .../meterpreter/ui/console/command_dispatcher/stdapi/sys.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb index e351ca35a4..1ef4e43df7 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb @@ -571,7 +571,7 @@ class Console::CommandDispatcher::Stdapi::Sys processes.each do |p| if l_flag if f_flag - print_line("#{p['pid']} #{p['path']}") + print_line("#{p['pid']} #{p['path']}#{client.fs.file.separator}#{p['name']}") else print_line("#{p['pid']} #{p['name']}") end From bcee6f0dc2df8ac7e1b95714aed02fce561f4062 Mon Sep 17 00:00:00 2001 From: William Vu Date: Thu, 13 Jun 2019 10:30:36 -0500 Subject: [PATCH 2/2] Join full path nicely --- .../meterpreter/ui/console/command_dispatcher/stdapi/sys.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb index 1ef4e43df7..042275e968 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb @@ -571,7 +571,9 @@ class Console::CommandDispatcher::Stdapi::Sys processes.each do |p| if l_flag if f_flag - print_line("#{p['pid']} #{p['path']}#{client.fs.file.separator}#{p['name']}") + full_path = [p['path'], p['name']].join(client.fs.file.separator) + + print_line("#{p['pid']} #{full_path}") else print_line("#{p['pid']} #{p['name']}") end