May 20, 2012, 12:53:49 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: THC is up and running !
 

 
advertisement:

Pages: [1]
  Print  
Author Topic: HBH Timed 6  (Read 984 times)
zomgwtfbbq
Challenge Coder
Administrator
Hero Member
*****

Karma: +31340/-1
Posts: I am a geek!!


thc title: thc elite
thc points: 3315
challenges: (69/83)

View Profile
« on: September 20, 2008, 09:44:54 PM »
Share on FacebookFacebook Share

Quote
Your objective is to get the second result from the Google UK © search engine for the word: matrix and post back the URL of the second result, encoded in base64, as follows: url=base64_encoded_url
Don't forget to change the CURLOPT_COOKIE option value to your own cookie.

Notice: I have to admit that I wasn't sober when I wrote this piece of code, it's not very effective really.
However it did finish the challenge for me after several attempts, if the script doesn't work just reply here, so I can make some modifications.
<?php
while(true){
	
$curl curl_init();
	
curl_setopt($curlCURLOPT_URL,"http://www.hellboundhackers.org/challenges/timed/timed6/index.php");
	
curl_setopt($curlCURLOPT_RETURNTRANSFER1);
	
curl_setopt($curlCURLOPT_FOLLOWLOCATION1);
	
curl_setopt($curlCURLOPT_REFERER,"http://www.hellboundhackers.org/challenges/timed/timed5/index.php");
	
curl_setopt($curlCURLOPT_VERBOSE1);
	
curl_setopt($curlCURLOPT_COOKIE,"fusion_user=xxx.xxxxxxxxx; PHPSESSID=xxxxxxxxxxxx;");
	
curl_setopt($curlCURLOPT_USERAGENT"Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5");
	
$result curl_exec($curl);
	
curl_close($curl);
	
@
preg_match_all('/<strong>([a-z]+)<\/strong> and/',$result,$aMatches);
	
@
preg_match_all('/the ([a-z]+) result/',$result,$aResults);
	
// search
	
$sSearch $aMatches[1][0];
	
// offset
	
$sOffset $aResults[1][0];
	
$aOffset = array();
	
$aOffset['first'] = "1";
	
$aOffset['second'] = "2";
	
$aOffset['third'] = "3";
	
$aOffset['fourth'] = "4";
	
$aOffset['fifth'] = "5";
	
$aOffset['sixth'] = "6";
	
$aOffset['seventh'] = "7";
	
$aOffset['eighth'] = "8";
	
$aOffset['ninth'] = "9";
	
$aOffset['tenth'] = "10";
	
$iOffset $aOffset[$sOffset];
	
echo 
"trying string ".$sSearch." as ".$iOffset."
\n"
;
	
//flush();
	
//ob_flush();
	
$curl1 curl_init();
	
curl_setopt($curl1CURLOPT_URL,"http://www.google.co.uk/search?hl=nl&q=".$sSearch."&btnG=Google+zoeken&meta=");
	
curl_setopt($curl1CURLOPT_POST0);
	
curl_setopt($curl1CURLOPT_RETURNTRANSFER1);
	
curl_setopt($curl1CURLOPT_FOLLOWLOCATION1);
	
curl_setopt($curl1CURLOPT_COOKIE,"fusion_user=xxx.xxxxxxxxx; PHPSESSID=xxxxxxxxxxxx;");
	
curl_setopt($curl1CURLOPT_USERAGENT"Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5");
	
curl_setopt($curl1CURLOPT_REFERER,"http://www.hellboundhackers.org/challenges/timed/timed6/index.php");
	
$result1 curl_exec($curl1);
	
curl_close($curl1);
	
@
preg_match_all("/<a href=\"(.*)\"/Ui",$result1,$aMatches1);
	
$iTemp 0;
	
$sTemp "";
	
for(
$x=0;$x<count($aMatches1[1]);$x++){
	
	
if(
$aMatches1[1][$x][0]!="h"){
	
	
	
continue;
	
	
}
	
	
if(
ereg("google",$aMatches1[1][$x])){
	
	
	
continue;
	
	
}
	
	
$iTemp++;
	
	
if(
$iTemp==$iOffset){
	
	
	
$sTemp .= $aMatches1[1][$x];
	
	
	
break;
	
	
}
	
}
	
$sPrev $sTemp;
	
$curl2 curl_init();
	
curl_setopt($curl2CURLOPT_URL,"http://www.hellboundhackers.org/challenges/timed/timed6/index.php");
	
curl_setopt($curl2CURLOPT_RETURNTRANSFER1);
	
curl_setopt($curl2CURLOPT_FOLLOWLOCATION1);
	
curl_setopt($curl2CURLOPT_POST1);
	
curl_setopt($curl2CURLOPT_POSTFIELDS"url=".base64_encode($sPrev));
	
curl_setopt($curl2CURLOPT_REFERER,"http://www.hellboundhackers.org/challenges/timed/timed6/index.php");
	
curl_setopt($curl2CURLOPT_VERBOSE1);
	
curl_setopt($curl2CURLOPT_COOKIE,"fusion_user=xxx.xxxxxxxxx; PHPSESSID=xxxxxxxxxxxx;");
	
curl_setopt($curl2CURLOPT_USERAGENT"Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5");
	
$result2 curl_exec($curl2);
	
curl_close($curl2);

	
if(!
ereg("Wrong string",$result2)){
	
	
echo
"gotcha!!!!!";
	
	
break;
	
}
	
echo 
"failed
\n"
;
	

}

?>
Logged


only registered users with at least 25 hack challenge points can see links:
  click here in order to visit the hack challenges


Ook al ben ik een slet toch houdt ik van je..
freakazoid
Newbie
*

Karma: +10/-0
Posts: 1

thc title: 3t3rn4l n00b
thc points: 0
challenges: (0/83)

View Profile
??
« Reply #1 on: October 29, 2008, 11:44:36 PM »
Share on FacebookFacebook Share

nope no good mine dont work either:sad:sad
Logged
Pages: [1]
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
RSS: OpenFeint gets SMS invites, timed leaderboards
Internet News
zomgwtfbbq 0 56 Last post August 18, 2010, 05:12:17 PM
by zomgwtfbbq
SMF Board hacked and modded by zomgwtfbekjam aka Rembo from Tools & Design