Programming 1

Put your programming skills to the test in these challenges.

Re: Programming 1

Post by Slim420 on Tue Jan 12, 2010 1:47 pm
([msg=33267]see Re: Programming 1[/msg])

Wow, 30 seconds almost isnt long enough, and there was about an 8 second gap between the javascript timer on the button and the server time. The few tries right before i finally passed it I was clicking the button with 5-7 seconds left and by the time the results page showed up it was say i was late by 0.2-1.7secs. The time that I passed it I had 9 seconds left on the button, but it didnt tell me how long it took, so its more than 7 second and less than 9.

My guess is that the server timer starts as soon as the page starts loading and the javascript timer starts when the content is loaded, and I get about 2-3 seconds of lag after the page header is loaded, before the content shows up (and i can copy the wordlist) and the javascript timer starts.

I feel really bad for anyone having to do this one on a dial-up connection :cry: .

Now that I'm done bitching about it, I must say, it was a fun little exercise ;) .

I did it in python, and at first i was having issues with the words that had multiple occurrences of the same letter, because as it was checking each different letter in the scrambled words, but the first occurrence of the letter would trigger a match :evil: . So in the end I found a much better way to organize and compare the strings 8-) . All i had to do was copy the scrambled words into a text file, save it, then run the python script (just pressing F5) then copy the results in the textbox on the webpage.

Slim420
Basic: (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)
Realistic: (1)(2)(3)(4)(5)(6)(7)(8)
Application: (1)(2)(3)(4)
Programming: (1)(2)
Javascript: (1)(2)(3)(4)(5)(6)(7)
Extbasic: (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14)
Stego: (1)(3)(4)(5)(6)(7)(8)(10)
Slim420
New User
New User
 
Posts: 19
Joined: Thu Dec 31, 2009 12:34 am
Blog: View Blog (0)


Re: Programming 1

Post by faazshift on Tue Jan 12, 2010 3:05 pm
([msg=33273]see Re: Programming 1[/msg])

Slim420 wrote:Wow, 30 seconds almost isnt long enough...

Well my program could have handled a second or two. I fully automated everything (login, word extraction, solving, and submission). Try prog 11 (you only get 3 seconds).
faazshift
Contributor
Contributor
 
Posts: 516
Joined: Wed Jun 03, 2009 3:55 pm
Location: Riverton, Utah
Blog: View Blog (0)


Re: Programming 1

Post by Slim420 on Wed Jan 13, 2010 10:22 am
([msg=33308]see Re: Programming 1[/msg])

faazshift wrote:
Slim420 wrote:Wow, 30 seconds almost isnt long enough...

Well my program could have handled a second or two. I fully automated everything (login, word extraction, solving, and submission). Try prog 11 (you only get 3 seconds).


Hehe, yeah, I figured less time limits were coming :o .

Automating the login was gonna be my next step if i couldn't get it in time. Honestly with this being the first challenge in the category I wanted to try and get it with the least lines of code as possible. I did try just grabbing the page, but it wouldnt let me without logging in, and i didnt want to send a whole bunch of requests with my username/pw info (I'm just waayyy over paranoid). Although, it seems that is gonna have to be the case in the later missions :roll: . Depending on the mission though I may just get it to work first (like i did with this one), then work out the authentication.

Slim420
Basic: (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)
Realistic: (1)(2)(3)(4)(5)(6)(7)(8)
Application: (1)(2)(3)(4)
Programming: (1)(2)
Javascript: (1)(2)(3)(4)(5)(6)(7)
Extbasic: (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14)
Stego: (1)(3)(4)(5)(6)(7)(8)(10)
Slim420
New User
New User
 
Posts: 19
Joined: Thu Dec 31, 2009 12:34 am
Blog: View Blog (0)


Re: Programming 1

Post by faazshift on Wed Jan 13, 2010 11:00 am
([msg=33310]see Re: Programming 1[/msg])

Slim420 wrote:Hehe, yeah, I figured less time limits were coming :o .

Automating the login was gonna be my next step if i couldn't get it in time. Honestly with this being the first challenge in the category I wanted to try and get it with the least lines of code as possible. I did try just grabbing the page, but it wouldnt let me without logging in, and i didnt want to send a whole bunch of requests with my username/pw info (I'm just waayyy over paranoid). Although, it seems that is gonna have to be the case in the later missions :roll: . Depending on the mission though I may just get it to work first (like i did with this one), then work out the authentication.

Slim420

Well, sending requests with your username/password is exactly what your browser does. For getting pages and such I just used python's 'urllib2' module. You should be aware that when logging in, the referrer must be set to a page on the site. Anyway, if you need any help with the authentication stuff, let me know.
faazshift
Contributor
Contributor
 
Posts: 516
Joined: Wed Jun 03, 2009 3:55 pm
Location: Riverton, Utah
Blog: View Blog (0)


Re: Programming 1

Post by eljonto on Wed Jan 13, 2010 5:40 pm
([msg=33319]see Re: Programming 1[/msg])

