question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filename regex is applied to the path and not only to the filename

See original GitHub issue

As usual thanks so much for your awesome work on GRR!

When using list process flow, the option filename regex is also applied to the path and not only to the filename. Analysts aren’t aware of that and the documentation on the field is hiding that important information 😃

See ListProcessesArgs in the flows.proto file

https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/proto/grr_response_proto/flows.proto#L1435

The check is made against the “exe”-property of the process as seen in the processes flow implementation (_FilenameMatch).

https://github.com/google/grr/blob/0671ba57bc585c4e1baaabfafae001d19dcc397a/grr/server/grr_response_server/flows/general/processes.py#L39

Question: Would it be possible to extend the description that the regex is applied to the whole path?

Thanks in advance for your feedback.


While going through the code, I saw that you only use your match function once in IterateProcesses.

When using fetch binaries

https://github.com/google/grr/blob/0671ba57bc585c4e1baaabfafae001d19dcc397a/grr/server/grr_response_server/flows/general/processes.py#L62

vs the match for only listing processes

https://github.com/google/grr/blob/0671ba57bc585c4e1baaabfafae001d19dcc397a/grr/server/grr_response_server/flows/general/processes.py#L83

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
max-voglercommented, May 16, 2019

Thanks for raising the issue, Karneades. Much appreciated 👍

I have fixed the description in our internal version control system. The change will be pushed to GitHub in the next days.

As for your second note: It’s right that the match function should be reused. The whole logic in ListProcesses is somewhat convoluted, so that’s a bigger refactoring effort.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regex for extracting filename from path - Stack Overflow
This question is vague as it only contains one example of path and filename structure. Regex is used to match and/or capture different ......
Read more >
Regex for filename - Studio - UiPath Community Forum
I am trying to use regex in order to get the filename. the filename is Supplier Creation Details - Clarisity Solutions 2.
Read more >
Path.GetFileName Method (System.IO) - Microsoft Learn
Returns the file name and extension of a file path that is represented by a read-only character span.
Read more >
File Names - Duplicate File Detective
During the duplicate file search process, every file's name is examined and compared against the settings defined in the File names section of...
Read more >
Searching Files and Filenames - Computing from the ...
You can use -regex and -iregex (case-insensitive) to match filenames based on regular expressions. In this case, the pattern will match the entire...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found