XSS content expansion-counterfeit your IP address

Source: Internet
Author: User

1. We all know that when you browse the website, the server of the other party will record your IP address. What if we forge an IP address as XSS code? Changing the IP address to XSS is not to modify the PC end, but to modify the IP address in the browser, that is, the client on the webpage.

2. Required

One in Firefox

One Firefox attachment X-forwarded-for header

Because PHP has three functions to obtain the IP address. X-forwarded-for header is used for one of the x_forwarded_for functions. x_forwarded_for has a defect that can make the client forge any IP address, including strings, but it won't work for the other two functions.

One Firefox attachment modify Headers

Modify headers can forge the packet content, and of course it can also forge http_client_ip to change the IP address.

How can I modify the remote_addr function to obtain the IP address? The answer is that it cannot be modified.

Remote_addr is a parameter passed to PhP by nginx, so it is the IP address of the client that nginx communicates directly with before, and we cannot intervene. So once the other party uses the remote_addr function to obtain the IP address, there is no way. But it doesn't matter. There are three functions in total, and two functions can be forged. We still have a great success rate. Okay, start forging.

3. View operations

Operation 1:

Operation 2:

 

 

Action 3: Access http://www.ip138.com/

Result

 

Reference: http://www.freebuf.com/articles/web/42727.html

 

XSS content expansion-counterfeit your IP address

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.