copy Bookmark http://www.51testing.com/?84727
上一篇 / 下一篇 2014-10-16 21:52:18
用户名输入 a' or 1 = 1密码: b' or 1 = 1防止1)参数化2)过滤掉注入字符,如or --
请问怎么防止,能给与一些代码吗?感谢
1) 参数化是最有效的办法javastmt.setInt(j++, xxx);stmt.setString(j++, xxx);stmt.setDouble(j++, xxxx);2) 当你传递参数的时候,自动过滤掉里面的敏感字符通常为replace(str, '--', ''),replace(str, "delete', ''),replace(str, ' or 1=1', '')sql注入只能防止,不能100%过滤掉的
收藏 举报
TAG:
评分:0
验证
提交评论