Permanent Programming 2

Put your programming skills to the test in these challenges.

Re: Permanent Programming 2

Post by adamcaa on Tue May 31, 2011 9:38 pm
([msg=57955]see Re: Permanent Programming 2[/msg])

Ok my perl script now:
1. navigates to the main hts page and logs in.
2. then navigates to the programming 2 page.
3. downloads the image.

Now I just need to figure out this image processing stuff.
Thanks for the tips, I'm sure I'll be back with more questions for the next steps.
adamcaa
New User
New User
 
Posts: 10
Joined: Fri May 27, 2011 9:33 pm
Blog: View Blog (0)


Re: Permanent Programming 2

Post by fashizzlepop on Tue May 31, 2011 11:48 pm
([msg=57961]see Re: Permanent Programming 2[/msg])

Sounds good. :) +1 for using Perl.

ImageMagick is a good module to use I believe.

http://search.cpan.org/~jcristy/PerlMagick/Magick.pm
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: Permanent Programming 2

Post by adamcaa on Wed Jun 01, 2011 5:06 pm
([msg=58003]see Re: Permanent Programming 2[/msg])

I did use ImageMagick to get the rgb values. However I have a hangup. I keep getting 'your answer is wrong' when submitting. I need someone to run this image through there program and see how we match up.

Image: Image
I get: Q4LXCAU122

and this one...

image: Image
I get: IWZZJH2XDG
adamcaa
New User
New User
 
Posts: 10
Joined: Fri May 27, 2011 9:33 pm
Blog: View Blog (0)


Re: Permanent Programming 2

Post by b33tr00t on Wed Jun 01, 2011 7:46 pm
([msg=58021]see Re: Permanent Programming 2[/msg])

i got the same results for both images. check if you are not submitting an extra space with your answer or something of that nature.
User avatar
b33tr00t
New User
New User
 
Posts: 25
Joined: Thu Mar 17, 2011 1:29 pm
Blog: View Blog (0)


Re: Permanent Programming 2

Post by adamcaa on Wed Jun 01, 2011 10:06 pm
([msg=58027]see Re: Permanent Programming 2[/msg])

This is what i'm doing with my results:
chomp($answer);
$answer =~ s/\n|\r|\s//g;

picture: Image
output from my script:

Starting...
sending answer: 2PKNZP6K1T
Wrong Answer!
Done!

I'm not really sure whats going here. any suggestions?
adamcaa
New User
New User
 
Posts: 10
Joined: Fri May 27, 2011 9:33 pm
Blog: View Blog (0)


Re: Permanent Programming 2

Post by Goatboy on Wed Jun 01, 2011 10:09 pm
([msg=58028]see Re: Permanent Programming 2[/msg])

If you're automatically sending the answer, it might not be your pixel->morse algorithm that is wrong, but in the way you are sending it.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2751
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Permanent Programming 2

Post by adamcaa on Wed Jun 01, 2011 10:18 pm
([msg=58029]see Re: Permanent Programming 2[/msg])

I'm using perl module WWW::Mechanize

This is the part of my script that is sending the answer, same as login except I'm using form_name as appose to form_id.
Some cool Perl code that should only be seen via PM. ~fas

-- Thu Jun 02, 2011 12:05 pm --

looking through Wireshark

my script sends this:
solution=EHV9XYR6N9&submitbutton=submit++++++++++++(remaining+time%3A+15+seconds)

when I click the buttion for submission on the page I get this in Wireshark:
* the parenthesis are in hex *
solution=EHV9XYR6N9&submitbutton=submit++++++++++++%28remaining+time%3A+15+seconds%29

could this be the problem?

$response = $mech->click('submitbutton'); <-- I guess WWW::Mechanize 'click' wont work for this submission

yes! I finally got it after much reading. I had to go to a lower level of abstraction to get more control over my submit process. I used LWP::UserAgent
adamcaa
New User
New User
 
Posts: 10
Joined: Fri May 27, 2011 9:33 pm
Blog: View Blog (0)


Re: Permanent Programming 2

Post by abraker95 on Tue Aug 02, 2011 11:26 am
([msg=60451]see Re: Permanent Programming 2[/msg])

Image
.-. -. --- -.-. .. ....- ..- ....- -.. -.-
RNOCI4U4DK

Are all the characters correct?

If so then did I need to include quotes?
If not WHAT THE HELL IS WRONG!!!??!?!?? :(
abraker95
New User
New User
 
Posts: 2
Joined: Mon Aug 01, 2011 10:41 am
Blog: View Blog (0)


Re: Permanent Programming 2

Post by Knoble on Tue Aug 30, 2011 7:06 am
([msg=61315]see Re: Permanent Programming 2[/msg])

hey guys just finished this mission but I had to use some quick alt-tab, saving manoeuvres to get there. I tried to connect right to the img src to download the image using PHP but...there was no extension or anything so I'm just wondering if anybody could explain how to grab that image automatically. *file_get_contents and fopen didn't work.
Knoble
New User
New User
 
Posts: 10
Joined: Fri Oct 29, 2010 12:54 pm
Blog: View Blog (0)


Re: Permanent Programming 2

Post by bitsniper on Mon Oct 03, 2011 9:03 pm
([msg=62032]see Re: Permanent Programming 2[/msg])

I finished mission 2 but my code had some problems. I used this code to submit my solution to programming challenge 11...

Code: Select all
solutionstring = 'solution to challenge'
cookie = 'my cookie string'

urlheader = {'COOKIE':cookie, 'Referrer':'http://www.hackthissite.org/missions/prog/2/'}
values = {'solution':solutionstring,'submitbutton':'submit'}
solution = urllib.urlencode(values)
req2 = urllib2.Request('http://www.hackthissite.org/missions/prog/2', solution, urlHeader)
urlstring2 = urllib2.urlopen(req2).read()


This code does not work for programming challenge #2. I can't figure out why. I just keep getting the challenge page refreshed over and over again. Finally I gave up and did it the hard way but I really want to figure out why I couldn't submit my answer through my program.
bitsniper
New User
New User
 
Posts: 2
Joined: Sat Oct 01, 2011 8:19 am
Blog: View Blog (0)


PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests