Skip to content

Instantly share code, notes, and snippets.

@KrustyHack
Last active June 30, 2016 15:58
Show Gist options
  • Save KrustyHack/e485a93fd70cbe42188fbf3ad219f343 to your computer and use it in GitHub Desktop.
Save KrustyHack/e485a93fd70cbe42188fbf3ad219f343 to your computer and use it in GitHub Desktop.
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