Author Topic: Short URL | Threaded Mode | Linear Mode Cookie injection - Need help!! Read mo  (Read 726 times)

0 Members and 7 Guests are viewing this topic.

Offline Hackme_mr

  • NULL
  • Posts: 4
  • Cookies: 0
    • View Profile
Hello...!

I have been given a lab work where I need to hack a web site using Cookie SQL Injection. The username(agentjax) and password(password_here) are present in the cookie and editable. After editing the password to something else and you try login, it gives a generic MySql error. :o Also, the response cookie contains the original set of username(agentjax) and password(password_here), which means I need to inject in POST method if I am not wrong... I am struck here and not sure how to bypass the authentiation!

Could any of you help me out on this! :(
« Last Edit: November 19, 2014, 09:02:35 am by ande »

Offline RedBullAddicted

  • Moderator
  • Sir
  • *
  • Posts: 519
  • Cookies: 189
    • View Profile
I am not an expert on this topic but I guess you need to inject your SQL Statement via the cookie content. Use an intercepting proxy or temper data or something like that and change the values of the cookie (for example cookie:user=admin:password=' or '1' = '1 ). If you google for "sqli cookie" you'll find a lot of tutorials and examples.

Cheers,
RBA
Deep into that darkness peering, long I stood there, wondering, fearing, doubting, dreaming dreams no mortal ever dared to dream before. - Edgar Allan Poe

Offline Hackme_mr

  • NULL
  • Posts: 4
  • Cookies: 0
    • View Profile
Hi RBA,


Thanks. I have tried editing the cookie with ' or '1'=1' . Its not working though.


Thanks for ur reply!



Offline RedBullAddicted

  • Moderator
  • Sir
  • *
  • Posts: 519
  • Cookies: 189
    • View Profile
Yep.. that was just an example. There is always a lot of try and error included with those tasks (at least for me). You get an error when you supply this as password ' or '1' = '1 or does nothing happen? If nothing happens try it with ' or '1' = '2 and see if that makes a difference. As said before I am not a expert on SQLi in any form. Maybe someone else can give you some more tips.
Deep into that darkness peering, long I stood there, wondering, fearing, doubting, dreaming dreams no mortal ever dared to dream before. - Edgar Allan Poe

Offline Hackme_mr

  • NULL
  • Posts: 4
  • Cookies: 0
    • View Profile
Alrighty! Thanks...

Offline Hackme_mr

  • NULL
  • Posts: 4
  • Cookies: 0
    • View Profile
Cracked this one.


Used: SELECT*FROM users WHERE name =''OR'1'='1'--;

Gave that in the password cookie and the site was cracked.

Staff note: removed the strange formatting
« Last Edit: November 19, 2014, 08:45:45 am by RedBullAddicted »