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.

Timed 1 using c++


ghostraider100's Avatar
Member
0 0

Wat kind of skill which is required to beat dis challenges using c++. Could some1 help me plz!


ghostraider100's Avatar
Member
0 0

I want to know how to grab those things alone.


techb's Avatar
Member
0 0

You will need a way for your program to get the page. C++ could have some libs to help with cookie handling and what-nots, or you could use sockets. Sockets being the best way to go (my opinion). This might help you get started.


ghost's Avatar
0 0

techb wrote: libs to help with cookie handling and what-nots, or you could use sockets. That's an odd set of choices…


techb's Avatar
Member
0 0

I am in no way a C++ coder, and have only used it on occasion for embedded things. But I would assume there are third party libs to help with this kinda stuff, like cURL or something.


ghost's Avatar
0 0

techb wrote: I am in no way a C++ coder, and have only used it on occasion for embedded things. But I would assume there are third party libs to help with this kinda stuff, like cURL or something. There are, I'm just saying that what you said made it sound like the choice is between something that helps him manage temporary information stored on his own computer or something that would actually allow him to communicate with the website and allow him to solve it. Just seems sort of… disparate.


kaden's Avatar
Out-Of-Idea's Man!
20 0

the basics of all the timed challenges is this:

-visit HBH. -log into your user account. -visit the timed challenge page, and grab required information. -process what is given to you. -submit required information, in the way the challenge tells you to (GET/POST). -Rip out hair and repeat if it doesn't work.

I used java for all the timed ones I have done. I found it very easy tbh.

I reccomend you do some basic interaction with websites before you try these challenges. Simple GET/POST requests, etc.

will help you a lot.


ghost's Avatar
0 0

Simple example using HTTP requests (This is in AutoIt, and yes, it's fast enough). You can easily convert it to an other language, aslong as theres not a large amount of loops, the speed will barely make any difference tho.

Dim $fusion_user = 'fusion_user=FUSION_USER_HERE;'

Dim $HttpWebRequest = ObjCreate('winhttp.winhttprequest.5.1')```

GET
```markup$HttpWebRequest.Open('GET', 'http://www.hellboundhackers.org/challenges/timed/timedX/index.php', False)
$HttpWebRequest.SetRequestHeader('Cookie', $PHPSESSID & ' ' & $fusion_user)
$HttpWebRequest.Send()```

POST
```markup$HttpWebRequest.Open('POST', 'http://www.hellboundhackers.org/challenges/timed/timedX/index.php', False)
$HttpWebRequest.SetRequestHeader('Cookie', $PHPSESSID & ' ' & $fusion_user)
$HttpWebRequest.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
$HttpWebRequest.Send('POST_DATA')```

To get the source of the page after the request simply use
```markup$HttpWebRequest.ResponseText()```

AutoIt has alot useful string functions, it's easy, it's fast enough to do the trick, so why not.

Grabbing the word is as easy as (example in Timed1)
```markup__StringBetween($HttpWebRequest.ResponseText(), 'following random string: ', ' and answer like')```

But just use any language you feel good with I suppose. I personally don't have a favorite language at all, and I mastered alot of them. Henche, why I sometimes use 5 different languages on a single app.

It's irrelevant to me if others claim something is 'better' I just use whatever does what I require the best. Rewriting it in a language such as C++ will speed up the request by a few ms. However, you have to write about 60 more lines of code. If you ask me, that would be a waste of time.

> Sockets being the best way to go (my opinion).
^ Exactly what i'm talking about, why would it be better if it has the same end results? ;-)
Why spend more time on something that completes the challenge in 1 second, if you have 5 seconds to do it.

ghost's Avatar
0 0

If you really want to try doing it in c++, be prepared to do some reading. Unless you know of a good library to provide the functions necessary for decoding, be prepared to write your own decoder(this was what I did, so I don't know of any libraries off the top of my head you could use). After that, you have to worry about all the http stuff like reading the page, and for that I recommend cURL, but that's just my personal preference.

Also, whatever you do, don't copy and paste any code off of the web without reading up on it and understanding it fully. You'll never learn anything like that, and, afterall, the point of every challenge on this site is to learn from it.