Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

prhook

A tool for sorting text and files by regex templates with support for recursion, nested categories, and custom delimiters.

Installation

git clone https://github.com/amn3zi4/prhook
cd prhook
chmod +x prhook.sh

System-wide install

cd prhook
sudo make install

Uninstall

cd prhook
sudo make uninstall

Options

FlagDescription
-t, --templatetemplate file (required)
-f, --fileinput file or directory
-if, --input-formattext or files (default: text)
-of, --output-formattext or files (default: text)
-o, --outputoutput directory (default: output)
-s, --separatorword separator (e.g. -s ,)
-r, --recursiverecursive directory processing
-a, --addadd to existing results
-Da, --delete-adddelete old files before adding
-Se, --save-emptykeep empty lines
-h, --helpshow help

Template format

  • Odd lines → category names (folder names)
  • Even lines → regex patterns for grep -E
  • - at the end of category → exclusion (grep -v)
  • / for nested folders

Template example (templates/critical_endpoints.txt)

ADMIN
admin|dashboard|console
API
api|graphql|v1
IGNORE_ADMIN -
test|dev|stage

Usage examples

1) Standard usage

cat examples/subdomains.txt | ./prhook.sh -t templates/critical_endpoints.txt
# Results in output/

2) With custom separator

./prhook.sh -s "\. " -t templates/apples.txt -f examples/some_text.txt
# Results in output/some_text.txt/

3) Sort by content

./prhook.sh -c -f examples/some_files/ -t templates/dates.txt #results in output/

Documentation

See GUIDE.md for details.

License

MIT © amn3zi4

About

Sort text and files by regex templates with recursion, nested categories and custom word separators, recommended for bug-bounty (sorting and filtering subdomains)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages