Programming 12

Put your programming skills to the test in these challenges.

Re: Programming 12

Post by Defience on Fri Jul 24, 2009 4:29 pm
([msg=27382]see Re: Programming 12[/msg])

imar2 wrote:because in this forum topic every one said that they did it "ctrl-c ctrl-v style" and the time limit would suggest it as well.

but I guess I'll have to look into it..

Imar2


Automated submission is the way to go. I used:
import urllib
import urllib2
import re

I logged on to hts and then set my cookie in my code with strSession=" " instead of trying to make my code log me in and then go to the mission page, it's easier that way. Also since the answer is a POST form it requires adding 'submitbutton' & a value to urlencode, if you decide to go that route.
User avatar
Defience
Addict
Addict
 
Posts: 1275
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 12

Post by code2004 on Fri Jul 24, 2009 5:29 pm
([msg=27387]see Re: Programming 12[/msg])

Great level! Had me stuck at the beginning; didn't have a God-damn clue what composite meant!

Wd to the creator =]

(I must confess, I'm having some trouble as it always says my answer's wrong, even though I'm sure they're right, after manually checking out my answer *yawn* :| :ugeek: )

Code2004
Image
.............................H..o.....i..l.....C..u..o..r..e.....S..p..e..z..z..a..t..o.............................
User avatar
code2004
New User
New User
 
Posts: 36
Joined: Sat Jun 13, 2009 5:23 am
Blog: View Blog (0)


Re: Programming 12

Post by Defience on Fri Jul 24, 2009 6:26 pm
([msg=27392]see Re: Programming 12[/msg])

code2004 wrote:Great level! Had me stuck at the beginning; didn't have a damn clue what composite meant!

Wd to the creator =]

(I must confess, I'm having some trouble as it always says my answer's wrong, even though I'm sure they're right, after manually checking out my answer *yawn* :| :ugeek: )

Code2004


Use this set of values that I had posted on page 2 and see if you come up with the same answers:

value="u2vmsbz4luw#wxg@i@0ixvjhuraehe#ondzh9arn?lg8aj2@j6l9?dmur4wkajfppk3gvgv@akyymsfra?q@m5s@@1jkd
821tn8ty@exix$5?i8ey0maf8sqx2i0zr?kftf@?ibe4tbf#wnoi?slhaevgr2?@3n08qdgh93e2#m8zw5sgco00azk3c@35i4tzi@3kse
yek3ux5cb13an8ousme4vsn4c8qu?ovk8483ts$tz#u7cdhrooh?$lg9eyollnajmoc#ap3$4$u8w4u7qvxpww431rh5vkhnga8rj@v@
0@vi8gjkakknhj7?3q@xwbd5e9ocjpy4yc50uqbn9celfdz5b9@n8evssx3na95wic5nmy6kyl9u3u1b6@z0izexr13i0v0rh3ed@d@
o#ce@s0um1rrt3oy$h0admnvp9s0#qtn$7k2ew7mx5?6@yujw#g8urtq3886u912fxdc3oa??a3ce3vuxm$y93zgr16ff2tiwoub?l?
igry8#l2aj3ja0$k3?nfpbc$to#oggzsf0@2?jjmws$498rpnj?uy05lj7eyczxpagc5xit?c1cwv3i$?suxi#zmyabzct3vfnwaae0@7kyh#
gm?t3ze188i2put0fd$17qvwntc{mvx$xyhAjAjywkivsbf"

# 1st 25chars with numbers removed, shifted +1 in ascii:
'vwntc{mvx$xyhAjAjywkivsbf'

# composite & prime numbers added then multiplied:
'87087'

# concatenated answer:
'vwntc{mvx$xyhAjAjywkivsbf87087' <---------this should be what you get when you use those values.
User avatar
Defience
Addict
Addict
 
Posts: 1275
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 12

Post by code2004 on Fri Jul 24, 2009 6:49 pm
([msg=27396]see Re: Programming 12[/msg])

Defience wrote:
code2004 wrote:Great level! Had me stuck at the beginning; didn't have a damn clue what composite meant!

Wd to the creator =]

(I must confess, I'm having some trouble as it always says my answer's wrong, even though I'm sure they're right, after manually checking out my answer *yawn* :| :ugeek: )

Code2004


Use this set of values that I had posted on page 2 and see if you come up with the same answers:

