Add -S filters to netstat, ls, and ps meterpreter commands #800

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

sempervictus commented Sep 18, 2012

This commit adds the -S flags to ls and ps stdapi commands which
convert their argument to a regular expression. Output is filtered
to match the regexp, allowing for filtering processes and dir
content by any attribute as they are all converted to strings for
matching.

Testing:
Apply patch, get meterpreter session. Run 'ps -S "ram files|
system"' to see all processes running as system or from
program files. Run 'ls -S "fil.*sys" C:' to see all files in
C:\ containing "sys" in the filename.

Contributor

sempervictus commented Sep 18, 2012

This pull request came about from
#768
and
#799
This is a cleaned up version of code i had in my repo months ago, but removed due to merge conflicts.

RageLtMan added some commits Sep 18, 2012

RageLtMan
Add -S filters to ls and ps meterpreter commands
This commit adds the -S flags to ls and ps stdapi commands which
convert their argument to a regular expression. Output is filtered
to match the regexp, allowing for filtering processes and dir
content by any attribute as they are all converted to strings for
matching.

Testing:
  Apply patch, get meterpreter session. Run 'ps -S "ram files|
  system"' to see all processes running as system or from
  program files. Run 'ls -S "fil.*sys" C:\\' to see all files in
  C:\ containing "sys" in the filename.
RageLtMan
Add search filter to netstat
Same as ps and ls commands, adds -S switch for regular expression
based search through the resulting rows. Adds proper opts and help
to net.rb for netstat command as well.

Testing: netstat -S 445 to see all SMB connections
Contributor

todb-r7 commented Sep 24, 2012

Closing due to indeterminate provenance

@todb-r7 todb-r7 closed this Sep 24, 2012

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