gf
A wrapper around grep to avoid typing common patterns.
What? Why?
I use grep a lot. When auditing code bases, looking at the output of meg,
or just generally dealing with large amounts of data. I often end up using fairly complex patterns like this one:
Modify
Move path "~/.gf" >> "./examples"
Add paterns of https://github.com/1ndianl33t/Gf-Patterns
▶ grep -HnrE '(\$_(POST|GET|COOKIE|REQUEST|SERVER|FILES)|php://(input|stdin))' *
It's really easy to mess up when typing all of that, and it can be hard to know if you haven't got any
results because there are non to find, or because you screwed up writing the pattern or chose the wrong flags.
I wrote gf
to give names to the pattern and flag combinations I use all the time. So the above command
becomes simply:
Pattern Files
The pattern definitions are stored in ./examples
as little JSON files that can be kept under version control:
Install
If you've got Go installed and configured you can install gf
with:
▶ go get -u github.com/CapuzSec/gf-modify
My personal patterns that I've included as examples might not be very useful to you, but hopefully
they're still a reasonable point of reference.
Contributing
I'd actually be most interested in new pattern files! If you've got something you regularly grep for
then feel free to issue a PR to add new pattern files to the examples directory.
Bug fixes are also welcome as always :)