Programming 1 Long Convoluted Way

Put your programming skills to the test in these challenges.

Programming 1 Long Convoluted Way

Post by toxichof on Tue Aug 18, 2015 3:43 pm
([msg=89404]see Programming 1 Long Convoluted Way[/msg])

Hi
I have solved Programming 1 using Lazarus with some copy paste but I want to try a more fun way , I want to write a python Script to basically login to HTS go to programming one scrape the screen Parse the HTML :twisted: to get the List of words and then post back to the site , I have very little knowledge of python and posting to webforms in general , I am using the urlLib library and posting to the login info to the site , I wrote a very basic mock up form to test the concept; it works in my basic form but when I post to HTS I get a The requested Url will not be loaded , I am just testing with the root dir of the site for now , what should I look into to solve this , it this a way to secure the site to stop basic bots from logging in or am I missing something in my script , thanks .
toxichof
New User
New User
 
Posts: 2
Joined: Tue Aug 18, 2015 3:33 pm
Blog: View Blog (0)


Re: Programming 1 Long Convoluted Way

Post by x509 on Tue Aug 18, 2015 4:20 pm
([msg=89405]see Re: Programming 1 Long Convoluted Way[/msg])

Post your code in a pastebin or something, please?
Other than this, you might want to set the referrer to Hackthissite
User avatar
x509
New User
New User
 
Posts: 16
Joined: Sun Aug 09, 2015 1:47 am
Blog: View Blog (0)


Re: Programming 1 Long Convoluted Way

Post by toxichof on Tue Aug 18, 2015 4:33 pm
([msg=89406]see Re: Programming 1 Long Convoluted Way[/msg])

Hi
Here is a link to a Pastbin
http://pastebin.com/Zbz3T4Lu

Its extreme basic atm I just want the proof of concept ie Print out the HTML of the page , I am currently looking into more about python as I know basically nothing about it , thanks.
toxichof
New User
New User
 
Posts: 2
Joined: Tue Aug 18, 2015 3:33 pm
Blog: View Blog (0)


Re: Programming 1 Long Convoluted Way

Post by tgoe on Tue Aug 18, 2015 7:31 pm
([msg=89410]see Re: Programming 1 Long Convoluted Way[/msg])

You will probably want to use mechanize as it provides a higher level and more robust api.
User avatar
tgoe
Contributor
Contributor
 
Posts: 718
Joined: Sun Sep 28, 2008 2:33 pm
Location: q3dm7
Blog: View Blog (0)


Re: Programming 1 Long Convoluted Way

Post by boriz666 on Wed Aug 19, 2015 3:55 am
([msg=89418]see Re: Programming 1 Long Convoluted Way[/msg])

Good call to submit the programming answers programmatically,
later on it will be convoluted to use all sorts of browser plugins or js, in order
to solve the challenges.

I urge you to get your programmatical submit code up now while the challenge
in itself is easy, you will need it.

I programmed a framework for submitting my programming solutions, in perl.
Basic functions:

siteLogin(login,pass) - logs in to the site, saving the cookies etc.
fetchLevelData - fetches the challenge html and parse it to return the values needed to complete the mission
solveLevel - takes relevant data and return formdata to solve the level
postResult(formdata) - posts the result to the challenge

I feel fiddeling around with js/plugins is tedious and wouldn't work for you,
if you needed to do more than just proof of concept.
You always wanna do it in code, so you can automate as much as possible without having
to be at the machine to do it.

Sadly I can't (read don't have time) to help you with the python part as my language
of choice is perl, where I can pretty much do everything fast and easy.

However I can't see how it shouldn't be equally easy to do in python and i bet
many have had the same challenge, to login to a site, from python code, so
google is your friend here.
boriz666
Experienced User
Experienced User
 
Posts: 99
Joined: Tue Mar 24, 2015 11:53 am
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests