MongoDB instances publicly exposed on the Internet
blog.shodan.io
blog.shodan.io
I also found a github repo with some C# code: https://github.com/katway/DrugSupervision
That's all I've got.
Since it is not a Web App and hence not publicly available to exploit:
Use of String.Format instead Parameterized queries is how Sql injection issues sneak in. (Line 63, https://github.com/katway/DrugSupervision/blob/GuiDesign/Dru...)
China Telecom Yunnan 83 China Telecom xinjiang 80 China Telecom 60 China Unicom Shandong 11 China Telecom Chongqing 10
Connecting to one instance in particular, 183.221.158.220:
> show dbs; DrugSupervise 0.125GB local 0.03125GB > use DrugSupervise switched to db DrugSupervise > show collections DrugSupervise.Entity.Models.DictList.DictCodeList DrugSupervise.Entity.Models.DictList.DictCodeTypeList DrugSupervise.Entity.Models.DictRegion.DictRegionList DrugSupervise.Entity.Models.EntPartner.EntPartnerList DrugSupervise.Entity.Models.PhysicsName.PhysicNameList DrugSupervise.Entity.Models.RIOS.InOutStoreD`1[DrugSupervise.Entity.Models.PI.PurchaseInStore] DrugSupervise.Entity.Models.RIOS.InOutStoreD`1[DrugSupervise.Entity.Models.RG.GetDrugOutStore] system.indexes
Looking at the DrugSupervise.Entity.Models.PhysicsName.PhysicNameList collection, see a bunch of stuff like this:
{ "_id" : BinData(3,"s6CfpmQtDkG5Nh3lqDGOQQ=="), "physicName" : "磷酸可待因注射液", "physicInfo" : "磷酸可待因注射液 注射剂 15mg" } { "_id" : BinData(3,"3Aa7ZwXzy0ax2KRCFRhsSg=="), "physicName" : "硫酸吗啡口服溶液", "physicInfo" : "硫酸吗啡口服溶液 口服液 10ml:30mg" } { "_id" : BinData(3,"t9+GHfNq10eqqi2EaqhQKA=="), "physicName" : "枸橼酸舒芬太尼注射液", "physicInfo" : "枸橼酸舒芬太尼注射液 注射剂 2ml:100vg(以舒芬太尼计)" } { "_id" : BinData(3,"bFLxr6tN0kO8vso+BTjB5w=="), "physicName" : "硫酸吗啡片", "physicInfo" : "硫酸吗啡片 片剂 20mg" } { "_id" : BinData(3,"5FGsZIWsPE6L+UQSTEfVag=="), "physicName" : "盐酸吗啡片", "physicInfo" : "盐酸吗啡片 片剂 30mg" }
I have no idea what this is, but it looks like some kind of registry of prescriptions.
Also, the author stresses that this problem is not unique to mongo.
- I wrote about it before and could compare results from my previous post
- It's popular and there are a lot of public instances of it
- MacKeeper exposed 13 million user accounts through their public MongoDB instance
And I actually wrote a follow-up post on Memcached to highlight the same issue: https://blog.shodan.io/memory-as-a-service/
Of course I blame myself for not whitelisting IP addresses, but I did not appreciate the connection attempt. Passive port scanning is one thing, but actively trying to establish a VPN session is another.
I was under the impression that port scanning IP addresses on the open internet without prior authorization was illegal under the CFAA. Obviously that's a provision commonly ignored by researchers, but at least they disclose any port scanning activity with some discretion and acknowledgement of its potential illegality. I'm surprised how blatantly upfront Shodan is about its operation.
Does anyone know the deal with this company/website? Why are they not worried about prosecution for their mass port scanning?
See for yourself: https://nmap.org/book/legal-issues.html
Even if it was illegal wouldn't the answer simply be to rent servers in a country where it isn't illegal (or even condoned by the government) and scan away? I'd imagine most government responses to this would be IDGAF.
In his talks the founder says he provides law enforcement with all the crawled data for free and that he has regular contact with the US CERT. So there doesn't seem to be any legal problem.
My opinion: shodan doesn't try to exploit any known backdoors or common user/password combinations. Testing for anonymous/guest logins is fine in my view.
Why is this a good thing?
Isn't it like trying every door in a neighbourhood and handing the FBI a list of all the properties that have been left unlocked?
Oh - and there's that very useful exploit dictionary too.
I ban all the shodan IPs I can find as a matter of policy.
You are bizarrely off base as to US law, ethical norms, and general customs. Shodan is doing nothing illegal or immoral; the fact that you think they might be suggests that you should step back and rethink your mental model of the internet, because that may not be the only mistake you've made.
(A couple of prosecutions have been attempted under the CFAA; they were thrown out as being completely groundless. On the other hand, other countries have other laws.)