exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

googlegath.txt

googlegath.txt
Posted Dec 8, 2006
Authored by Matteo Cantoni | Site nothink.org

googlegath is a free open source utility to obtain informations through Google searches. It could be useful for penetration testing, security scanning, etc. googlegath has been tested on GNU/Linux, *BSD systems.

tags | web
systems | linux, bsd
SHA-256 | e754e380fcd9e0ba64eeb22cf691c7a8ed0da8b395cb718921623b3649666ab1

googlegath.txt

Change Mirror Download
#!/usr/bin/perl

#
# googlegath.pl - simple Google-Search to gathering site/domain informations;
# Copyright (c) 2006 by Matteo Cantoni <goony@nothink.org>
#
# Note: put your google's key in "GOOGLE_KEY" (http://www.google.com/apis/)
#

use strict;

use Getopt::Std;
use Net::Google;

use constant GOOGLE_KEY => "INSERT YOUR KEY";

my $name = "googlegath.pl";
my $version = "v0.3";
my $description = "simple Google-Search to gathering site/domain informations";
my $copyright = "Copyright (c) 2006";
my $author = "Matteo Cantoni <goony\@nothink.org>";

our ($opt_a, $opt_i, $opt_t, $opt_s, $opt_f, $opt_k, $opt_m, $opt_d, $opt_l, $opt_h);

my $usage = "$name $version - $description\n$copyright by $author\n
Usage ./$name [-a allinurl] [-i inurl] [-t intitle] [-s site/domain] [-f filetype] [-k keyword] [-m max_results] [-d debug] [-l logfile.html] [-h]

-m, default max_results is 100;
-d, enable debug: print url, domains and rdns;
-l, enable logging in html format;

Examples\n
./$name -a /backup/ -s gov -f txt -m 16
./$name -a /cgi-bin/ -s com -k awstats -m 10 -d
./$name -a /cgi-bin/ -s de -f pl -m 10 -d
./$name -a /scripts/ -s edu -f cgi -m 10 -l logfile.html
./$name -s edu -f cgi -m 20 -d
./$name -t \"VNC Desktop\" -i 5800 -m 10 -d -l logfile.html
./$name -i \"main.php\" -k \"phpMyAdmin\" -s com -m 10\n
";

getopts('a:i:t:s:f:m:k:dl:h');
die $usage if $opt_h;
die $usage if !$opt_a && !$opt_i && !$opt_t && !$opt_k && !$opt_s && !$opt_f;

$|=1;

my $allinurl = $opt_a || "";
my $inurl = $opt_i || "";
my $intitle = $opt_t || "";
my $site = $opt_s || "";
my $filetype = $opt_f || "";
my $keyword = $opt_k || "";
my $max_results = $opt_m || 100;

my $localtime = localtime();

my $google = Net::Google->new(
key=>GOOGLE_KEY
);

if ($opt_l){
open (LOG, ">$opt_l") || die " Cannot open the log file: $!\n";
print LOG "<html><head><title>$name log file</title><body>\n";
print LOG "<h2>$name log file</h2>\n";
print LOG "<h3>$localtime</h3>\n";
}

print "$name $version - $description\n$copyright by $author\n";

if ($allinurl){
$allinurl = "allinurl:$allinurl";
}else{
$allinurl = "";
}

if ($inurl){
$inurl = "inurl:$inurl";
}else{
$inurl = "";
}

if ($intitle){
$intitle =~ s/^|$/"/g;
$intitle = "intitle:$intitle";
}else{
$intitle = "";
}

if ($site){
$site = "site:$site";
}else{
$site = "";
}

if ($filetype){
$filetype = "filetype:$filetype";
}else{
$filetype = "";
}

if ($keyword){
$keyword =~ s/^|$/"/g;
}else{
$keyword = "";
}

my $string = "$allinurl $inurl $intitle $site $filetype $keyword";

$string =~ s/^\s\s+|\s\s+$//g;
print "\n[+] $string\n\n";
print LOG "\n<b><font color=#770000>$string</font></b><br><br>" if $opt_l;

scan($string);

print "\n";

if ($opt_l){
print LOG "</body>\n</html>";
close LOG;
print "[+] log file $opt_l created.\n";
}

exit(0);

sub scan {
my $string = shift;

my $search = $google->search(
max_results=>$max_results
);

$search->query(($string));

foreach my $r (@{$search->response()}){
my @results = map { $_->URL(); } @{$r->resultElements()};
foreach my $res(@results){

if ($opt_d){
my (undef,$site) = split(/http:\/\/|https:\/\//,$res);
($site,undef) = split(/\//,$site);

if ($site !~ /\w+\:\d+|(\d+)\.(\d+)\.(\d+)\.(\d+)\:\d+/g){
my $addr = gethostbyname("$site");
my $ip_add = join('.', unpack("C*",$addr)) || "-";

print "$res $site $ip_add\n";
print LOG "<a href=\"$res\">$res</a> <i>$site $ip_add</i><br>" if $opt_l;
}else{
my (undef,$addr,undef) = split(/\:/,$res);
$addr =~ s/\/+//g;
my $ip_add = gethostbyname("$addr");
$ip_add = join('.', unpack("C*",$ip_add)) || "-";
print "$res $addr $ip_add\n";
print LOG "<a href=\"$res\">$res</a><br>" if $opt_l;
}
} else{
print "$res\n";
print LOG "<a href=\"$res\">$res</a><br>" if $opt_l;
}
}
}
}
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close