value="u2vmsbz4luw#wxg@i@0ixvjhuraehe#ondzh9arn?lg8aj2@j6l9?dmur4wkajfppk3gvgv@akyymsfra?q@m5s@@1jkd
821tn8ty@exix$5?i8ey0maf8sqx2i0zr?kftf@?ibe4tbf#wnoi?slhaevgr2?@3n08qdgh93e2#m8zw5sgco00azk3c@35i4tzi@3kse
yek3ux5cb13an8ousme4vsn4c8qu?ovk8483ts$tz#u7cdhrooh?$lg9eyollnajmoc#ap3$4$u8w4u7qvxpww431rh5vkhnga8rj@v@
0@vi8gjkakknhj7?3q@xwbd5e9ocjpy4yc50uqbn9celfdz5b9@n8evssx3na95wic5nmy6kyl9u3u1b6@z0izexr13i0v0rh3ed@d@
o#ce@s0um1rrt3oy$h0admnvp9s0#qtn$7k2ew7mx5?6@yujw#g8urtq3886u912fxdc3oa??a3ce3vuxm$y93zgr16ff2tiwoub?l?
igry8#l2aj3ja0$k3?nfpbc$to#oggzsf0@2?jjmws$498rpnj?uy05lj7eyczxpagc5xit?c1cwv3i$?suxi#zmyabzct3vfnwaae0@7kyh#
gm?t3ze188i2put0fd$17qvwntc{mvx$xyhAjAjywkivsbf"

# 1st 25chars with numbers removed, shifted +1 in ascii:
'vwntc{mvx$xyhAjAjywkivsbf'

# composite & prime numbers added then multiplied:
'87087'

# concatenated answer:
'vwntc{mvx$xyhAjAjywkivsbf87087' <---------this should be what you get when you use those values.


Thanks for your response :) V helpful, ty.
I'd originally forgotten to stop my shifting function from ignoring the numbers. Unfortunately, my program still isn't managing to cope with the task... (*Irked* :shock: :x )

Wahey!! Finally got it working! Thanks again :)

Code
Image
.............................H..o.....i..l.....C..u..o..r..e.....S..p..e..z..z..a..t..o.............................
User avatar
code2004
New User
New User
 
Posts: 36
Joined: Sat Jun 13, 2009 5:23 am
Blog: View Blog (0)


Programming 12

Post by moejo on Sat Feb 27, 2010 6:00 am
([msg=35855]see Programming 12[/msg])

Hi, I was wondering if I did this correctly:

Code: Select all
cwl8yv0wxuo?8v#wxa#yte3m0vr#5tdbt$k?j7ovzg$@$62nk@6c0$s#bbsmu1gqu7na85u3zl9903#518ukv2awgk0u#attjehlbu?o5y#c5yw83b2n@kq8$nq4fgvf9pqj0ejwbj87a33$0nqb0h04@yf0y7i4qgoq?qeik80be3z4iwqrb?sbbsrwa58k#cd9yt8g?k04jb0opdkflngpepl1rvtlw1z8j9p#kw$mzv$2p4ep$ycl8r3u5$hvvfz1ny7vn2vq3a?hoje@czgqxghqccasm432ovlh8m9m010nt3zv#l2n@8?5h#jyw?f99l5e5e$7w87g8xfgc#$n7961xobpe315np1ht?dvqpe?h#@r81o823iyh1so35vhjmzc2x#3?pkjqh1sy5gc3sp$qvka5a2kcdpasfj@9b7dqvfwgucc5$xkaz3jxp4m#yu?s2j#hf9ul@tg?beeo@p4hn$wm#f0ev26b7k8g$zz4cps$z9qv95sxg5jwwnedu@yhq2ldfw#0#siesfrrzgo##zz52rfk$7ot97mxl#v9re$qgnoxfowgmg?q2lw3gtq7uxyo9ceosko58caw@82#awxvd3ezou#tzv?6sx9csy1w3h?d#z7kido

answer: dxmzwxyvp@w$xyb$zufnws$ue111435


By getting the same answer as the poster above, I believe I did it correctly. This leads me wondering if I did something wrong with my python coding when submitting the answer. Can anyone see what I did wrong? :S

Thanks

Code: Select all

# Sending answer to hackthissite.org using urllib and urllib2
url = "http://www.hackthissite.org/missions/prog/12/index.php"

#HTTP header
spoofwebbrowser = {'Host': 'www.hackthissite.org',
                    'User-Agent':'Mozilla/4.0 (compatible; MSIE 8.0)',
                   'Referer':'http://www.hackthissite.org/missions/prog/12/index.php',
                    'content_type':'application/x-www-form-urlencoded',
                    'accept_encoding' : 'gzip,deflate'
                      }

values_1 = {'solution' : answer }

data_1 = urllib.urlencode(values_1)
req_1 = urllib2.Request(url, data_1, spoofwebbrowser)
response = urllib2.urlopen(req_1)

print response.read()


Edit: Solved it.
moejo
New User
New User
 
Posts: 3
Joined: Sat Feb 27, 2010 12:53 am
Blog: View Blog (0)


Re: Programming 12

Post by thefeedinghand on Wed Mar 03, 2010 4:33 pm
([msg=36046]see Re: Programming 12[/msg])

Im gonna try to do this in C, console application, so I don't think I'll be able to paste the answer before time runs out... but we'll see
thefeedinghand
New User
New User
 
Posts: 7
Joined: Wed Aug 05, 2009 6:14 pm
Blog: View Blog (0)


Re: Programming 12

Post by nermd on Thu Mar 04, 2010 5:36 am
([msg=36085]see Re: Programming 12[/msg])

thefeedinghand wrote:Im gonna try to do this in C, console application, so I don't think I'll be able to paste the answer before time runs out... but we'll see