Alternatively, log in normally, and use your phpsessid in your script, that way you can browse 'logged in' without having to physically send a log in request.
-Quis custodiet ipsos custodes?, Juvenal
_________________________________________________________________
User avatar
eljonto
Poster
Poster
 
Posts: 373
Joined: Thu Apr 17, 2008 1:16 am
Location: Australia
Blog: View Blog (0)


Re: Programming 1

Post by goluhaque on Mon Feb 08, 2010 7:05 am
([msg=34659]see Re: Programming 1[/msg])

OK. I did everything correct. nd no, i didn't do that stupid thing of trying to "hack"( :roll: ) the JAVASCRIPT. maybe the server starts counting the time just as soons as it gets a request. i don't know, aftr posting the answer, this message comes(the counter showed 6 secs left).

""The answer is correct, but you needed too much time. You had 30 seconds time, and needed 36.0 seconds.""


:x :evil: :x :evil: :x :evil: grrrrrrrrrrrrr

-- Mon Feb 08, 2010 5:39 pm --

Slim420 wrote:Wow, 30 seconds almost isnt long enough, and there was about an 8 second gap between the javascript timer on the button and the server time. The few tries right before i finally passed it I was clicking the button with 5-7 seconds left and by the time the results page showed up it was say i was late by 0.2-1.7secs. The time that I passed it I had 9 seconds left on the button, but it didnt tell me how long it took, so its more than 7 second and less than 9.

My guess is that the server timer starts as soon as the page starts loading and the javascript timer starts when the content is loaded, and I get about 2-3 seconds of lag after the page header is loaded, before the content shows up (and i can copy the wordlist) and the javascript timer starts.

I feel really bad for anyone having to do this one on a dial-up connection :cry: .

Now that I'm done bitching about it, I must say, it was a fun little exercise ;) .

I did it in python, and at first i was having issues with the words that had multiple occurrences of the same letter, because as it was checking each different letter in the scrambled words, but the first occurrence of the letter would trigger a match :evil: . So in the end I found a much better way to organize and compare the strings 8-) . All i had to do was copy the scrambled words into a text file, save it, then run the python script (just pressing F5) then copy the results in the textbox on the webpage.

Slim420

shit. i hv a dial-up conn.
(23:45:03) hauk: I guess you are over the best part of your life when 4-year-olds say "Are you an evil man?"
(23:46:19) hauk: and "Ima punch you in the pecker"
User avatar
goluhaque
Poster
Poster
 
Posts: 153
Joined: Mon Apr 13, 2009 12:08 am
Location: India
Blog: View Blog (0)


Re: Programming 1

Post by faazshift on Mon Feb 08, 2010 10:27 am
([msg=34665]see Re: Programming 1[/msg])

goluhaque wrote:shit. i hv a dial-up conn.

In that case it would be especially useful for you to completely automate the whole process (login and all; like I did).
faazshift
Contributor
Contributor
 
Posts: 516
Joined: Wed Jun 03, 2009 3:55 pm
Location: Riverton, Utah
Blog: View Blog (0)


Re: Programming 1

Post by Draymire on Mon Feb 08, 2010 4:03 pm
([msg=34684]see Re: Programming 1[/msg])

where could i find good information about automating login/input, i want to try it out now that i have done the challenge the simpler way :).
Baba Ram Dass "The quieter you become, the more you can hear"
User avatar
Draymire
Poster
Poster
 
Posts: 129
Joined: Sun Nov 22, 2009 12:01 am
Blog: View Blog (0)


Re: Programming 1

Post by faazshift on Mon Feb 08, 2010 5:33 pm
([msg=34688]see Re: Programming 1[/msg])

Draymire wrote:where could i find good information about automating login/input, i want to try it out now that i have done the challenge the simpler way :).

Well, I used python. You can manually construct the request headers, send them parse the response (extracting the cookies and such), but I used pythons awesome 'urllib2' module. But if you don't know how the HTTP protocol works, it might be a good thing to do it manually. Firebug can be a big help in figuring out how certain sites/pages do things. Google, of course, can be a big help in learning these sorts of things. This looks like a good introduction. Anyway, theres also a thread that talks about HTS authentication with python. Anyway, its really simple stuff once you understand the basics.
faazshift
Contributor
Contributor
 
Posts: 516
Joined: Wed Jun 03, 2009 3:55 pm
Location: Riverton, Utah
Blog: View Blog (0)


Re: Programming 1

Post by Draymire on Mon Feb 08, 2010 7:00 pm
([msg=34693]see Re: Programming 1[/msg])

Thanks, i forgot to mention that i use python too, but you gave me appropriate info anyways. Thank you so much, i will start learning it now.
Baba Ram Dass "The quieter you become, the more you can hear"
User avatar
Draymire
Poster
Poster
 
Posts: 129
Joined: Sun Nov 22, 2009 12:01 am
Blog: View Blog (0)


PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests