Programming 12

Put your programming skills to the test in these challenges.

Re: Programming 12

Post by FireEagle on Wed Apr 07, 2010 5:19 am
([msg=37831]see Re: Programming 12[/msg])

Defience wrote: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.


Thanks for the hint, I solved the problem!
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 Wed Apr 07, 2010 3:27 pm
([msg=37855]see Re: Programming 12[/msg])

You're welcome 8-)
User avatar
Defience
Addict
Addict
 
Posts: 1275
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 12

Post by furtypajohn on Tue May 04, 2010 6:22 pm
([msg=38359]see Re: Programming 12[/msg])

FYI, I completed this mission "by hand" using emacs, what started out as a perl script but ultimately became a jar file, and a handy little application called "xclip."

I was able to copy the text, execute the keyboard macro, and paste the answer with about 1.5/2 seconds to spare.

If you're attempting this method remember to put the text into quotes otherwise the command line will screw with the input and you'll get invalid answers...

Just thought I'd offer another way to go about entering the answer.

Enjoy.
furtypajohn
New User
New User
 
Posts: 1
Joined: Mon Apr 05, 2010 5:45 pm
Blog: View Blog (0)


Re: Programming 12

Post by msbachman on Tue Jun 08, 2010 9:36 pm
([msg=39747]see Re: Programming 12[/msg])

Check this out. Here's the value that the page is giving me, and here's what I'm sending:
Code: Select all
value="bw@1m6oofb24@n8?ozim5rtl$dj$0lzw1d9fbfny?1rizsf$ak7p02oihntav$opejni3i5roh110zff90$jgdzu20y$yn9gpm$qy5$6uhq3vqes2j@x8ji5w991#m58as98wv4fwi07uvywlupdjc3sd2f8?90egud7udccs$3uhds?9cqq77cbzccf#z0l3zg8tnmb?35cz@r@r@qlkdcg@um@9o9a?na$x1h@g@nh#t0snxkk@t9ciu@itnm3@vf97$jv?o9gkj7kvw#7bnegcjwg79hio3yc@0$vw4k?twciups7vi3an?@82rye7$ezja7012tguywjmvge5hpnjay9n5k2t7o06vbsnr442vf9wqdkdjhr1uyqlpxfd8q4mozomcj7vj2st3rb7mhuso@47bjeh3ob?d?b@y1nwnix2um$4bl$ddpst5z41n$#c#rjzy@cmgf4rwoqba8$pa35xlcrds$j?vv4#p5f4z3u94c0ywz2lfc3njeiqpj5rjkd4cztl$8crwxyfef@$hpt2$gd$0k9uzxo5?0kze0c5z35efnigmo0#2c#6ojvxi@#sg#d3ha?a3twl@ibg2htvilzah0s7tj4lud1r7gd?mulnh?k@?@4soz9"


Code: Select all
POST /missions/prog/12/index.php HTTP/1.1

Host: www.hackthissite.org

User-Agent: [edit]
Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 115

Connection: keep-alive

Referer: http://www.hackthissite.org/missions/prog/12/index.php

Cookie: [edited]
Content-Type: application/x-www-form-urlencoded

Content-Length: 94



