Memcached Stats Amplification Scanner - Metasploit
This page contains detailed information about how to use the auxiliary/scanner/memcached/memcached_amp metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Memcached Stats Amplification Scanner
Module: auxiliary/scanner/memcached/memcached_amp
Source code: modules/auxiliary/scanner/memcached/memcached_amp.rb
Disclosure date: 2018-02-27
Last modification time: 2020-10-02 12:20:05 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 11211
List of CVEs: CVE-2018-1000115
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.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
This module is a scanner module, and is capable of testing against multiple hosts.
msf > use auxiliary/scanner/memcached/memcached_amp
msf auxiliary(memcached_amp) > show options
... show and set options ...
msf auxiliary(memcached_amp) > set RHOSTS ip-range
msf auxiliary(memcached_amp) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(memcached_amp) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(memcached_amp) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(memcached_amp) > set RHOSTS file:/tmp/ip_list.txt
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
Vulnerable Application
Any instance of memcached with the UDP listener enabled will suffice.
Instructions for testing against Ubuntu 16.04, CentOS 7 and a Dockerized endpoint are provided below.
Ubuntu 16.04
To a desktop or server Ubuntu 16.04 instance, simply install memcached:
apt-get install memcached
Then configure it to listen on something other than the loopback interface:
sed -i 's/-l 127.0.0.1/#-l 127.0.0.1/g' /etc/memcached.conf
service memcached restart
CentOS 7
To a CentOS 7 instance, simply install and start memcached, as it listens on 0.0.0.0 by default'
yum -y install memcached
systemctl start memcached
Docker Install
In memcached 1.5.5 and earlier, the daemon is vulnerable by default. As such, we can use the community supported memcached container and simply expose it:
docker run -ti --rm -p 11211:11211/udp memcached:1.5.5
Verification Steps
- Install the application
- Start msfconsole
- Do:
use auxiliary/scanner/memcached/memcached_amp
- Do:
set rhosts [IPs]
- Do:
run
- Confirm that the endpoint is discovered vulnerable to the memcached amplification vulnerability.
Scenarios
Ubuntu 16.04
Configure memcached as described above.
msf5 > use auxiliary/scanner/memcached/memcached_amp
msf5 auxiliary(scanner/memcached/memcached_amp) > set RHOSTS a.b.c.d
RHOSTS => a.b.c.d
msf5 auxiliary(scanner/memcached/memcached_amp) > run
[+] a.b.c.d:11211 - Vulnerable to MEMCACHED amplification: No packet amplification and a 78x, 1163-byte bandwidth amplification
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
CentOS 7
Configure memcached as described above.
msf5 > use auxiliary/scanner/memcached/memcached_amp
msf5 auxiliary(scanner/memcached/memcached_amp) > set RHOSTS a.b.c.d
RHOSTS => a.b.c.d
msf5 auxiliary(scanner/memcached/memcached_amp) > run
[+] a.b.c.d:11211 - Vulnerable to MEMCACHED amplification: No packet amplification and a 68x, 1015-byte bandwidth amplification
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
Docker
Configure memcached in docker as described above.
msf5 > use auxiliary/scanner/memcached/memcached_amp
msf5 auxiliary(scanner/memcached/memcached_amp) > set RHOSTS a.b.c.d
RHOSTS => a.b.c.d
msf5 auxiliary(scanner/memcached/memcached_amp) > run
[+] a.b.c.d:11211 - Vulnerable to MEMCACHED amplification: 2x packet amplification and a 126x, 1880-byte bandwidth amplification
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
Go back to menu.
Msfconsole Usage
Here is how the scanner/memcached/memcached_amp auxiliary module looks in the msfconsole:
msf6 > use auxiliary/scanner/memcached/memcached_amp
msf6 auxiliary(scanner/memcached/memcached_amp) > show info
Name: Memcached Stats Amplification Scanner
Module: auxiliary/scanner/memcached/memcached_amp
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2018-02-27
Provided by:
Marek Majkowski
xistence <[email protected]>
Jon Hart <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
BATCHSIZE 256 yes The number of hosts to probe in each set
FILTER no The filter string for capturing traffic
INTERFACE no The name of the interface
PCAPFILE no The name of the PCAP capture file to process
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 11211 yes The target port (UDP)
SNAPLEN 65535 yes The number of bytes to capture
THREADS 10 yes The number of concurrent threads
TIMEOUT 500 yes The number of seconds to wait for new data
Description:
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.
References:
https://blog.cloudflare.com/memcrashed-major-amplification-attacks-from-port-11211/
https://nvd.nist.gov/vuln/detail/CVE-2018-1000115
Module Options
This is a complete list of options available in the scanner/memcached/memcached_amp auxiliary module:
msf6 auxiliary(scanner/memcached/memcached_amp) > show options
Module options (auxiliary/scanner/memcached/memcached_amp):
Name Current Setting Required Description
---- --------------- -------- -----------
BATCHSIZE 256 yes The number of hosts to probe in each set
FILTER no The filter string for capturing traffic
INTERFACE no The name of the interface
PCAPFILE no The name of the PCAP capture file to process
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 11211 yes The target port (UDP)
SNAPLEN 65535 yes The number of bytes to capture
THREADS 10 yes The number of concurrent threads
TIMEOUT 500 yes The number of seconds to wait for new data
Advanced Options
Here is a complete list of advanced options supported by the scanner/memcached/memcached_amp auxiliary module:
msf6 auxiliary(scanner/memcached/memcached_amp) > show advanced
Module advanced options (auxiliary/scanner/memcached/memcached_amp):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
GATEWAY_PROBE_HOST 8.8.8.8 yes Send a TTL=1 random UDP datagram to this host to discover the default gateway's MAC
GATEWAY_PROBE_PORT no The port on GATEWAY_PROBE_HOST to send a random UDP probe to (random if 0 or unset)
NUM_REQUESTS 1 no Number of requests to send
SECRET 1297303073 yes A 32-bit cookie for probe requests.
SRCIP no Use this source IP
ScannerMaxResends 10 yes The maximum times to resend a packet when out of buffers
ScannerRecvInterval 30 yes The maximum numbers of sends before entering the processing loop
ScannerRecvQueueLimit 100 yes The maximum queue size before breaking out of the processing loop
ScannerRecvWindow 15 yes The number of seconds to wait post-scan to catch leftover replies
ShowProgress true yes Display progress messages during a scan
ShowProgressPercent 10 yes The interval in percent that progress should be shown
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the scanner/memcached/memcached_amp module can do:
msf6 auxiliary(scanner/memcached/memcached_amp) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the scanner/memcached/memcached_amp auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(scanner/memcached/memcached_amp) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
<PEER> - Not vulnerable to <WHAT>: <PROOF>
Here is a relevant code snippet related to the "<PEER> - Not vulnerable to <WHAT>: <PROOF>" error message:
77: port: rport,
78: proto: 'udp',
79: name: what,
80: refs: references
81: )
82: else
83: vprint_status("#{peer} - Not vulnerable to #{what}: #{proof}")
84: end
85: end
86: end
87: end
Go back to menu.
Related Pull Requests
- #14212 Merged Pull Request: Fix invalid disclosure date formats
- #9676 Merged Pull Request: Add disclosure date and correct CVE for memcached amp
- #9644 Merged Pull Request: Add Memcached amplification scanner
References
- https://blog.cloudflare.com/memcrashed-major-amplification-attacks-from-port-11211/
- CVE-2018-1000115
See Also
Check also the following modules related to this module:
- auxiliary/scanner/memcached/memcached_udp_version
- auxiliary/gather/memcached_extractor
- auxiliary/dos/misc/memcached
- auxiliary/scanner/dns/dns_amp
- auxiliary/scanner/portmap/portmap_amp
- auxiliary/scanner/upnp/ssdp_amp
- auxiliary/scanner/udp/udp_amplification
- exploit/windows/browser/aol_ampx_convertfile
- exploit/windows/fileformat/abbs_amp_lst
- auxiliary/admin/mssql/mssql_findandsampledata
- auxiliary/gather/doliwamp_traversal_creds
- auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt
- exploit/windows/browser/ms10_026_avi_nsamplespersec
- exploit/windows/browser/nctaudiofile2_setformatlikesample
- exploit/windows/browser/winamp_playlist_unc
- exploit/windows/browser/winamp_ultravox
- exploit/windows/fileformat/gta_samp
- exploit/windows/fileformat/winamp_maki_bof
- exploit/windows/http/xampp_webdav_upload_php
- exploit/windows/local/ms13_053_schlamperei
- exploit/windows/misc/citrix_streamprocess
- exploit/windows/misc/citrix_streamprocess_data_msg
- exploit/windows/misc/citrix_streamprocess_get_boot_record_request
- exploit/windows/misc/citrix_streamprocess_get_footer
- exploit/windows/misc/citrix_streamprocess_get_objects
Authors
- Marek Majkowski
- xistence <xistence[at]0x90.nl>
- Jon Hart <[email protected]>
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.