温柔的杀手——跨站ASP Script攻击
2006-11-06 19:58:24 来源:WEB开发网
'redirect if detect the cookie
Dim strRedirectUrl
strRedirectUrl = "page2.asp?userName="
strRedirectUrl = strRedirectUrl & _
server.URLEncode(Request.Cookies("userName"))
Response.Redirect(strRedirectUrl)
Else %>
<HTML>
<HEAD>
<META http-equiv="Content-Type"content="text/html; charset=ISO-8859-1">
<TITLE>MyNiceSite.com Home Page</TITLE>
</HEAD>
<script LANGUAGE="javascript">
<!--
function checkForm() {
document.forms[0].userName.value =
RemoveBad(document.forms[0].userName.value);
return true;
}
//******************************************************
//Programmer: NOT ORIGINAL CODE - COMES FROM MICROSOFT
//Code Source: Microsoft Knowledge Base Article Q25z985
//Description: Removes bad characters.
//******************************************************
function RemoveBad(strTemp) {
strTemp =strTemp.replace(/</>/"/'/\%/;/(/)/&/+/-/g, "");
return strTemp;
}
//-->
</SCRIPT>
<BODY>
<BR>
<H2>MyNiceSite.com</H2>
<BR>
<FORM method="post"action="page2.asp" onsubmit="return checkForm();">
更多精彩
赞助商链接