DDoS Protection , Governance & Risk Management , Patch Management

Memcached DDoS Attacks: 95,000 Servers Vulnerable to Abuse

Massive 1.7 Tbps Reflection/Amplification Attack Exploits Open Memcached Servers
Memcached DDoS Attacks: 95,000 Servers Vulnerable to Abuse
Servers listening on TCP or UDP port 11211 as of March 7. (Source: Shodan)

More than 95,000 servers could still be vulnerable to being abused to launch massive distributed denial-of-service attacks.

See Also: An All-in-One Vulnerability Management, Detection, and Response Solution

The risk comes via Memcached, an open source utility designed to cache in RAM frequently used web pages (see Memcached Servers Deliver Amplified DDoS Attacks).

The web page caching utility was never designed to be internet-accessible and requires no authentication to access. But some administrators - as well as some Linux instances by default - have left TCP or UDP port 11211 open to internet-borne requests.

Attackers have begun demonstrating how badly servers with misconfigured Memcached can be abused.

Source: Arbor Networks

Popular code-sharing website GitHub reported that on Feb. 28, it was hit by a massive DDoS attack that left its site unavailable or intermittently unreachable, but only for 10 minutes. Akamai, which provides DDoS defenses for GitHub, clocked the attack's peak at a whopping 1.35 terabits per second.

On Monday, however, DDoS defense firm Arbor Networks, part of Netscout, reported that one of its customers, a U.S.-based service provider, was hit by a 1.7 Tbps reflection/amplification attack "based on the same Memcached reflection/amplification attack vector that made up the Github attack," according to Arbor's Carlos Morales, who says his firm successfully repelled the disruption.

Arbor says the biggest-ever previous DDoS attack that it logged was in the summer of 2016, when a Brazilian customer was hit with a 650 Gbps attack.

"The Memcached UDP protocol [is] a fine example of double trouble with potential for severe operational impact."

"Memcached servers are now being used as reflectors/amplifiers to launch extremely high-volume UDP reflection/amplification attacks," Morales says in a March 1 blog post. "They are proving especially effective because Memcached servers have high-bandwidth access links and reside on networks with high-speed transit uplinks. This makes Memcached servers ideal for use in high-bandwidth reflection/amplification DDoS attacks."

Frequency of DDoS attacks from April 2014 to Feb. 2018 against customers of Arbor Networks. Irrespective of frequency, the firm says attack intensity has spiked in recent months. (Source: Arbor Networks)

Johannes B. Ullrich, dean of research at SANS Technology Institute, describes the Memcached abuse as "a classic reflective amplified DDoS attack," adding that "luckily, it isn't too hard to block."

Here's how: "You should see traffic *from* port 11211 if you are hit by this attack," he says in a blog post. "Blocking all traffic from port 11211 should be possible, as all modern operating systems tend to use a source port higher than that for client connections. But given the traffic volumes people are seeing, you will likely need help "upstream" or from an anti-DDoS company."

Some DDoS extortionists are now threatening to unleash Memcached-enabled disruptions on victims unless they pay ransoms of 50 monero - aka XMR - cryptocurrency, worth about $16,000. But Ullrich says all attacks seen to date have directed victims to pay into a single monero wallet address, meaning that these opportunistic criminals would have no way to verify which victims paid or did not pay.

Memcached DDoS packet with request for payment in monero, aka XMR, cryptocurrency. (Source: Akamai)

The Power of Amplification

Memcached offers massive bang for attackers' buck. For starters, it can be abused to inject massive keys - up to 50 kilobytes - and attackers can then use IP spoofing to create DDoS attacks with a massive rate of amplification.

The U.S. Computer Emergency Readiness Team has updated its alert on UDP-based amplification attacks, originally released in 2014, to include Memcached-based reflection DDoS attacks via UDP/TCP port 11211. It warns that abusing Memcached can result in attacks being amplified by 10,000 to 51,000 times.

Memcached Users: Upgrade Now

Logo for the open source Memcached project.

As Information Security Media Group reported on Monday, version 1.5.6 of Memcached, released Feb. 27, disables UDP by default, according to Memcached's developer, who goes by Dormando. "I'm surprised it took this long for someone to abuse it," Dormando tweets. "Please upgrade, or disable UDP. ... Please do not expose cache to internet, and so on."

Potential Risks, Defenses

Memcached can potentially be used for more than DDoS attacks. On Wednesday, DDoS defense firm Corero Network Security warned that servers with open Memcached ports could potentially be abused by attackers to "reveal the 'keys' to your data" by using debug commands, as well as potentially to maliciously modify the data and reinsert it into the cache without the knowledge of the Memcached owner.

"If you have a Memcached server in your environment that is exposed to the internet, then you should stop scanning for them, and spend your time writing a resume instead."

Corero also repeated a suggestion, first aired by Dormando on Feb. 27, that sending a "flush_all" command back to any attacking server could help mitigate attacks. Doing so "invalidates a vulnerable server's cache, including the large, potentially malicious payload planted there by attackers," according to Corero, which suggested this maneuver might function as the equivalent of a "kill switch."

But Mounir Hahad, head of threat research at security hardware manufacturer Juniper Networks, tells ISMG that he believes this defense is no silver bullet.

"This kill switch is unfortunately just a Band-Aid," Hahad says. "It will take an attacker only a few minutes to overcome by replanting the large file in the Memcached servers again. It becomes a game of whack-a-mole: The attacker replants the file repeatedly and the good guys try to flush it out again and again. Try doing this on about 100,000 servers at the same time and you'll realize it's a cat-and-mouse chase."

Also, Corero's suggestion to use "flush_all" might subject users to legal repercussions, says John Graham-Cumming, CTO of Cloudflare. "We didn't use this technique because it's unethical and possibly illegal," he tweets.

Servers Vulnerable to Abuse

Shodan, a search engine for devices connected to the internet, reports that as of March 5, more than 105,000 internet-connected servers were running Memcached and answer on TCP or UDP port 11211, meaning their use of the protocol could potentially be abused.

More than 10,000 of those servers appear to be run or hosted by China's Hangzhou Alibaba Advertising, an advertising technology unit of e-commerce giant Alibaba. By domain, the single greatest number of servers appear to be hosted by Amazon Web Services.

As of Thursday, however, Shodan searches reported that the number of servers listening on port 11211 had decreased from approximately 105,000 to less than 96,000.

On Feb. 27, DDoS defense firm CloudFlare reported that its data centers in New Jersey, Germany and Hong Kong were seeing a disproportionately large number of attacking IP addresses because most of the vulnerable servers are located in major hosting providers."

Location of servers being used to launched Memcached DDoS attacks as of Feb. 27. (Source: CloudFlare)

ISPs Help Mitigate Threat

Based on scans of the IPv4 space, DDoS defense firm Qrator Labs reports finding fewer vulnerable servers. Whatever the actual quantity is, the good news is that the number of servers running Memcached in a manner that can be exploited by DDoS attackers appears to be diminishing.

Scans of servers in the IPv4 address space show a decline in the number of internet-connected servers running the Memcached protocol that are listening on TCP or UDP port 11211. (Source: Qrator Labs)

"The significant part of this decrease was the result of homework made by several huge ISPs," Qrator Labs says, noting that by Monday, Alibaba had fixed more than 5,000 servers, hosting giant OVH more than 2,300 servers and China Telecom more than 1,600. "Still, there are more than 8,000 services that haven't been fixed," Qrator Labs says. "We encourage all ISPs to check their networks and fix services that can be used as amplification for the DDoS attack."

All ISPs should "port filter (exploitable port filters), rate limit the port 11211 UDP traffic (ingress and egress), and clean up any Memcached exposed to the internet (iptables on Unix works)" for both IPv4 and IPv6, Barry Greene, principal architect at Akamai, says in a blog post cited by US-CERT. "There is not excuse for ISPs, telcos and other operators for not acting."

Service providers, including telecommunications giant NTT Communications, have also been responding, says Job Snijders, an internet architect at NTT

"NTT too has deployed rate limiters on all external facing interfaces on the GIN [global IP network] backbone - for UDP/11211 traffic - to dampen the negative impact of open Memcached instances on peers and customers," Snijders writes in a March 1 post to the North American Network Operators Group mailing list.

"The toxic combination of 'one spoofed packet can yield multiple response packets' and 'one small packet can yield a very big response' makes the Memcached UDP protocol a fine example of double trouble with potential for severe operational impact," he adds.

What IT Administrators Must Do

DDoS attack amplification potential offered by different protocols. (Source: US-CERT)

Enterprise IT administrators must also act. "If you are an enterprise, ask your upstream ISP if they are deploying exploitable port filters and look through your firewall rules to add them to your network," Greene says. "Layered security means it is prudent to ask your ISP to do their part while you do your part."

"There should be no business for these Memchached servers to accept connections from the internet. People should be using firewall or routing rules to drop traffic from the internet to these servers, period," says Juniper's Hahad. "It is very easy to mitigate this kind of amplification: Just rate limit the particular port used by this service, 11211, which can be done by any decent firewall. Better yet, reconfigure your network to have Memcached only allow connections from the desired servers."

Ullrich suggests that running Memcached in internet-exposed mode should be a firing offense.

"If you have a Memcached server in your environment that is exposed to the internet, then you should stop scanning for them, and spend your time writing a resume instead," Ullrich says.

"Either because you do not want to work in an utterly incompetent organization like that, or if you are responsible for the exposed server, then ... write a resume for a simpler job" than being a systems administrator, he says.

About the Author

Mathew J. Schwartz

Mathew J. Schwartz

Executive Editor, DataBreachToday & Europe, ISMG

Schwartz is an award-winning journalist with two decades of experience in magazines, newspapers and electronic media. He has covered the information security and privacy sector throughout his career. Before joining Information Security Media Group in 2014, where he now serves as the executive editor, DataBreachToday and for European news coverage, Schwartz was the information security beat reporter for InformationWeek and a frequent contributor to DarkReading, among other publications. He lives in Scotland.

Around the Network

Our website uses cookies. Cookies enable us to provide the best experience possible and help us understand how visitors use our website. By browsing bankinfosecurity.asia, you agree to our use of cookies.