Skip to content

Instantly share code, notes, and snippets.

@Eckankar
Created March 5, 2012 18:30
Show Gist options
  • Save Eckankar/1980186 to your computer and use it in GitHub Desktop.
Save Eckankar/1980186 to your computer and use it in GitHub Desktop.
Domain name finder
#!/usr/bin/env perl
use 5.012;
use warnings;
use Net::Whois::Raw;
$\ = "\n";
my @tlds = qw/dk se/;
my $wordlist;
open($wordlist, '<wordlist-da.txt');
my @words = <$wordlist>;
close($wordlist);
chomp @words;
@words = grep { !/[^A-ZÆØÅa-zæøå0-9\-]/ }
grep { length($_) < 8 } @words;
my $i = 0;
while ($i < 100) {
my $word = $words[int(rand(@words))];
my @domains = map { "$word.$_" } @tlds;
@domains = grep {
whois($_) =~ /(?:no match|not found|status:\s+free|no entries found)/si
} @domains;
if (@domains > 0) {
print join(", ", @domains);
$i += @domains;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment