Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Possible ? Bash with wget and awk/sed


ghost's Avatar
0 0

Hi,

I have a general question about the times challanges. I wan't to finish them using only command line tools like wget, sed, awk etc. This seems to be possible in terms of speed. But I have the problem I can't get wget to login correctly and save the cookie. Maybe someone of you can help me with this.

Heres what I do: markupwget --save-cookies cookie.txt --post-data='user_name=CBO=&user_pass=******&login=Login' http://www.hellboundhackers.org/index.php --referer=http://www.hellboundhackers.org/index.php -U 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2) Firefox/3.6' I wan't to save cookies in cookie.txt. Then I want to login with this cookie using: markupwget --load-cookies cookie.txt http://www.hellboundhackers.org/challenges/timed/timed1/index.php

But no luck, I don't get logged in. Maybe hbh itself doesn't allow to access it with something like lynx or wget ? Or do I have to use another syntax to achieve this goal.

thx indeed

P.S. I know using bash might be a crazy idea, but I'm a bashlover and for a poc it just works and can be done fast.


ghost's Avatar
0 0

Ok my POC works, I only had a typo in the post string I gave to wget. Thanks indeed ;)


ghost's Avatar
0 0

Any time.


ghost's Avatar
0 0

My problem is in using wget too:

wget -O -                                                                               \
     --load-cookies /tmp/cookie                                                         \
     --referer      'http://www.hellboundhackers.org/challenges/timed/timed9/index.php' \
     --post-data    'answer=XY&submit=Answer%21'                                        \
     http://www.hellboundhackers.org/challenges/timed/timed9/index.php                  \
| w3m -T text/html

If i run this code, than the site detects my identity, so the cookies are OK, but i get the 'challange' instead of the 'wrong answer' page. Is my post-data right, or what's missing…? o_O