moreutils
is a collection of great command line tools that allows me to write my recon automated scripts in a really clean way, without using ugly hacks like temporary files.
$ cat domains.txt | sort -u | grep -v filter | sponge domains.txt
$ combine domains.txt and newdomains.txt
$ combine newdomains.txt not domains.txt
$ combine file1.txt xor file2.txt
$ subfinder -d example.com | combine - not domains.txt > newdomains.txt
Let's say you have a script that automates some recon steps, and a script called notify.sh
that notifies you on slack or discord if new domains are found or something else.
You can use combine
to filter new domains, tee
to write them to a file and pipe them to ifne
that runs the specified command (./notify.sh
in this case) only if it the output of the previous command wasn't empty, i.e. there are new domains:
$ subfinder -d example.com | combine - not domains.txt | tee -a new.txt | ifne ./notify.sh
Let's say you want to run you usual recon routine, but before DNS resolution you want to filter out some domains manually.
Just pipe the domains in vipe
, it will open them in your editor, allowing you do filter the one you want and pass them along:
$ subfinder -d example.com | vipe | dnsx | httpx -title -status-code