That chubby swede (sleepy) wrote,
That chubby swede
sleepy

  • Mood:
  • Music:
I hacked up a little perl script (my very first) to generate shitloads of fake email addresses, to throw sticks into the spam machinery... I dumped the resulting output here... for spambots and harvesters to pick up. I calculated that I can generate in the neighborhood of 100M 342M fake addys...



Yes, It's poorly commented.. but here goes...

---
#!/usr/local/bin/perl
# 2002-12-13 23:40 Initial version (sleepy)

BEGIN { require 5.004 }

use integer; # standard pragmas
use IO::File;
# use strict;

# Dictionaries with Firstnames, Lastnames and Domainnames... :)
$dict_fn = 'firstnames.txt';
$dict_ln = 'lastnames.txt';
$dict_dn = 'domains.txt';

# Output file
$writehere = 'valid-emails.txt';

# Arrays for dictionaries
my @fn_dict;
my @ln_dict;
my @dn_dict;

sub loaddicts() {

$fn_dict = new IO::File($dict_fn) || die "dictfile $dict_fn: $!";
$fn_dict_size = 0;
while (<$fn_dict>) {
chop;
push @fn_dict, $_;
$fn_dict_size++;
}

$ln_dict = new IO::File($dict_ln) || die "dictfile $dict_ln: $!";
$ln_dict_size = 0;
while (<$ln_dict>) {
chop;
push @ln_dict, $_;
$ln_dict_size++;
}

$dn_dict = new IO::File($dict_dn) || die "dictfile $dict_dn: $!";
$dn_dict_size = 0;
while (<$dn_dict>) {
chop;
push @dn_dict, $_;
$dn_dict_size++;
}
}

sub generate() {
for $i (1..10000) {
srand();

$f = $fn_dict[int rand $fn_dict_size];
$l = $ln_dict[int rand $ln_dict_size];
$d = $dn_dict[int rand $dn_dict_size];

$type = int rand 7;
if($type == 0) {
$buff .= $f . "." . $l . "@" . $d . "\n\r";
}
if($type == 1) {
$buff .= $f . "_" . $l . "@" . $d . "\n\r";
}
if($type == 2) {
$buff .= $f . "-" . $l . "@" . $d . "\n\r";
}
if($type == 3) {
$buff .= $l . "." . $f . "@" . $d . "\n\r";
}
if($type == 4) {
$buff .= substr($f,1,1) . "." . $l . "@" . $d . "\n\r";
}
if($type == 5) {
$buff .= $f . "." . substr($l,1,1) . "@" . $d . "\n\r";
}
if($type == 6) {
$buff .= substr($f,1,1) . "_" . $l . "@" . $d . "\n\r";
}
if($type == 7) {
$buff .= $f . "_" . substr($l,1,1) . "@" . $d . "\n\r";
}

}
}

sub DoOutput() {
$myoutput = new IO::File('>' . $writehere) || die "$writehere could not be opened";
print $myoutput $buff;
close $myoutput;
}

sub main() {
loaddicts();
&generate;
# print $buff;
DoOutput();
exit 0
}
main();
---

Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 4 comments