用户输入过滤程序.asp
来自「较为详细的介绍了asp自定义的各种函数,方便asp的各种开发.」· ASP 代码 · 共 15 行
ASP
15 行
<%
strUserInput="Smith'%;EXEC master..xp_cmdshell 'dir *.exe"
strUserInput=Replace(strUserInput,"<",vbNullString)
strUserInput=Replace(strUserInput,">",vbNullString)
strUserInput=Replace(strUserInput,"""",vbNullString)
strUserInput=Replace(strUserInput,"'",vbNullString)
strUserInput=Replace(strUserInput,"%",vbNullString)
strUserInput=Replace(strUserInput,";",vbNullString)
strUserInput=Replace(strUserInput,"(",vbNullString)
strUserInput=Replace(strUserInput,")",vbNullString)
strUserInput=Replace(strUserInput,"&",vbNullString)
strUserInput=Replace(strUserInput,"+",vbNullString)
strUserInput=Replace(strUserInput,"-",vbNullString)
response.write strUserInput
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?