forget it ... you have 3 sec for the whole thing, you wont have any chance to do this by hand.
Write a proper tool to fetch this stuff from the website ... if you dont know how to do this in C you could also use some kind of external application to do the web stuff (like wget ...).
On the other side, you would learn something if you write the whole www-stuff in C ... i mean http is a very simple protocol its not that hard to write some lines of dirty code to communicate with a webserver.
With this world there is no understanding, we belong their only to the extent, as we rebel against it (Theodor W. Adorno) --> if somebody knows a "official" translation for the well known german quote ... pls let me know!
User avatar
nermd
New User
New User
 
Posts: 42
Joined: Fri May 23, 2008 3:22 am
Blog: View Blog (0)


Re: Programming 12

Post by codemann8 on Fri Mar 12, 2010 3:28 am
([msg=36582]see Re: Programming 12[/msg])

So how do I submit the answer? I've been trying for a good 4 hours just trying to submit my correct answer that solves in milliseconds but takes longer to copy paste it in. I originally coded this in Java, realized I can't copy and paste in, takes too long. I then converted my code into Javascript and was hoping to use JQuery to write in the answer through an IFrame, I couldn't get that working. I then tried to write a Greasemonkey script, that didn't work, I get a 'document' is undefined error. So, I see most people submit the answer through their program. If I use my original code, how would I submit it with Java?
User avatar
codemann8
New User
New User
 
Posts: 1
Joined: Fri Mar 12, 2010 3:21 am
Blog: View Blog (0)


Re: Programming 12

Post by FireEagle on Tue Apr 06, 2010 9:13 am
([msg=37766]see Re: Programming 12[/msg])

moejo wrote:Hi, I was wondering if I did this correctly:<br><br>
Code: Select all
cwl8yv0wxuo?8v#wxa#yte3m0vr#5tdbt$k?j7ovzg$@$62nk@6c0$s#bbsmu1gqu7na85u3zl9903#518ukv2awgk0u#attjehlbu?o5y#c5yw83b2n@kq8$nq4fgvf9pqj0ejwbj87a33$0nqb0h04@yf0y7i4qgoq?qeik80be3z4iwqrb?sbbsrwa58k#cd9yt8g?k04jb0opdkflngpepl1rvtlw1z8j9p#kw$mzv$2p4ep$ycl8r3u5$hvvfz1ny7vn2vq3a?hoje@czgqxghqccasm432ovlh8m9m010nt3zv#l2n@8?5h#jyw?f99l5e5e$7w87g8xfgc#$n7961xobpe315np1ht?dvqpe?h#@r81o823iyh1so35vhjmzc2x#3?pkjqh1sy5gc3sp$qvka5a2kcdpasfj@9b7dqvfwgucc5$xkaz3jxp4m#yu?s2j#hf9ul@tg?beeo@p4hn$wm#f0ev26b7k8g$zz4cps$z9qv95sxg5jwwnedu@yhq2ldfw#0#siesfrrzgo##zz52rfk$7ot97mxl#v9re$qgnoxfowgmg?q2lw3gtq7uxyo9ceosko58caw@82#awxvd3ezou#tzv?6sx9csy1w3h?d#z7kido<br><br>answer: dxmzwxyvp@w$xyb$zufnws$ue111435
<br><br>By getting the same answer as the poster above, I believe I did it correctly. This leads me wondering if I did something wrong with my python coding when submitting the answer. Can anyone see what I did wrong? :S<br><br>Thanks<br><br>
Code: Select all
<br><br># Sending answer to hackthissite.org using urllib and urllib2<br>url = "http://www.hackthissite.org/missions/prog/12/index.php"<br><br>#HTTP header<br>spoofwebbrowser = {'Host': 'www.hackthissite.org',<br>                    'User-Agent':'Mozilla/4.0 (compatible; MSIE 8.0)',<br>                   'Referer':'http://www.hackthissite.org/missions/prog/12/index.php',<br>                    'content_type':'application/x-www-form-urlencoded',<br>                    'accept_encoding' : 'gzip,deflate'<br>                      }<br><br>values_1 = {'solution' : answer }<br><br>data_1 = urllib.urlencode(values_1)<br>req_1 = urllib2.Request(url, data_1, spoofwebbrowser)<br>response = urllib2.urlopen(req_1)<br><br>print response.read()<br>
<br><br>Edit: Solved it.


Hello, I wrote the code in PHP, so I just copy/pasted the answer... BUT, then I realized that I made some mistake. And I think I got my mistake, the numbers are the problem... but I dont know where I made that ...
This is the algorythm no? ::

sum(prime numbers) * sum(non-prime numbers)

I have the following result: 115140 (404(nonprime)*285(prime)) instead of 111435
FireEagle
New User
New User
 
Posts: 2
Joined: Tue Apr 06, 2010 4:02 am
Blog: View Blog (0)


Re: Programming 12

Post by Defience on Tue Apr 06, 2010 3:27 pm
([msg=37790]see Re: Programming 12[/msg])

Make sure you have no '1' or '0' in your lists. You should be getting this: 111435 as the result of the numbers and yes, that is the algorithm for it.
User avatar
Defience
Addict
Addict
 
Posts: 1275
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests