public
Last active

Perl script to match a list of US phone numbers to the leaked Snapchat database of phone numbers and user names. Run in the same directory as the schat.csv file, and another file called contacts.tel that contains a list of US phone numbers—one number per line in the file. Since the final two digits of the number are obscured in the leaked file, you'll potentially get multiple matches per phone number.

  • Download Gist
contacts.pl
Perl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
#!/usr/bin/perl
 
print "Reading schat.csv\n";
open ( my $schat, "<schat.csv") || die "Can't open schat.csv: $!";
my @snaps = <$schat>;
close($schat);
chomp( @snaps );
 
print "Reading contacts.tel\n";
open ( my $contacts, "<contacts.tel") || die "Can't open contacts.tel: $!";
my @friends = <$contacts>;
close ($contacts);
chomp( @friends );
 
my $i = 1;
my $j = scalar @friends;
foreach my $friend ( @friends ) {
 
print "Looking at number $friend\n";
print " Number $i of $j\n";
chop( $friend );
chop( $friend );
chop( $friend );
$i = $i + 1;
 
foreach my $snap ( @snaps ) {
$snap =~ s/"$//;
$snap =~ s/^"//;
$snap =~ s/","/,/g;
my @foo = split ",", $snap;
my $phone = $foo[0];
chop($phone);
chop($phone);
if ( $phone eq $friend ) {
print " Number $phone potentially matches contact. Snapchat user is $foo[1] in $foo[2]\n";
}
}
 
}
 
exit;

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.