Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Findpids #768

Closed
wants to merge 7 commits into
from

Conversation

Projects
None yet
4 participants

had issues getting the remote branch updated, so issuing a new PR with the requested enahncements

David Maloney added some commits Aug 30, 2012

Adds a new findpids command to meterpreter
findpids calls client.sys.process.get_processes like ps
but then filters out any processes that do not match
one of the process names supplied as arguments to the command.
`findpids explorer.exe notepad.exe` will return all processes
named explorer.exe or notepad.exe Allows for quick searching for
the pid you want. ideal for migration
Contributor

jlee-r7 commented Sep 6, 2012

needs a cmd_findpids_help method as well.

Contributor

sempervictus commented Sep 9, 2012

Would it make more sense to implement the -S flag like we use in the console DB commands? That way we can search by process name, arch, user name, etc? I had this working in my branch for a while but it caused merge conflicts so got pulled. Worked with the ls command as well. I can dig up the diffs if interested.

@jlee-r7 moved help text into the serate method as you requested

Contributor

mubix commented Sep 16, 2012

As discussed in IRC, suggeting instead of a new name /command just add the functionality to 'ps', it doesn't have any arguments at the current time so it would be good to add some.

David Maloney added some commits Sep 19, 2012

rolled changes into existing ps command
Some users requested this be added to the ps
command via a -S opt instead of creating a new command.
This limits the search to only one search parameter at a time
but with the ability to pass RegEx I think that's fine

@jlee-r7 @mubix as requested this now is modifying the existing ps command. i think people will find this useful, i know i sure will.

Contributor

sempervictus commented on 14c94e4 Sep 19, 2012

I've got similar functionality in #800, where ps -S searches through all of the columns, allowing search by name, user, arch, etc. Same thing for ls -S

@ghost ghost assigned jlee-r7 Oct 5, 2012

@jlee-r7 jlee-r7 commented on the diff Oct 9, 2012

...terpreter/ui/console/command_dispatcher/stdapi/sys.rb
@@ -284,6 +339,29 @@ def cmd_ps(*args)
return true
end
+ def cmd_ps_help
+ 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:"
+
+ tbl = Rex::Ui::Text::Table.new(
@jlee-r7

jlee-r7 Oct 9, 2012

Contributor

why not @@ps_opts.usage?

@jlee-r7 jlee-r7 referenced this pull request in thelightcosine/metasploit-framework Oct 22, 2012

Merged

Use opts.usage instead of a Table #1

@jlee-r7 jlee-r7 referenced this pull request Oct 22, 2012

Closed

Findpids #950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment