#start checking 3.8.6 DataBase information leak vuln

dprint("Core Vbulletin Vulnerability");
if($ver =~ m/3\.8\.6/i){
    print color("yellow");
    $vtmp="vBulletin 3.8.6 faq.php Information Disclosure vulnerability \n EDB : https://www.exploit-db.com/exploits/14455/\n";
    $source=$ua->get("$target/faq.php?s=&do=search&q=Database&match=all&titlesonly=0")->decoded_content;
    if($source =~ m/Host/i and $source =~ m/Port/i){
        $vtmp.="faq.php is vulnerable\n DataBase configuration path : $target/faq.php?s=&do=search&q=Database&match=all&titlesonly=0";
    }else{
        $vtmp.="faq.php is not vulnerable\n\n";
    }
}
#end checking 3.8.6 DataBase information leak vuln
open(my $DB,"exploit/vbscandb.txt");
my $vver=substr($ver, index($ver, ' ')+1, 6);
$vver =~ s/ //g;
while( my $row = <$DB>)  {
    chomp $row;
    my $fv=substr($row, 0, index($row, '|'));
    my $fd=substr($row, index($row, '|')+1, 1000);
    my @sbug = split /,/, $fv;
    foreach $bs(@sbug){
        if(($vver =~ m/$bs/i) && (substr($vver, 0, 1) eq substr($bs, 0, 1))){
            $fd =~ s/\$target/$target/g;
            $fd =~ s/\\n/\r\n/g;
            $fd =~ s/\|/\r\n\r\n/g;
            $vtmp.="$fd\n\n";
            $vvtf=1;
        }
    }
}
if($vvtf==1){tprint("$vtmp");}else{fprint("Target vbulletin core is not vulnerable");}

close $DB;