exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Memcached Stats Amplification Scanner

Memcached Stats Amplification Scanner
Posted Aug 31, 2024
Authored by Jon Hart, xistence, Marek Majkowski | Site metasploit.com

This Metasploit module can be used to discover Memcached servers which expose the unrestricted UDP port 11211. A basic "stats" request is executed to check if an amplification attack is possible against a third party.

tags | exploit, udp
advisories | CVE-2018-1000115
SHA-256 | cb5539054159e5bd7eb5991e8ba1abaed61e1b1644670a36b4815d24c61a9cab

Memcached Stats Amplification Scanner

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Exploit::Capture
include Msf::Auxiliary::UDPScanner
include Msf::Auxiliary::DRDoS

def initialize
super(
'Name' => 'Memcached Stats Amplification Scanner',
'Description' => %q(
This module can be used to discover Memcached servers which expose the
unrestricted UDP port 11211. A basic "stats" request is executed to check
if an amplification attack is possible against a third party.
),
'Author' =>
[
'Marek Majkowski', # Cloudflare blog and base payload
'xistence <xistence[at]0x90.nl>', # Metasploit scanner module
'Jon Hart <jon_hart@rapid7.com>', # Metasploit scanner module
],
'License' => MSF_LICENSE,
'DisclosureDate' => 'Feb 27 2018',
'References' =>
[
['URL', 'https://blog.cloudflare.com/memcrashed-major-amplification-attacks-from-port-11211/'],
['CVE', '2018-1000115']
]
)

register_options([
Opt::RPORT(11211)
])
end

def build_probe
# Memcached stats probe, per https://github.com/memcached/memcached/blob/master/doc/protocol.txt
@memcached_probe ||= [
rand(2**16), # random request ID
0, # sequence number
1, # number of datagrams in this sequence
0, # reserved; must be 0
"stats\r\n"
].pack("nnnna*")
end

def scanner_process(data, shost, sport)
# Check the response data for a "STAT" response
if data =~ /\x0d\x0aSTAT\x20/
@results[shost] ||= []
@results[shost] << data
end
end

# Called after the scan block
def scanner_postscan(batch)
@results.keys.each do |host|
response_map = { @memcached_probe => @results[host] }
report_service(
host: host,
proto: 'udp',
port: rport,
name: 'memcached'
)

peer = "#{host}:#{rport}"
vulnerable, proof = prove_amplification(response_map)
what = 'memcached stats amplification'
if vulnerable
print_good("#{peer} - Vulnerable to #{what}: #{proof}")
report_vuln(
host: host,
port: rport,
proto: 'udp',
name: what,
refs: references
)
else
vprint_status("#{peer} - Not vulnerable to #{what}: #{proof}")
end
end
end
end
Login or Register to add favorites

File Archive:

October 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    39 Files
  • 2
    Oct 2nd
    23 Files
  • 3
    Oct 3rd
    18 Files
  • 4
    Oct 4th
    0 Files
  • 5
    Oct 5th
    0 Files
  • 6
    Oct 6th
    0 Files
  • 7
    Oct 7th
    0 Files
  • 8
    Oct 8th
    0 Files
  • 9
    Oct 9th
    0 Files
  • 10
    Oct 10th
    0 Files
  • 11
    Oct 11th
    0 Files
  • 12
    Oct 12th
    0 Files
  • 13
    Oct 13th
    0 Files
  • 14
    Oct 14th
    0 Files
  • 15
    Oct 15th
    0 Files
  • 16
    Oct 16th
    0 Files
  • 17
    Oct 17th
    0 Files
  • 18
    Oct 18th
    0 Files
  • 19
    Oct 19th
    0 Files
  • 20
    Oct 20th
    0 Files
  • 21
    Oct 21st
    0 Files
  • 22
    Oct 22nd
    0 Files
  • 23
    Oct 23rd
    0 Files
  • 24
    Oct 24th
    0 Files
  • 25
    Oct 25th
    0 Files
  • 26
    Oct 26th
    0 Files
  • 27
    Oct 27th
    0 Files
  • 28
    Oct 28th
    0 Files
  • 29
    Oct 29th
    0 Files
  • 30
    Oct 30th
    0 Files
  • 31
    Oct 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close