Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

real 2 php script - help needed*Spoilers*


ghost's Avatar
0 0

dudes could someone check out my script and let me know whats wrong casue it just wont run i think it might be the parser and not the code

<?php

function UrlExists($url)
{
    if(strstr($url, "http://")) $url = str_replace("http://", "", $url);
    $fp = @fsockopen($url, 80);
    if($fp == false) return false;// was ===
    return true;
}

bool $PageIsValid = false; 
$OriginalUrl="http://www.hellboundhackers.org/challenges/real2/backups/";
$TestedUrl;
for($Month=1;$Month<13;$Month++)
{
	for($Day=1;$Day<32;$Day++)
	{
		for($Hour=0000;$Hour<2400;$Hour+=100)
		{
			if($Hour<1000)
			{
				$TestedUrl=$OriginalUrl."backup_2004-".$Month."-".$Day."_0".$Hour.".sql";
			}
			if($Hour==0)
			{
				$TestedUrl=$OriginalUrl."backup_2004-".$Month."-".$Day."_000".$Hour.".sql";
			}
			$PageIsValid = UrlExists($TestedUrl);
			if($PageIsValid==true)
			{
				echo $TestedUrl;
			}
		}
	}
}
	
?>

thanx in advance:D


ghost's Avatar
0 0

I don't know much of php so i can't help you that way, but i suggest you to use cUrl…it simplifies a lot. Google for it…you can use libcurl iside your php script, or you can use a commend line application ( which is the way i did this challenge ).