Skip to Main Content
Google Hacking for Penetration Testers
book

Google Hacking for Penetration Testers

by Johnny Long
December 2004
Intermediate to advanced content levelIntermediate to advanced
448 pages
16h 25m
English
Syngress
Content preview from Google Hacking for Penetration Testers
my ($myquery) = @_;
print $socket ("GET $myquery HTTP/1.0\n\n");
while ($line = <$socket>)
{
if ($line =~ /Results.*of\sabout/)
{
return $line;
}
}
}
#Section 5
############################
sub getTotalHits($)
{
my ($ourline) = @_;
$hits="";
$index = index($ourline, "of about");
$str = substr($ourline, $index, 30);
@buf=split(//,$str);
for ($i = 0; $i < 30; $i++)
{
if ($buf[$i] =~ /[0-9]/)
{
$hits=$hits.$buf[$i];
}
}
return $hits;
}
############################
#Section 6
socketInit();
$string = sendQuery($query);
$totalhits = getTotalHits($string);
www.syngress.com
388 Chapter 12 • Automating Google Searches
315_PTG_12.qxd 11/22/04 12:18 PM Page 388
#Printing to STDOUT the Total ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google Hacks

Google Hacks

Tara Calishain, Rael Dornfest
Dissecting the Hack

Dissecting the Hack

Jayson E Street

Publisher Resources

ISBN: 1931836361