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:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close