TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Several thousand MongoDBs without access control on the Internet [pdf]

111 pointsby ifcologneover 10 years ago

13 comments

patio11over 10 years ago
This can also happen with Memcached, Redis, and for that matter SQL databases. If you find it on your servers, you should be very, very alarmed. (Assume that any attacker with arbitrary access to any of these owns the box. [+]) One easy-ish way to make sure you don&#x27;t inadvertently leave a port open is to use iptables and deny inbound connections to everything but 22, 80, and 443 by default.<p>This is part of the Slicehost VPS setup guide that PickledOnion wrote back in the day, and it&#x27;s still one of the first things I do when I get a new box. (Typically right after locking down SSH with a key requirement.)<p>Edit to add:<p><a href="http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1" rel="nofollow">http:&#x2F;&#x2F;articles.slicehost.com&#x2F;2008&#x2F;4&#x2F;25&#x2F;ubuntu-hardy-setup-p...</a> <a href="http://articles.slicehost.com/assets/2007/9/4/iptables.txt" rel="nofollow">http:&#x2F;&#x2F;articles.slicehost.com&#x2F;assets&#x2F;2007&#x2F;9&#x2F;4&#x2F;iptables.txt</a> &lt;-- make sure you change the port 30000 on the SSH to whatever you use on your boxes<p>[+] You might think &quot;Well, that requires the existence of both a vulnerability in the server and a local privilege escalation exploit&quot;, but in practice, you can assume that the attacker has access to both of these. They also probably aren&#x27;t trying to get into <i>your</i> box, specifically -- your box is merely one of the several thousand Redis instances on the Internet that they&#x27;re firing e.g. a specially corrupted Unicode string to get a buffer overrun on, at which point they will -- in a mostly automated fashion -- run metasploit (or similar ratware) and turn that into a root shell.
评论 #9027557 未加载
评论 #9029320 未加载
martinmlover 10 years ago
Similar, but with memcached (2010): <a href="http://www.sensepost.com/blog/4873.html" rel="nofollow">http:&#x2F;&#x2F;www.sensepost.com&#x2F;blog&#x2F;4873.html</a>
m8rlover 10 years ago
German IT-news-site heise.de is reporting on it, I guess there&#x27;ll be an english translation soon.<p><a href="http://www.heise.de/security/meldung/Studenten-entdecken-Tausende-offene-Firmen-Datenbanken-im-Internet-2545183.html" rel="nofollow">http:&#x2F;&#x2F;www.heise.de&#x2F;security&#x2F;meldung&#x2F;Studenten-entdecken-Tau...</a><p>Original (German language) press release is here: <a href="http://www.uni-saarland.de/nc/en/news/article/nr/12173.html" rel="nofollow">http:&#x2F;&#x2F;www.uni-saarland.de&#x2F;nc&#x2F;en&#x2F;news&#x2F;article&#x2F;nr&#x2F;12173.html</a>
评论 #9026460 未加载
ryanlolover 10 years ago
Someone posted a list to a .onion site indexing these on FD in early 2014.<p><a href="http://seclists.org/fulldisclosure/2014/May/43" rel="nofollow">http:&#x2F;&#x2F;seclists.org&#x2F;fulldisclosure&#x2F;2014&#x2F;May&#x2F;43</a><p>Edit: Oh, seems like the site is still up at <a href="http://un1c0rn.net/" rel="nofollow">http:&#x2F;&#x2F;un1c0rn.net&#x2F;</a><p><a href="http://un1c0rn.net/search?q=tags%3Amongo" rel="nofollow">http:&#x2F;&#x2F;un1c0rn.net&#x2F;search?q=tags%3Amongo</a>
meghanover 10 years ago
We take security seriously at MongoDB. Here is a response on security best practices from the MongoDB CTO &amp; Co-Founder:<p><a href="http://www.mongodb.com/blog/post/mongodb-security-best-practices" rel="nofollow">http:&#x2F;&#x2F;www.mongodb.com&#x2F;blog&#x2F;post&#x2F;mongodb-security-best-pract...</a>
评论 #9027602 未加载
评论 #9027433 未加载
bawanaover 10 years ago
I tried to verify the results but am getting stuck at this:<p>curl $SHODANURL |grep -i class=\&quot;ip\&quot; |cut -d ’&#x2F;’ -f 3 \ |cut -d ’&quot;’ -f 1|uniq &gt;db.ip<p>The author at CISPA (in the linked pdf) states to &#x27;paste the html code&#x27; however using shodan from the command line, one only has access to 6 verbs that shodan understands. Shodan reveals 34309 mongo databases. I can download their ips but that requires &#x27;query credits&#x27; using shodan. How does one use curl here?
bkeroackover 10 years ago
I&#x27;m not surprised. I&#x27;ve never actually gotten replication groups and access control to work properly with MongoDB. So I gave up and relied on network&#x2F;firewall-level security. I guess some people don&#x27;t even bother with that.
moozeekover 10 years ago
# 1st: accept connections from localhost<p>iptables -A INPUT -p tcp -s 127.0.0.1 --dport 27017 -j ACCEPT<p>iptables -A INPUT -p tcp -s 127.0.0.1 --dport 28017 -j ACCEPT<p># 2nd: drop from all others<p>iptables -A INPUT -p tcp --dport 27017 -j DROP<p>iptables -A INPUT -p tcp --dport 28017 -j DROP
评论 #9028076 未加载
评论 #9028014 未加载
nealsover 10 years ago
How do I know if my access control is just local? I have a few small (pet) mongoDB projects on Digital Ocean, never spend too much time updatng and&#x2F;or securing them actually.
评论 #9027298 未加载
评论 #9027033 未加载
lcfcjsover 10 years ago
Very interesting article, thanks for the submission.
scrrrover 10 years ago
Please spend a little bit more money and hire a professional who knows what he is doing instead of just following installation tutorials.
评论 #9027000 未加载
评论 #9027970 未加载
GFK_of_xmaspastover 10 years ago
* MongosDB
jorjordandanover 10 years ago
they are probably all Meteor tutorials.
评论 #9029405 未加载