Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

Time challenge 1 (using python)


ghost's Avatar
0 0

It seems that I am having a problem with loading the html source. When I load the source, it says "YOU MUST BE LOGGED IN TO PLAY!". Is it correct in me using the PHPSESSID:

dicHeaders = {'COOKIE': strSession}
req = urllib2.Request(url, None, dicHeaders)```

I do not understand, as this method worked on a different challenge on a different website.

ghost's Avatar
0 0

python ftw! :D

if it's python help you need, Richo's the man. and if it's php, system knows his stuff :)


SySTeM's Avatar
-=[TheOutlaw]=-
20 0

You need to send your fusion_user cookie too ;)


ghost's Avatar
0 0
class AppURLopener(urllib.FancyURLopener):
     version = "Firefox\r\n"+"Cookie:<enter cookie here>"

urllib._urlopener = AppURLopener()

the enter cookie here will be all of your cookies.


ghost's Avatar
0 0

Thanks guys I solved that problem -the moment I read System_meltdown's post- and have created another one!

This new problem is frustrating. I open the link, which is the answer, and I get the message "Wrong string, try again!" Obviously, the machine is telling me that my answer is wrong; but I have analyzed all the angles and my answer checks out.

How did I check my answer, you ask? Well, I printed out: the original html source, which contains the encoded string; the encoded string; the decoded string; the url (answer).

I checked if the printed out encoded string matches with the source. I then took that encoded string and decoded it with a translator, and then compared that decoded string with my program's decoded string, surprise surprise it checked out. All in all, everything seems to check out. I see no reason why it would not work. Haaaa, the joys of programming…

Where do I go from here?


ghost's Avatar
0 0

Are you sure you populated the answer box correctly (in your script) on the challenge page? I believe I found that it gives the "Wrong String" error if the string is empty, too.


ghost's Avatar
0 0

Check the last byte of the string as well.


ghost's Avatar
0 0

Okey, I have isolated the problem now. I commented out the code which sends the answer, and I ran my code. I obtained the answer, in printed form, and manually entered it into the address bar. I got "Wrong string, try again!"

On to experiment 1.2: I then proceeded to comment out my first request (where I obtain the html source in order to obtain the encoded string) and commented out the sending of the answer, and imputed the encoded string manually into my program. I took the answer, that my program created, and inputed the answer manually and I got the response "You took longer than a second!"; So I take it that that means my answer was correct.

Q?


ghost's Avatar
0 0

So, it looks like you finally got it to work (not quick enough, though) when you manually pulled the encoded string from the page's source. Have you checked to make sure that your script is finding the encoded string in its entirety? Try getting it to print a "before" and "after" of the string, then verify.


ghost's Avatar
0 0

Zephyr_Pure wrote: So, it looks like you finally got it to work (not quick enough, though) when you manually pulled the encoded string from the page's source. Have you checked to make sure that your script is finding the encoded string in its entirety? Try getting it to print a "before" and "after" of the string, then verify.

I don't think you understand why I did the experiments above; I did them to prove what was wrong with my program. I printed out every useful output that you can think of: the original html source, the html response source (when I submit my answer), the encoded string which I filtered out from the original source, the decrypted source; the final url (answer).

In layman's terms, my program does what it is supposed to do, i.e. if you comment out the retrieving of the original html source. Just to make sure my program filtered the encoded string out correctly, I even gave my program the mass of string to filter. Therefore, the original html source -that my program is receiving via my programs request- is corrupt, or something. Q


ghost's Avatar
0 0

Are you sure you're not making a separate request when sending after you get the answer for one already? That could be it.


ghost's Avatar
0 0

SwartMumba wrote: Therefore, the original html source -that my program is receiving via my programs request- is corrupt, or something. Q

hmph, excuses excuses.

keep in mind that unless you're using regular expressions or some other method that I don't know about, the answer you get may be affected by the length of the page HBH spits out back at you. since users are logging in and out, the amount of information in the "members online" section is constantly changing, and your program will have to be written to accommodate that.


ghost's Avatar
0 0

lesserlightsofheaven wrote: [quote]SwartMumba wrote: Therefore, the original html source -that my program is receiving via my programs request- is corrupt, or something. Q

hmph, excuses excuses.

keep in mind that unless you're using regular expressions or some other method that I don't know about, the answer you get may be affected by the length of the page HBH spits out back at you. since users are logging in and out, the amount of information in the "members online" section is constantly changing, and your program will have to be written to accommodate that.[/quote]

"hmph, excuses excuses," not actually. I am hypothesizing. With regard to your second paragraph: it does not matter how long the html source is, my program will find the encoded string.

Shrapskater80, I am not quite sure what you mean.


ghost's Avatar
0 0

so what's wrong with your program?

I don't understand from any of your previous posts what the current problem is.


ghost's Avatar
0 0

At this point, it looks like you will have to PM someone that has Python experience, unless you figure out the problem yourself. Anything else would constitute a spoiler.


ghost's Avatar
0 0

I was beginning to think that, for I am a python beginner and I have done all I know to do.

Are there any candidates who would like to look at my code?

Thanks in advance, SwartMumba.


ghost's Avatar
0 0

I am a beginner at Python as well, but I have experience with other languages, so I should be able to interpret the logic. You can PM me if you like. Otherwise, I'm sure one of the regular Python coders will catch this thread.


ghost's Avatar
0 0

Zephyr_Pure, I tried to send you another pm, but I got "Unable to send the Private Message. The user's inbox is full." This is the only other way I now to contact you. lol Can you please make space for one more pm?


ghost's Avatar
0 0

Is there someone ,who is good with python, who I can pm. I still have not solved the problem.


ghost's Avatar
0 0

im beginer in python but ive done the timed ones in python so i could try and help you out if you want


ghost's Avatar
0 0

Sorry about that, I pushed the wrong button (post reply). I should of pressed the 'send pm!' I guess someone can delete this thread as it is a waste of space. What a forehead smacking moment


ghost's Avatar
0 0

Hey SwartMumba, im having the same issue as you are. Have you figured out your solution?

edit: nvm, i got it :)