Follow us on Twitter!
Your life is ending one minute at a time. If you were to die tomorrow, what would you do today?
Monday, April 21, 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: 24
Guests Online: 24
Members Online: 0

Registered Members: 82852
Newest Member: sockpuppets
Latest Articles
View Thread

HellBound Hackers | Challenges | Timed Challenges

Page 1 of 2 1 2 >
Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 28-06-08 22:47
Yeah I know it doesn't 'open' it, I'm using urllib2.urlopen() along with Request. Thanks for mentioning that, though. I should've pointed out I was using .urlopen too, sorry.

and Sure, I'll PM you with my code Grin


Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-06-08 00:21
Okay, not sure if you got my PM.

Anyway, after reading your old post on the same subject. I've read through and figured I seem to be having the exact same problem as you (the second one in that thread, not the original one).

Would you be able to give me a hint of what you did?


Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-06-08 01:20
I had a problem with the cookies. Anyway, I pmed you.


Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-06-08 01:25
Thanks a lot SwartMumba Grin

Helped a lot. Smile


Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-09-08 01:04
Hey, I'm doing the same thing as you (using python) I'm just wondering how you got yourself logged in using urlencode
Code

userpass = {'user_name':'The_Gman',
            'user_pass':'*******',
            'remember_me':'y'}
logininfo = urllib.urlencode(userpass)



doesn't seem to work.

Also, once you have requested the document, how did you quickly search for the string properly and parse?

Thanks
Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-09-08 02:40
Code

login_data = urllib.urlencode({'user_name' : 'stdio',
                               'user_pass' : 'mypassword',
                               'login' : 'Login'
                               })





Though doing it this way you have to have a cookie jar set up, and as usual you must still set the headers like user agent and referrer

Yeah I just noticed you didnt have the login set, you need that, and I wouldnt worry about the remember me




Edited by on 02-09-08 02:42
Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-09-08 02:45
The_Gman: It would also help if you used the correct password.
******* does not seem to be your correct password.


Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-09-08 23:16
I find using urllib2.Request to be the easiest way, the syntax is something like:

Request(<url>,<data>,<headers>)

so you can do this (assume your details are urlencoded in a variable called 'login':

Code

import urllib2
req = urllib2.Request('http://www.hellboundhackers.org/challenges/timed/timed1/index.php?b64='+b64val,None,login)





Then just urlopen the request


Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 03:26
stdio wrote:
Code

login_data = urllib.urlencode({'user_name' : 'stdio',
                               'user_pass' : 'mypassword',
                               'login' : 'Login'
                               })





Though doing it this way you have to have a cookie jar set up, and as usual you must still set the headers like user agent and referrer

Yeah I just noticed you didnt have the login set, you need that, and I wouldnt worry about the remember me

Didn't have the login set? You mean like... set which form I was submitting? I'm not too sure what the header looks like in that case. I also have no idea what I would set as the referrer/user-agent in that case, but i don't know how
Code
headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' }




Here's what i have for the login
Code

userpass = {'user_name':'The_Gman',
            'user_pass':'myrealpasswordthistime',
            'remember_me':'y'}
logininfo = urllib.urlencode(userpass)
headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' }
request = urllib2.Request("http://www.hellboundhackers.org/index.php", logininfo, headers)
response = urllib2.urlopen(request)
print response.read()



Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 03:39
The_Gman wrote:

Code
headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' }




Here's what i have for the login
Code

userpass = {'user_name':'The_Gman',
            'user_pass':'myrealpasswordthistime',
            'remember_me':'y'}
logininfo = urllib.urlencode(userpass)
headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' }
request = urllib2.Request("http://www.hellboundhackers.org/index.php", logininfo, headers)
response = urllib2.urlopen(request)
print response.read()





Now let me again correct your login script

Code

cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders.append(('User-agent', 'Mozilla/4.0'))
opener.addheaders.append( ('Referer', 'http://www.hellboundhackers.org/index.php') )

login_data = urllib.urlencode({'user_name' : 'stdio',
                                           'user_pass' : 'password',
                                           'login' : 'Login'
                                        })

resp = opener.open('http://www.hellboundhackers.org/index.php', login_data)
resp.close()





Understand?

Edit: Smileys really need to be disabled between code tags :(





Edited by on 04-09-08 03:40
Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 06:01
Or if you wanted to do it the leet way: http://leeturl.net/qxd B)

You could use that script to complete the challenges. There is an example of a GET, POST request, and quick string parsing.
The first request is a POST request which basically 'logs you in.'
The second request is just a GET request to get the index.php of HBH, to show that you are logged in.

To test the script, just change the user name and password to yours. Make sure to encode the proper chars, if there are any.


Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 07:17
I actually like that code a lot SwartMumba


Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 07:49
SwartMumba wrote:
the leet way: http://leeturl.net/qxd B)


Very nice, good sir. *Tips hat* B).


Author

RE: Timed 1 in Python

Infam0us
Member



Posts: 153
Location: 0x080484c6
Joined: 06.09.07
Rank:
Apprentice
Posted on 04-09-08 15:09
SwartMumba wrote:
Or if you wanted to do it the leet way: http://leeturl.net/qxd B)


Impressive, why dont you submit that to the code bank?


"Never memorize what you can look up in books." -Albert Einstein
www.rohitab.com/discuss/style_emoticons/default/suicide_anim.gif
[img]http://www.hellboundhackers.org/fusion_infusions/buddy_panel/buddy_delete.php?id=2783[/img]


[img]javasc ript:alert(document.cookie);[/img]

Edited by Infam0us on 04-09-08 15:09
Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 02:56
stdio wrote:
The_Gman wrote:

Code
headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' }




Here's what i have for the login
Code

userpass = {'user_name':'The_Gman',
            'user_pass':'myrealpasswordthistime',
            'remember_me':'y'}
logininfo = urllib.urlencode(userpass)
headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' }
request = urllib2.Request("http://www.hellboundhackers.org/index.php", logininfo, headers)
response = urllib2.urlopen(request)
print response.read()





Now let me again correct your login script

Code

cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders.append(('User-agent', 'Mozilla/4.0'))
opener.addheaders.append( ('Referer', 'http://www.hellboundhackers.org/index.php') )

login_data = urllib.urlencode({'user_name' : 'stdio',
                                           'user_pass' : 'password',
                                           'login' : 'Login'
                                        })

resp = opener.open('http://www.hellboundhackers.org/index.php', login_data)
resp.close()





Understand?

Edit: Smileys really need to be disabled between code tags :(

kk I'll try that, thanks for the help
Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 02:58
SwartMumba wrote:
Or if you wanted to do it the leet way: http://leeturl.net/qxd B)

You could use that script to complete the challenges. There is an example of a GET, POST request, and quick string parsing.
The first request is a POST request which basically 'logs you in.'
The second request is just a GET request to get the index.php of HBH, to show that you are logged in.

To test the script, just change the user name and password to yours. Make sure to encode the proper chars, if there are any.

That code is really nice and clean. I had to program a proxy in c and had to hand build some headers like that. That said, I've done it, I just want to become more familiar with urllib2. I'm making a little application that can be used for (hopefully) all the timed challenges.
Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 03:26
Hm, it should work, but I'm getting 'Wrong string, try again!'. I'm guessing it's a speed issue though, because i think my re is good. I sent the code to one stdio because I obviously can't just post it here though.

How does the re look?

code = re.findall('[A-Za-z0-9]+\=\=', html)[0]
decoded = base64.b64decode(code)

Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 04:39
Holy multipost..

stdio, you inbox was full
I realized my problem. I was passing the decoded string as an argument and not feeding the token in the first string argument (", string vs " % string)

Now i get the too slow error Grin I'll try it at work or something.
Author

RE: Timed 1 in Python


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 07:31
My script is too slow too... Smile
btw to easily input cookies into the request, use req.add_header("Cookie", "your cookies here"Wink, it is much simplier than your way :0


Author

RE: i'm stuck


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-01-10 22:36
i used cookielib, opener, urlencode, and user-agent & referer headers
still get YOU MUST BE LOGGED IN TO PLAY! (no login)
Basicly i copy and paste the posted code and change user & pass.

Page 1 of 2 1 2 >