solution=cxAnppgcAo@p{jnsum%ek%m{x102039&submitbutton=Submit+%28remaining+time%3A+4+seconds%29



As far as I am aware, I'm not doing anything wrong. Yet this happens consistently. What is going on? I'm guessing it's my code...but if so, what's the deal? The output is correct, is it not?
Last edited by msbachman on Tue Jun 08, 2010 10:31 pm, edited 1 time in total.
"I'm going to get into your sister. I'm going to get my hands on your daughter."
~Gatito
User avatar
msbachman
Contributor
Contributor
 
Posts: 685
Joined: Mon Jan 12, 2009 10:22 pm
Location: In the sky lol
Blog: View Blog (0)


Re: Programming 12

Post by OnlyHuman on Tue Jun 08, 2010 9:55 pm
([msg=39748]see Re: Programming 12[/msg])

Your output is close, but not entirely correct. I would suggest double checking the part of your program that separates the prime from composite numbers again. Also, the use of:

Code: Select all
&submitbutton=Submit+%28remaining+time%3A+4+seconds%29

might be causing an issue with form submission. Try using just:

Code: Select all
&submitbutton=Submit

Without the remaining time.
OnlyHuman
Poster
Poster
 
Posts: 192
Joined: Sat Aug 22, 2009 1:37 am
Blog: View Blog (0)


Re: Programming 12

Post by msbachman on Wed Jun 09, 2010 11:50 pm
([msg=39836]see Re: Programming 12[/msg])

[Screwed up my post. Sorry]

-- Sun Jun 27, 2010 5:34 pm --

Finally did it after about four weeks of hard work in C.

Miracles all up in this bitch.
"I'm going to get into your sister. I'm going to get my hands on your daughter."
~Gatito
User avatar
msbachman
Contributor
Contributor
 
Posts: 685
Joined: Mon Jan 12, 2009 10:22 pm
Location: In the sky lol
Blog: View Blog (0)


Re: Programming 12

Post by secdef9 on Tue Jul 13, 2010 2:35 am
([msg=41716]see Re: Programming 12[/msg])

msbachman wrote:Check this out. Here's the value that the page is giving me, and here's what I'm sending:
...

As far as I am aware, I'm not doing anything wrong. Yet this happens consistently. What is going on? I'm guessing it's my code...but if so, what's the deal? The output is correct, is it not?


That's not the output I got. Take another look at how you came up with the numbers that you concatenated.


EDIT: Stupid me, you already solved it. Well, nice going.
User avatar
secdef9
New User
New User
 
Posts: 9
Joined: Sat Jan 31, 2009 12:45 pm
Blog: View Blog (0)


Re: Programming 12

Post by dopamine10 on Sun Jul 18, 2010 3:42 pm
([msg=42059]see Re: Programming 12[/msg])

I've been trying to do this for two days now :P

Anyway, getting the answer was easy, but I can't figure out how to correctly submit POST data while using my cookie to be logged in....I'm using Python

Code: Select all
#We at least log in here
headers = {'Cookie': 'PHPSESSID=xxxxxxxxxxxxxxxxxx,'Referer':url}
response, content = http.request(url, "POST", headers=headers)

#This creates incorrect referer
#data = dict(solution=answer)
#response, content = http.request(url, "POST", urlencode(data))

print content


I'm still trying to figure out how to combine a cookie with a post to submit my answer.....
dopamine10
New User
New User
 
Posts: 12
Joined: Sun Sep 28, 2008 1:23 am
Blog: View Blog (0)


Re: Programming 12

Post by fashizzlepop on Sun Jul 18, 2010 3:47 pm
([msg=42062]see Re: Programming 12[/msg])

I don't know about python, but in Perl you would set up an OO interface that will capture the cookies when you login, then the next time you POST or GET it will automatically spit back the proper cookies.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2304
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: Programming 12

Post by msbachman on Sun Jul 18, 2010 4:10 pm
([msg=42063]see Re: Programming 12[/msg])

dopamine10 wrote:Anyway, getting the answer was easy, but I can't figure out how to correctly submit POST data while using my cookie to be logged in....I'm using Python

I'm still trying to figure out how to combine a cookie with a post to submit my answer.....


Protip: use wireshark and submit some trash normally (just type something into the box quickly). Then, you'll know how to submit it.

I think I can say this without spoiling it, you submit the cookie, then there's a double "\r\n\r\n" and you post the data.

If you're having trouble with wireshark, you can also set up a capture filter for port 80 or a display filter for http. That will cut down on the amount of traffic to sort through.
"I'm going to get into your sister. I'm going to get my hands on your daughter."
~Gatito
User avatar
msbachman
Contributor
Contributor
 
Posts: 685
Joined: Mon Jan 12, 2009 10:22 pm
Location: In the sky lol
Blog: View Blog (0)


PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests