Hacking Gmail

(Grace) #1

70 Part II — Getting Inside Gmail


use Crypt::SSLeay;

my $ua = LWP::UserAgent->new();

$ua -> agent(“Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; .NET CLR 1.1.4322)”);

my $request = HTTP::Request->new(GET =>
‘https://gmail.google.com/’);

my $result = $ua->request($request);

if ($result->is_success) {
print $result->content;
} else {
print $result->status_line;
}

You can infer from actually doing it, or by using a script like the one above, that
the page continues with another redirect (or perhaps more than one), finally
ending up at https://www.google.com/accounts/ServiceLogin?
service=mail&continue=http%3A%2F%2Fgmail.google.com%2Fgmail,
as you can see in Figure 5-9.

FIGURE5-9: The Gmail login screen
Free download pdf