温柔的杀手——跨站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();">
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
- ››ASP.NET中FileBytes写成文件并存档
- ››asp获取毫秒数
- ››asp.net报“INSERT INTO 语句的语法错误解决
更多精彩
赞助商链接