cURL help
Flash wrote: Wow, way-to-go.
Care to share?
Well, I don't wanna post my whole code as that's an instant spoiler, but here's what I was doing wrong:
After the initial cURL to get the page, I decided for some reason to use header( 'Location: http://www.hellboundhackers.org/challenges/timed/timed1/index.php?b64=.$var' ) ;
Among other things, until I decided that the best way to tackle it and use the very least time is to use cURL to get the page, like so:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.hellboundhackers.org/challenges/timed/timed2/index.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11");
curl_setopt($ch, CURLOPT_COOKIE,"PHPSESSID=censored; fusion_user=censored");
$result = curl_exec($ch);
curl_close($ch);
Then after the page has been processed, use the preg_match_all() function to find each string after "string: ". This information is stored in the $result variable (That's where the HTML of the page that cURL retrieved is). Single the variable out by selecting only one element out of the array like so: $matches[1][0] then it's a simple matter of using the base64_decode() function on $matches[1][0], and then use cURL once more to get the URL
http://www.hellboundhackers.org/challenges/timed/timed1/index.php?b64=
and append the variable to the end that you assigned to the base64_decode ($string=base64_decode($matches[1][0]); It should look very similar to the first cURL script, except the URL difference. The new URL option for cURL will look something like this:
curl_setopt($ch1, CURLOPT_URL,"http://www.hellboundhackers.org/challenges/timed/timed1/index.php?b64=" . $string);
Hope this helps, and I hope it's not a spoiler. If there are sections that spoil the challenges feel free to remove.
Well, I don't know if it is, there isn't much to it anyway. I just made my curl script for #1 and modified it accordingly for the next 3.
sharpskater80 wrote: Well, I don't know if it is, there isn't much to it anyway. I just made my curl script for #1 and modified it accordingly for the next 3.
Yeah I know, that's why I thought it may have been a spoiler. Because there's not much to it after cURL. Besides, I was kinda getting sick of seeing all these 'how do i hack hotmail' and mentor threads :p