Follow us on Twitter!
Imagination is more valuable than knowledge - Albert Einstein
Wednesday, April 16, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 19
Guests Online: 14
Members Online: 5

Registered Members: 82813
Newest Member: VesuviusSentinel
Latest Articles
View Thread

HellBound Hackers | Challenges | Timed Challenges

Author

Timed 2, POST not submitting (Python)

Xunxen
Member



Posts: 30
Location:
Joined: 06.03.11
Rank:
Apprentice
Posted on 14-03-11 02:57
I managed to get the first challenge to work in essentially the same way I'm trying to do this one, but when my program submits the answer, I just get back the source of the /challenges/timed/timed2/index.php file, including a new hash.
is there someone I can PM for help, because I don't think I can post any of my code without giving a spoiler.


Author

RE: Timed 2, POST not submitting (Python)

techb
Member



Posts: 384
Location:
Joined: 15.02.09
Rank:
Moderate
Posted on 14-03-11 03:23
look in the codebank, I posted an HBH class that will help you understand.


www.userbars.com/74460/665255/337-7865-ubda3219.gif
kbcarte.wordpress.com
Author

RE: Timed 2, POST not submitting (Python)

Xunxen
Member



Posts: 30
Location:
Joined: 06.03.11
Rank:
Apprentice
Posted on 14-03-11 03:54
I'm kind of hoping to get my code working, I've already started over from scratch once, hoping it was something I would notice if I typed it again. Besides that, I wanted an opportunity to learn more about handling internet access in python. While using your code would be easier, it would rob me of a chance to learn more.


Author

RE: Timed 2, POST not submitting (Python)

techb
Member



Posts: 384
Location:
Joined: 15.02.09
Rank:
Moderate
Posted on 14-03-11 04:01
I didn't say use it, just look at it to see what is going on and how to handle cookies and what-nots.


www.userbars.com/74460/665255/337-7865-ubda3219.gif
kbcarte.wordpress.com
Author

RE: Timed 2, POST not submitting (Python)

Xunxen
Member



Posts: 30
Location:
Joined: 06.03.11
Rank:
Apprentice
Posted on 14-03-11 05:18
I'm just going to go back to reading about Python because your code kind of confuses me. I just started learning Python last night.


Author

RE: Timed 2, POST not submitting (Python)

elmiguel
Member



Posts: 160
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 14-03-11 14:45
You should check out this: http://www.hellbo. . .nges..htmlWink


The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

www.hellboundhackers.org/sig/r/24963.png

www.hellboundhackers.org/sig/hbh2.png
<script>alert('XSS');</script>
Author

RE: Timed 2, POST not submitting (Python)

Xunxen
Member



Posts: 30
Location:
Joined: 06.03.11
Rank:
Apprentice
Posted on 14-03-11 17:24
elmiguel wrote:
You should check out this: http://www.hellbo. . .nges..htmlWink

That was the first place I checked when I started having problems. some of the code mentioned is just wrong, for instance urllib2 is not callable, I had to use urllib2.Request.
other than that, I'm going exactly by that article and it's not working.
what I'm confused about is I'm not getting "YOU MUST BE LOGGED IN TO PLAY" and I'm not getting "No off site posts" I'm just getting the page back. My code is just completely ignoring my POST request.
I tried techb's code and as is it works, but when I try to code only the parts that seem to be doing something, it goes back to ignoring my POST data.


Author

RE: Timed 2, POST not submitting (Python)

j4m32
Member

Your avatar

Posts: 81
Location:
Joined: 01.05.10
Rank:
Newbie
Posted on 14-03-11 17:41
As I know not one iota about Python networking...

I'd say the easiest way to debug this would be to just run a quick packet sniff along side running the script to make sure the HTTP request is not mal-formed.

1) Take a look at the stream and see whether there was a HTTP response/TCP close whatever.
2) Then, load up your browser of preference, load the page and compare the two requests side by side.

Often a HTTP server will reject, for example:
i) A HTTP/1.0 requests since it's a bit out dated and only allow HTTP/1.1 - not entriely accurate but hey...
ii) If they appear, on first glance, to be practially the same, check your line feeds very carefully, look at the Hex dump if necessary.
At the end of a POST request with the string of POSTed varibles, there shouldn't be another CRLF - this sometimes causes problems in a HTTP request too (from what I can remember).

Hope this helps you find the error...

Jim,
Author

RE: Timed 2, POST not submitting (Python)

Xunxen
Member



Posts: 30
Location:
Joined: 06.03.11
Rank:
Apprentice
Posted on 14-03-11 19:03
I ran a packet sniffer and it's showing the post data as the same as for my browser. also, it's using HTTP/1.1
the only CRLF is after the headers, where it should be.


Author

RE: Timed 2, POST not submitting (Python)


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 14-03-11 19:35
Xunxen wrote:
I ran a packet sniffer and it's showing the post data as the same as for my browser. also, it's using HTTP/1.1
the only CRLF is after the headers, where it should be.


You can PM me.
Author

RE: Timed 2, POST not submitting (Python)

Xunxen
Member



Posts: 30
Location:
Joined: 06.03.11
Rank:
Apprentice
Posted on 14-03-11 21:00
Thanks for the help. I'm just going to do these with GM instead of Python.


Author

RE: Timed 2, POST not submitting (Python)

techb
Member



Posts: 384
Location:
Joined: 15.02.09
Rank:
Moderate
Posted on 15-03-11 00:15
Like I stated before, you need to be able to handle cookies. Also, you need a different user-agent. The web doesn't like programs accessing their pages.


www.userbars.com/74460/665255/337-7865-ubda3219.gif
kbcarte.wordpress.com
Author

RE: Timed 2, POST not submitting (Python)

elmiguel
Member



Posts: 160
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 15-03-11 16:30
That article was written when Python 2.6 was new. There could be some changes on how the module is called in later versions. But as techb states: it is all about how you handle your cookies, and you need to pass your user agent like this: User-agent: Mozilla, or whatever, just make sure its User-agent not User-Agent as the latter is for exact specification of the agent as the preceding is for custom agents. Also, make sure you add the referrer to your request.


The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

www.hellboundhackers.org/sig/r/24963.png

www.hellboundhackers.org/sig/hbh2.png
<script>alert('XSS');</script>