exploit the possibilities

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
MD5 | 7258710bb9b915f89b5a84dcbc1c06ae

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:

September 2020

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close