Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
whois_scrap_email
#!/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