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.

cURL help


ghost's Avatar
0 0

Every time I try to use my cURL script, it always takes longer than 1 second to load and I can't seem to get it to work whatsoever, even through the night when nobody is on. I haven't really thought of any other method to use, can anyone maybe point me in a direction I'm lost :\


spyware's Avatar
Banned
0 0

What is your host?


ghost's Avatar
0 0

spyware wrote: What is your host?

I'm hosting locally.


spyware's Avatar
Banned
0 0

Maybe it's your internet connection. But more possible would be you haven't optimized your code. Try to optimize it, when you open the connection immediately create and post your data.


ghost's Avatar
0 0

Bleh I'm stumped. Would anyone care to take a look at my script and see if I'm doing it right or wrong plz?


ghost's Avatar
0 0

I would care.


ghost's Avatar
0 0

Got it.


ghost's Avatar
0 0

Wow, way-to-go.

Care to share?


ghost's Avatar
0 0

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.


ghost's Avatar
0 0

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.


ghost's Avatar
0 0

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