Last active
June 30, 2016 15:58
-
-
Save KrustyHack/e485a93fd70cbe42188fbf3ad219f343 to your computer and use it in GitHub Desktop.
whois_scrap_email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DOMAINS=$1 | |
OUTPUT=$2 | |
if [ "$DOMAINS" == "" ]; then | |
echo "Usage : script.sh DOMAINS.txt (with one domain per line) OUTPUT.txt" | |
exit 1 | |
fi | |
if [ "$OUTPUT" == "" ]; then | |
echo "Usage : script.sh DOMAINS.txt (with one domain per line) OUTPUT.txt" | |
exit 1 | |
fi | |
mkdir -p /tmp/ | |
touch /tmp/krusty.hack | |
while read domain; do | |
echo "Looking $domain" | |
whois $domain |grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" >> /tmp/krusty.hack | |
sleep 10 | |
done < "$DOMAINS" | |
sort /tmp/krusty.hack |uniq > $OUTPUT | |
rm /tmp/krusty.hack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment