Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

Java login not working


BrandonHeat's Avatar
Member
0 0

Hi, I'm trying to login to HBH using java, but for some reason my code isn't wokring. I'm not getting an error or anything, just no result at all. Could someone have a look at the code and point me in the right direction? Any help is appreciated. (I know I'll need PHPSESSID later on when going to the mission URL, but I should be getting some result at this stage first).

My code: http://pastebin.com/DN8rBUtv

Edit: after editing the code a little, I've managed to make it connect to HBH, but when I move to a URL different from the homepage(some of the timed challenges), it says I'm not logged in. I am passing the PHPSESSID in a cookie, is there something else I need other than the session id?


j4m32's Avatar
Member
0 0

Yes, this website is based on PHP-fusion, there are two/three other cookies that are set but one of them is probably most important:

fusion_user=blah.blah;

This is necessary for the CMS to know that you're logged in (I think).

There are also two others: fusion_visited=TRUE; and fusion_lastvisit=time(seconds, probably a UNIX timestamp);

I don't think these are as important. Hope this helps!

Jim,


ghost's Avatar
0 0

j4m32 wrote: Hope this helps! It doesn't, as cookies have nothing to do with his problem. I'd say what it is, but then I don't want to help such a blatant java user. Suffice it to say that this problem has come up and been mentioned over and over again for the timed challenges.


j4m32's Avatar
Member
0 0

@COM: Ah fair do, I think it's harder to use Java for these challanges because it over complicates the simple, I hadn't read the code so I just took a guess… :P

Jim,


BrandonHeat's Avatar
Member
0 0

@j4m32: Thanks, Jim, you really helped me out a lot.

@COM: Actually, that's exactly what my problem was. Works like a charm now.

In case there are other "blatant" java users like me out there having trouble with this, here's how I did it: http://pastebin.com/DN8rBUtv

Of course that's just the connection part and you have to get the data and solve the challenge yourselves, and you don't really need to print everything to the screen, I just wanted to see that it works :)


ghost's Avatar
0 0

BrandonHeat wrote: @COM: Actually, that's exactly what my problem was. Works like a charm now. Actually, no. Notice how you have a user agent in there now (which you didn't before when I checked it)? Yeah…


BrandonHeat's Avatar
Member
0 0

Thread revival:

OK, so my code works perferctly for HBH, I've already finished 5 or 6 of the programming challenges and everything is fine, but for the life of me I can't ajust my code to work for HTS. I've asked there, but nobody seems to know. Do you know what I need to add, I've trying setting all the request properties to match what I get with tamper data, filled in all the cookie values, but to no avail. If anyone here has also done some programming challenges at HackThisSite, could you please give me a hand. Thanks.