本帖最后由 sundm3615 于 2010-08-06 11:41:34 编辑

解决方案 »

  1.   

    主要匹配单引号,分号,#号,及括号、\s代表空格,\b 查找位于单词的开头或结尾的匹配
    后面的都是sql关键字 | 是或者的意思,相当于 js 语法的 || 与运算
      

  2.   

    给你再补充几个 ."xp_cmdshell","exec master","net localgroup administrators"
      

  3.   

    注入不是靠正则就可以挡住的
    只要写的够复杂, 就有可能绕过这种判断。更关键的是正则的误伤太严重了。
    你比如我回帖:Hi, boy, please select your choice! then I will update them and create a new account for you.你说这一下子装上了多少个关键字?
      

  4.   

    应该是这样:
    exec master..xp_cmdshell 是 sql 为对外开放的一个命令。
    net localgroup 也是一个命令。
    可以差一些资料看看
    http://chinapyjjq.blog.163.com/blog/static/51499597200952710223623/
      

  5.   

    最好 用存储过程或者 参数化SQL写数据库操作