SQL注入式攻击是利用是指利用设计上的漏洞,在目标服务器上运行Sql命令以及进行其他方式的攻击
动态生成Sql命令时没有对用户输入的数据进行验证是Sql注入攻击得逞的主要原因。
比如:
如果你的查询语句是select * from admin where username='"&user&"' and password='"&pwd&"'"
那么,如果我的用户名是:1' or '1'='1
那么,你的查询语句将会变成:
select * from admin where u...
一个防止SQL注入函数(1)
0 or Instr(LCase(Str),"insert ") > 0 or Instr(LCase(Str),"delete ") > 0 or Instr(LCase(Str),"delete from ") > 0 or Instr(LCase(Str),"count(") > 0 or Instr(LCase(Str),"drop table") > 0 or Instr(LCase(Str),"update ") > 0 or Instr(LCase(Str),"truncate ") > 0 or Instr(LCase(Str),"asc(") > 0 or Instr(LCase(Str),"mid(") > 0 or Instr(LCase(Str),"char(") > 0 ...