Skip to content

Instantly share code, notes, and snippets.

Last active January 1, 2016 22:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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 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, …
print "Reading schat.csv\n";
open ( my $schat, "<schat.csv") || die "Can't open schat.csv: $!";
my @snaps = <$schat>;
chomp( @snaps );
print "Reading\n";
open ( my $contacts, "<") || die "Can't open $!";
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];
if ( $phone eq $friend ) {
print " Number $phone potentially matches contact. Snapchat user is $foo[1] in $foo[2]\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment