Page 12 of 14

Re: Permanent Programming 2

PostPosted: Tue May 31, 2011 9:38 pm
by adamcaa
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.

Re: Permanent Programming 2

PostPosted: Tue May 31, 2011 11:48 pm
by fashizzlepop
Sounds good. :) +1 for using Perl.

ImageMagick is a good module to use I believe.

http://search.cpan.org/~jcristy/PerlMagick/Magick.pm

Re: Permanent Programming 2

PostPosted: Wed Jun 01, 2011 5:06 pm
by adamcaa
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

Re: Permanent Programming 2

PostPosted: Wed Jun 01, 2011 7:46 pm
by b33tr00t
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.

Re: Permanent Programming 2

PostPosted: Wed Jun 01, 2011 10:06 pm
by adamcaa
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?

Re: Permanent Programming 2

PostPosted: Wed Jun 01, 2011 10:09 pm
by Goatboy
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.

Re: Permanent Programming 2

PostPosted: Wed Jun 01, 2011 10:18 pm
by adamcaa
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

Re: Permanent Programming 2

PostPosted: Tue Aug 02, 2011 11:26 am
by abraker95
Image
.-. -. --- -.-. .. ....- ..- ....- -.. -.-
RNOCI4U4DK

Are all the characters correct?

If so then did I need to include quotes?
If not WHAT THE HELL IS WRONG!!!??!?!?? :(

Re: Permanent Programming 2

PostPosted: Tue Aug 30, 2011 7:06 am
by Knoble
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.

Re: Permanent Programming 2

PostPosted: Mon Oct 03, 2011 9:03 pm
by bitsniper
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.