1 Jun 2014

How to Hack Facebook id Using Session hijacking.


How to Hack Facebook Account Using Session Hijacking


This is a tutorial that demonstrates just how simple it is to get access to Facebook accounts without the user’s password or username. This tutorial demonstrates Session Hijacking (discussed here: : Top 10 Ways How Hackers Can Hack Facebook Accounts. This is a simple attack done on an unsecured WiFi network with the permission of all users on the network.

The aims of this tutorial are:

  • Educate users on the dangers of using unsecured wireless connections.
  • Educate wireless connections managers in the aim that they will protect their wireless network.
  • Demonstrate the simplicity of this attack and why there is need to find a solution for this attack.
  • Get users to stop using unsecured wireless connections.

Requirements:

  • Someone on the network must be on Facebook at the time for you to steal their session information.
  • You WiFi adapter must have monitor mode support in order to scan all packets transferred over a network. If it doesn't, you would only be scanning your own packets. To learn more about monitor mode and about enabling monitor mode on your Wireless card, visit http://www.aircrack-ng.org/doku.php?id=airmon-ng

So here is a step by step explanation of how to carry out this attack:

=> First of all, you would need to connect to an unsecured wireless connection that others are using. Then we start capturing packets transferred over this network. Note that your wireless adapter needs to support monitor mode to scan all packets transferred over a network. you can check your wifi card specifications to see if it supports monitor mode.
=>We would then need to use a network sniffing tool so sniff packets transferred over the network. In this case, I am using a tool called Wire shark (http://www.wireshark.org). Within wire shark, there is a menu called “Capture”; Under the capture menu, select interfaces from that menu, and a list of your interfaces will come up:


How to Hack Facebook id Using Session hijacking.

=> Next you select Start Next to the interface that you have enabled monitor mode on. most times it is the interface that is capturing the most packets. In my case, Microsoft interface is capturing the most packets, so i will select to start capturing with the Microsoft interface. You would leave wire shark to capture packets for a couple of seconds depending on the amount of persons currently using the network. Say 30 seconds if 10 people currently are using the network, or 30 minutes if there is barely network activity going on. While capturing, wire shark will look something like this:


How to Hack Facebook id Using Session hijacking.


=> After capturing a certain amount of packets, or running the capture for a certain amount of time, stop it by clicking on the stop current capture button.


How to Hack Facebook id Using Session hijacking.

=> After stopping the capture, you will need to look for the user’s Facebook session cookie which, hopefully was transferred in one of the packets captured. to find this cookie, use the wire shark search which can be found by pressing “Ctrl + f” on your keyboard. In this search interface, select Find: By “String”; Search In: “Packet Details”. and Filter by the string “Cookie”.

How to Hack Facebook id Using Session hijacking.

=> When you press find, if there is a cookie, this search will find it, if no cookie was captured, you will have to start back at step 2. However, if you're lucky and some cookies we’re captured, when you search for cookie, your interface will come up looking like this in the diagram below. You would notice the cookie next to the arrow contains lots of data, to get the data. the next thing you do is to right click on the cookie and click copy->description.

How to Hack Facebook id Using Session hijacking.

=> After copying the description, paste it in a text file, and separate each variable to a new line (note the end of every variable is depicted by a semicolon eg – c_user=100002316516702;).
=> After some research and experimenting, i figured out that Facebook authenticated the user session by 2 cookies called c_user and XS. Therefore you will only need the values of these cookies, and then need to inject them into your browser. Before injecting the cookies, here is what my Facebook page looked like:

How to Hack Facebook id Using Session hijacking.

=> The next thing you would need to do is to inject this information as your own cookie. so firstly you would need to install a cookie manager extension for your browser, I’m using Firefox Cookie Manager. After installing this extension, you will find it under Tools->cookie manager. The interface for cookie manager looks like this:

How to Hack Facebook id Using Session hijacking.

=> The first thing we would need to do is to clear all cookies, so clear all the cookies you currently have. Then select the “Add Cookie” link to add a new cookie. The first cookie you will add is the c_user cookie which will have the following information:: Domain – “.Facebook.com”, name-”c_user”, value-”the value you copied earlier from the wire shark scanning” and the Path-”/”; leave the is Secure and Expires On values to default:

How to Hack Facebook id Using Session hijacking.

=> The next thing you do is to hit the “Add” button and the cookie is saved. Repeat the same steps to add the XS cookie with all of the same information, except the value, which would be the XS value you have.

How to Hack Facebook id Using Session hijacking.

=> After adding these 2 cookies, just go to Facebook.com refresh the page and… Boom!! you will see you are logged in as that user whose cookie information you stole. Here is my Facebook page after i injected those cookies:

How to Hack Facebook id Using Session hijacking.


0 comments:

Post a Comment