Asp中Response.write出现乱码
现象:普通的html文字显示正常,但用response.write等asp代码输出的文字就出现乱码
解决方法:起初以为是浏览器编码出错的原因,所有在代码中加入
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
但还是出现乱码,问题没解决,上面的代码指定的是html静态文字的编码
最后查资料反省是codepage的原因
asp内部是Unicode的,所有文本都是Unicode存储的,所以若没有指定codepage,默认输出的是Unicode编码
但我们的浏览器默认是简体中文编码,所以输出会出现乱码。
<%@ codepage=936%> 简体中文
<%@ codepage=950%> 繁体中文
<%@ codepage=65001%> UTF-8
于是在文件开头(codepage只能出现在文件的第一行)添加<%@ codepage=936%>
问题解决了
相关文档:
<head runat="server">
<title></title>
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<script language="JavaScript"> ......
1.放注入函数
sub aspsql()
SQL_injdata = "'|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post) ......
<!--#include file="config.asp" -->
<!--#include file="Fun.asp" -->
<%
'数据库管理类
class Datas
'备份
public sub Bk()
Set fso=server.createobject("scripting.filesystemobject")
fso.CopyFile Server.MapPath(SiteDataPath),Server.MapPath(SiteDataBakPath)
......
sub aspsql()
SQL_injdata = "'|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post),Sql_Inj ......
漏洞描述:
在login.asp中,接收用户输入的Userid和Password数据,并分别赋值给user和pwd,然后再用sql="select * from admin where username="&user&" and password="&pwd&"" 这句来对用户名和密码加以验证。
以常理来考虑的话,这是个很完整的程序了。而在实际的使用过程中,整套程序也的 ......