430 points · by susam · 6y ago · 169 comments
The site returns various HTTP error codes based on the results of that lookup, or shows a fancier page with open ports and other information it has on that IP address. (Example: https://beta.shodan.io/host/1.1.1.1)
There is no active scan occurring here. (But you could be hinting to Shodan that these particular IPs are valid though!)
For those of us on IPv4, eh. Only 4 billion addresses, and with a lot of that itself tied up in various large /8s to a few specific organizations many of which can be assumed to be beyond casual level, it's just no longer a real haul to scan everything all the time at a basic level. Plus for those of us browsing from our main address we're leaving a trail all over the web anyway through a host of poorly secured servers. So I while I don't disagree it's worth thinking about information leaks and honey pots and the like whenever dealing with infosec in any way, in this specific case I also don't think this reveals anything of significant value.
Or do you mean all of IPv4?
Scanning {ip} for interesting ports on 2020-09-22 20:14:00 CEST…
This may take a short while.
Starting Nmap 5.21 ( http://nmap.org ) at 2020-09-22 20:14 UTC
Initiating Ping Scan at 20:14
Scanning {ip} [2 ports]
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Ping Scan Timing: About 50.00% done; ETC: 20:14 (0:00:01 remaining)
Stats: 0:00:02 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Ping Scan Timing: About 50.00% done; ETC: 20:14 (0:00:02 remaining)
Stats: 0:00:03 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Ping Scan Timing: About 99.99% done; ETC: 20:14 (0:00:00 remaining)
Completed Ping Scan at 20:14, 3.00s elapsed (1 total hosts)
Nmap scan report for {ip} [host down, received no-response]
Read data files from: /usr/share/nmap
Note: Host seems down. If it is really up, but blocking our ping probes, try -PN
Nmap done: 1 IP address (0 hosts up) scanned in 3.07 seconds
The scan was performed from 89.186.169.101. Best regards gigahost.dk
--OP's link archived from archive.fo
What should I do?
If I do that query from home, it correctly tells me that 22, 80, and 443 are open. If I do that query from the Lightsail instance itself, I get 404. I also get 404 if I do it from work.
Color me unimpressed that "an army of bots that crawl the entire Internet and stores what it finds along the way" hasn't port scanned every ipv4 address at least once in the span of 19+ months. That is a very long time for a limited address space.
tldr; There is no "army", or that army is armed with pool noodles.
> Shodan has servers located around the world that crawl the Internet 24/7 to provide the latest Internet intelligence.
That needs to sink in for anyone ever allowing themselves to believe the fallacy that they can slip under the radar with a security vulnerability or sleeping soundly with security by obfuscation. You aren't a computer port hiding on one specific computer on the internet, you are data trying to hide in a relational database.
Depends on what you mean by "a reasonable percentage" there.
If you can scan all of 2^32 addresses in IPv4 in ~5mins (as suggested elsewhere in this thread), then it'd take something like 75,000,000,000,000,000,000,000 years to do the same for all 2^128 addresses in IPv6.
It's possible you've got a technique to find "a reasonable percentage" of all devices listening/responding on IPv6 addresses, but unless 10^-22% is "a reasonable percentage" - then no, you can't randomly portscan IPv6 and ever even realistically expect to connect to anything at all, never mind come up with some Shonan-Like map of almost the entire address space.
This mostly just moves the problem from brute forcing into dictionary attacks though, similar to how passwords get mostly attacked these days. Any IPv6 address that's doing anything on the internet leaves traces of it's existence/activity somewhere. I'm guessing there are people popping log files and monitoring major traffic interchanges, and creating their own haveibeenpwned-style lists of IPv6 addresses that're actually in use, then selectively scanning them and probably the closely related subnets of them. If your "promising methods of host discovery" extend radially beyond that, I'd be super interested if you're prepared to share them?
When I do it from home I immediately get a 404. It was so fast I assumed that the site got overwhelmed by people trying it and it was down.
But then I tried it but changing the URL on the 404 from https://beta.shodan.io/host/<home_ip> to https://beta.shodan.io/host/<lightsail_ip>, giving the IP of my Amazon Lightsail instance. It almost instantly told me 22, 80, and 443 were open.
Edit: ...but if I try either of those actually from my Lightsail instance, they both get 404!?
> Shodan has servers located around the world that crawl the Internet 24/7 to provide the latest Internet intelligence.
the v6 address space, on the other hand...
[1] https://arstechnica.com/information-technology/2016/02/using...
Although the fact that the "results" are cached arguably makes this less useful than GRC and other sites that will actively scan your IP (range).
And even though they provide a timestamp for the reported information (different for different ports by 24 hours or so, at least for me), I'd personally prefer an active scan over a database lookup if I want to know what's going on.
I'll go further and say that while the information provided is absolutely useful, depending on the services you're exposing to the Internet, there are other tools that will give you much more useful, actionable information.
There are rafts of online tools to check for vulnerabilities in specific services. Notably:
Mozilla Observatory https://observatory.mozilla.org/
Qualys Labs SSL test https://www.ssllabs.com/ssltest/
MX Toolbox Super Tool https://mxtoolbox.com/SuperTool.aspx
And many others, including the GRC Shields Up! port scanner mentioned in other comments in this thread: https://www.grc.com/shieldsup
As such, unless you're going to use Shodan services, or want to know what information they have about you, it seems like there are other, better tools out there.
What's more there are tons of tools that you can run locally that will provide much more information about the devices on your internal network, since you can run them inside your firewall.
N.B.: I am emphatically not discouraging others from using shodan.io, nor am I claiming that it's bad. Rather, I'm expressing my own opinion as to how I prefer to identify and test my internet-facing attack surface.
Then don't use it.
Or check the click-box. Which is what I did.
That said, your Internet-facing IP address isn't private. In fact, it has to be public in order to route traffic to/from you.
I'd note that the shodan.io site had information about my IP address, even though I'd never used it or requested a scan. What's more, I'm included in that database without any opportunity to opt out as the Mozilla site provides.
And just to be clear, I have no connection to Mozilla (or any of the other sites I mentioned). In fact, I'd never looked at Mozilla Observatory before I started poking around for the comment to which you replied and included it only because it had an SSH scanner.
For the HTTP/S ports, it displays the response headers, including timestamp, so I went through my access logs and found the record, if anyone is curious:
71.6.165.200 - - [xx/Sep/2020:xx:xx:xx +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
71.6.165.200 - - [xx/Sep/2020:xx:xx:xx +0000] "GET /robots.txt HTTP/1.1" 404 163 "-" "-"
71.6.165.200 - - [xx/Sep/2020:xx:xx:xx +0000] "GET /sitemap.xml HTTP/1.1" 404 163 "-" "-"
71.6.165.200 - - [xx/Sep/2020:xx:xx:xx +0000] "GET /.well-known/security.txt HTTP/1.1" 404 163 "-" "-"
71.6.165.200 - - [xx/Sep/2020:xx:xx:xx +0000] "GET /favicon.ico HTTP/1.1" 404 135 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0"Also at least for me it shows nothing while I do have ports open, but that's because I whitelist limited IP ranges or single IPs for ports rather than just opening them up to the net in general. I have a VPS Wireguard bastion I bounce through for remote LAN access. That itself is a good reminder though that it's a limited tool, if a system in my whitelisted range was compromised it'd suddenly have more options, and conversely if I already had something lazy or malicious (maybe IOT, compromise or both) running on my network that was being careful about what it talked to a port scan alone wouldn't necessarily root it out.
Still a potentially useful high level pass for low effort, could make one aware of some surprise devices or fat finger mistakes or the like. But "If you see 404 page, nothing is exposed" is overstating it.
Yes.
> "If you see 404 page, nothing is exposed" is overstating it.
Exactly.
It did catch port 22 on another IP address that I have.
[1] https://www.grc.com/fingerprints.htm
... but I digress. Apparently I have some very strong skepticism of Steve Gibson that I wasn't even aware of until I had a visceral reaction to ShieldsUp! (which is probably a perfectly fine service) :D
But as to that fingerprints page. The idea isn't really about any problem with the Web PKI (what you're calling "the CA hierarchy"). Instead it's about a method you can try to use to figure out if you're using a client that's configured to trust something else entirely. In most cases this means a middlebox, maybe at a school (to stop kids looking at porn and maybe cheating on tests) or at work (porn again, and maybe other non-work stuff, sometimes anti-exfiltration technology) but it could be your own AV software.
It can't really do what it says on the tin, for a few reasons. You're going to get some false alerts this way because the certificate Steve (and Steve's web site) sees won't necessarily match the one you see, and if a sophisticated adversary was trying to defeat Steve's system they could just use the same technique to replace Steve's own site.
Also as often happens with these little projects, it isn't properly maintained. The stuff about EV in Firefox (and I think Chrome too?) is no longer true.
When I saw the alarmist stuff about knowing the cert fingerprints for certain sites a priori, I thought he'd invented a crazy ad hoc version of cert pinning and just rolled my eyes.
[1] http://www.interact-sw.co.uk/iangblog/2004/08/12/norawsocket...
Only if you are relying on no one knowing they're open as a "security feature" (a.k.a. "security by obscurity").
If you aren't worried about anyone "finding" them because you've taken the time to secure the services then there's absolutely no reason at all to care that this exists.
Edit: yep https://arstechnica.com/information-technology/2016/02/using...
Specifically, on the right side of the screen there are two boxes. The top one is titled "Open Ports", and lists a single port in it, 7547.
But the box below that is titled "// 7547 / TCP /". In that box is the text "HTTP/1.1 404 Not Found".
So..., am I leaking port 7547, or not? (Fwiw, http://portscan.me/ doesn't find any leaked ports, and sees my host IP as offline).
---
404 Not Found
The resource could not be found.
then you are leaking information remotely (or were the last time they scanned your IP address). It sounds like that port was accessible at one point.Of course, that's just what they claim. Your level of paranoia that it will get hacked and trust in your ISP to not use it to spy on you or override your own configuration is up to you.
For more complex queries about what is being exposed on IPs worldwide (IPV4 and IPV6) You can register a free account on app.binaryedge.io.
(Disclaimer: I'm part of the BinaryEdge team)
Similarly to Shodan, this is looking things up in Censys's database. Censys scans more ports than Shodan, and has more up to date data. Also, I work for Censys.
https://censys.io/ipv4 let's you search for all sorts of stuff.
It just yesterday helped me visualize the importance of not exposing things to the internet and might have prevented serious future intrusions.
Turns out the port my DVR was on was in their DB.. Guessing I was owned at one point.
I'm assuming it's Plusnet and if so this appears to be normal. See here: https://community.plus.net/t5/My-Router/IP-TCP-4567/td-p/153...
like for my home IP address, I get 404. It would be nice to use a service that can tell me whatever is known about the ip (geo, hostnames, etc)
What should I do?
Edit: Oh, I see, I have to actually click the link... that gives a "Forbidden" message.
Edit2: And only works locally.
Check if you are on a VPN as I was seeing 403 Forbidden while on the VPN and 404 when I turned if off.
Which leaves you open to attack if the web server has vulnerabilities.
Edit: saw your Edit. :)
Edit: weird, if I connect the VPN then open a private browser tab it then checks the VPN IP. A simple refresh of the tab once VPN is up doesn’t work.
Edit 2: I’m an idiot. I just noticed the page URL.
Why is SSHD disclosing its goddamn version too?!
If you are seeing a 404 page, that means that a web browser is listening on port 80 and received the request and is responding with a 404 page. That's not a good thing!
Of course Shodan's web servers are always listening on port 80, just like with all websites.