中国网络渗透测试联盟
标题:
对特殊字符的过滤代码
[打印本页]
作者:
admin
时间:
2012-9-15 14:40
标题:
对特殊字符的过滤代码
public Function RSQL(strChar)
& q: f; }/ c( V& }1 `: F" U
If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function
9 L& E1 X! a- z D& [ z
Dim strBadChar, arrBadChar, tempChar, I
& {4 u6 {5 o" N) V' @" M1 z. g
strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00
2 k0 z: ~2 e# O, @. I4 V
arrBadChar = Split(strBadChar, ",")
' i" [) r0 ^( H
tempChar = strChar
, J/ v- ~+ z% p" q% G& ?9 R
For I = 0 To UBound(arrBadChar)
# e/ {. p4 B4 a) |
tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空
" u+ W0 Y3 G3 B! P* I
Next
z9 L K0 ~# r( z
RSQL = tempChar
6 U9 [4 ]+ p2 B! C
End Function
3 v6 F+ \0 H/ Q& k0 D
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/)
Powered by Discuz! X3.2