timed 3 - quick question
well to be honest im using c++ but i have no idea how to interact with webpages :ninja: , but i wrote a program already that hashed the wordlist into a new file. so using that file im trying to write a PHP script.
I was thinking of using two arrays and one index counter. then just strcmp() the hasharray[i] and the one on the webpage and then using that index to get the plaintext. (i'm really new to PHP so i couldnt be bothered with associative arrays :( ). Having never used PHP before, do you think will this be efficient enough to find the plain text in the time limit?
ps. i wrote the c++ program to output PHP array declarations… so i have a PHP script with two 100 element arrays in it. So all the hard work is already done!
sorry im really bad at explaining stuff :(
If you're using PHP try setting up an associative array for looking up a hash. So, before you connect to the webserver, open the wordlist and generate a hash for each word, using the hash as the key for each word in the associative array.
Then, later on when you're accessing the page, all you have to do is grab the hash, look it up in the associative array and post the answer.
PS. If you need help with associative arrays check out this guide, it is NOT as hard as you may think it is. Just consider them an array using a string as the index, rather than a integer. http://phpjournal.blogspot.com/2004/11/php-associative-arrays.html
Im sure richo will back me up here, python makes this dead easy, using a dictionary data structure, you can create entries in the format plaintext:hash, so you can compare the hashes and retrieve the plaintext with no hashing during the timed part. Im sure PHP has a similar data type. I'd give that a go.
gl
edit - By the looks of it those 'associative arrays' are the equivalent for PHP.
Yeah I used urllib2 and cookiejar and once I wrote the request framework, I reused it for all the timed challenges. Naturally if you're not a python wizard like richo you wont be writing your own libraries :p. Would be interested to see them though richo, any chance of posting them on ure freewebs/code bank/PMing them to me?
cheers
okay so forgive my lack of focus :P but i,m now writing it in greasemonkey and ive written it all and it works fine…but heres the thing. how the f**k do you search a webpage as if its a string in javascript? Thats the only part missing and then i can actually do all 4 challenges….
yeah so: can some one help me?
ps. me no likey python :P, beautifulsoup! say what?
edit - okay! so noone know how one may handle a website as a string?
>>> from hashlib import md5
>>> md5('SwartMumba').hexdigest()
'b55a71963c5a1eed3dcd00f54576b80c'
>>> print 'or'
or
>>> import md5
>>> md5.new('SwartMumba').hexdigest()
'b55a71963c5a1eed3dcd00f54576b80c'
>>> 'b55a71963c5a1eed3dcd00f54576b80c'=='b55a71963c5a1eed3dcd00f54576b80c'
True
>>>