baner

Chủ Nhật, 5 tháng 1, 2014

Session Hijacking

Picture

WHAT IS SESSION HIJACKING? WHAT DO YOU USE?

Session Hijacking, is when you take someones cookie and inject it into your browser, letting you log in without the password

In beginner terms: Session Hijacking is taking the persons unique code (cookie) stored in their browser while they are logged into something (like GMail). If you have that code, you can put it into your own browser, and trick the system into thinking you are that user. This is a common method on how you can hack emails.

It's a pretty simple concept, however it can be pretty hard to perform if you're still a learner or beginner hacker, and takes a lot of programs. 

So, to get started we need the proper tools for this sorta thing:

Cain and Abel: (Only if you're going to do this on Windows)
http://www.net-security.org/software.php?id=110

Network Miner: (Alternative to Wireshark)
http://sourceforge.net/projects/networkminer/

Wireshark: (What we use in this particular tutorial)
http://www.wireshark.org

Now that we have what we need, move on down to part 2! 


Session Hijacking PART 2

Picture
HOW DO YOU PERFORM "SESSION HIJACKING"?

Ok, now it's time to actually hijack the session token and get into that account!

In this specific tutorial, we will focus on GMail, which uses a cookie called the GX Cookie. This is vital because we need to know exactly what we are trying to capture before capturing it, because computers, as you may know, need things to be very specific,

First off, we gotta decide which path to take. If you're on a hub based network, you can find local traffic with packet sniffers. Here, we will be using Wireshark.
Let's start by downloading Wireshark (link was given above). Install it and then, once opened, click on Analyze, then click on Interfaces. Now click on the interface appropriate to you and click Start. 

Picture
Now Wireshark should start capturing the traffic. By now you should start seeing the term "packets", this is a term used in wireless connections. For more information on this "packet" term, you can go to my Wireless Cracking tutorial. I explain more stuff there about wireless. After all, It's about wireless cracking!

So now that you're capturing the data packets, you can log into gmail and set the "Don't use https://" option. This option will make you vulnerable to these session hijacking attacks. We want to do this so that you can practice hacking on yourself. 

Next, set the filter on the top left to http.cookie contains "Gx" in Wireshark to filter out all the unnecessary stuff... we just want the GX cookie. Got that? Once you have found the right line of Gmail GX Cookie, right click on it and click "copy", then click "Bytes (Printable Text Only)"

Yay! You just capture the GX Unsecured cookie! Keep in mind now before you do this that you would need a Wincap before capturing the traffic from Wireshark (or Network Miner for that matter) 


This concludes Part 2. Scroll down the part 3 now if you're still thirsty for hacking goodness! 

Session Hijacking PART 3

PictureHOW DO I INJECT IT INTO MY BROWSER AND GET INTO THE ACCOUNT?

So, congratulations so far on reading this much! But, you may be wondering how capturing the cookie did anything if you're not on the account yet? Well... Thats because you still have to complete the injection part, where you trick your browser into thinking you are that person you're hacking, so it will let you go on the account. This is sorta the key part of this session hijacking stuff.

Firstly, there are a ton of plug-ins for achieving the injection part, and like you may have guessed, their free! They usually fall under the category of "Cookie Editors".

In this tutorial, we will be using the Firefox Browser, it's by far the best for the injection part of session hijacking! You will also need the "Developer Toolbar" for it , as this is what we will be using in the tutorial.

Firefox Browser: 
http://www.mozilla.org/en-US/

Developer Toolbar:https://addons.mozilla.org/en-US/firefox/addon/web-developer/

Once you have installed the WebDeveloper Toolbar, click on the "cookie" drop-down menu, and select the cookie you want to edit. Once you have selected the "Edit Cookie" option, you should get the following screen on the side.

Now replace the cookie value with your victims cookie value.

In this tutorial we used Wireshark, so there is an easier way for us to achieve the same thing. Instead of using WebDeveloper Toolbar, you may just use the Cookie Injector with GreasMonkey installed to inject it directly into your browser. Simply press     Alt-C after installing it and just paste the Wireshark cookie dump, then press OK. Now just refresh your browser and you are in your victims account!

GreasMonkey:https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/

Now, session hijacking isn't always that great under certain circumstances:
1. First of all cookie stealing becomes useless if victim is using a https:// protocol for browsing and end to end encryption is enabled.

2. Most of the cookies expire once the victims clicks on the logout button and hence the attacker also logs out of the account.

3. Lots of websites do not sport parallel logins which also makes cookie stealing useless.

Although these seem like major drawbacks, It's still good to know. Not only that but lots of people leave their accounts logged in all day! (Facebook users, I'm pointing at you!)

Thanks for reading this, and I hope you use this along your hacking journey!

0 nhận xét:

Đăng nhận xét