180 points · by hjuutilainen · 12y ago · 150 comments
Of curiousity, I looked in my Synology's GUI for the logs, and find you can export them to CSV (System Logs > Connections).
I have _a lot_ of this sort:
Warning,Connection,2014/08/03 21:10:17,SYSTEM,User [root] from [111.74.239.52] failed to log in via [SSH] due to authorization failure.
Curious how many distinct IPs, cut/grep/sed/sort: cut -d ' ' -f 5 ~/Downloads/connection.csv | grep -E '[0-9.]+' | sed 's/\[//' | sed 's/\]//' | sort -u | wc
There are 143 distinct IPs, in the 111.x.y.z, 202, 210, 222, etc. ranges: ... cut -d '.' -f -2 | sort -u
111.74
115.230
115.239
...
220.177
222.186
222.187
I punched a few into (http://www.whereisip.net/index.php) and they're mostly in China (except a 23.9... in Rochester, NY). All the successful log-ins are from myself, at least ( grep 'logged in' ...).Kiddies will scan, this blocks their IP numbers after N (by default 5) failed attempts to connect to a number of services, including SSH. My synology has blocked large parts of the internet over the past few months. :)
(only my SSH port is open to the outside so that my laptops can synchronize with my Synology via unison over SSH when I'm on the road.)
If you've got an ssh host open to the internet at large, always disable root login and password based authentication.
Pro tip: don't do that.
Unfortunately, last I checked, it's still impossible to have a Synology NAS automatically update itself.
So after a quick search, I discovered what it was all about, and some days later Synology released a nice update that got rid of it.
You can't auto update, that's true, but you can receive email alert for each new release of the DSM. You can also do that for each package installed. So, all in all, that good for me: I don't want my NAS to auto update when I'm not there, as I also usually wait a week or two before updating.
My syslog shows a few people have accessed my NAS this month.
This is worrying.
Don't do that.
You say it was "behind your router" but I think you've specifically opened ports to your NAS (or you have some sort of NAT and the NAS has done it)
Restrict access (if you must open it to the internet, open to only specific IP addresses) or better yet disable it, and use an ssh port-forward if you really have to get to it.
Is it really to much to ask to use the Internet as it was intended? We should consider these products broken.
1) Weak passcode. 2) Security exploit in DSM.
The fixes are easy; better passcode, and turn off remote access to the device until whatever flaw(s) can be patched.
Then wait for more info from Synology. I generally don't connect mine to the internet (inbound). I don't like the risks involved.
Which means that it's more work to administer than something developed as a dedicated router or firewall.
Also I'm running on a generic x86 computer. I pay about $1/yr per watt drawn 24x7, which means my firewall costs me about $80/yr just in electricity. A smaller "appliance" type firewall would certainly have much lower operating costs.
Sorry I don't have any suggestions more tailored to your request. I'm just letting you know what works for me.
I've had a Synology NAS for almost a year now. I really like the UI, but the software stack they're using under the hood (Apache, PHP, MySQL, etc.) has a massive attack surface, if not routinely kept up-to-date.
Here's an nmap trace from my Synology DiskStation: amber@leysritt ~ % nmap -A <redacted>
Starting Nmap 6.46 ( http://nmap.org ) at 2014-08-03 23:06 BST
Nmap scan report for <redacted>
Host is up (0.011s latency).
Not shown: 987 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 5.8p1-hpn13v11 (protocol 2.0)
| ssh-hostkey:
| 1024 <redacted> (DSA)
| 2048 <redacted> (RSA)
|_ 256 <redacted> (ECDSA)
80/tcp open http Apache httpd
|_http-generator: ERROR: Script execution failed (use -d to debug)
|_http-methods: No Allow or Public header in OPTIONS response (status code 301)
|_http-title: Did not follow redirect to http://<redacted>:5000/
111/tcp open rpcbind 2-4 (RPC #100000)
| rpcinfo:
| program version port/proto service
| 100000 2,3,4 111/tcp rpcbind
| 100000 2,3,4 111/udp rpcbind
| 100003 2,3 2049/udp nfs
| 100003 2,3,4 2049/tcp nfs
| 100005 1,2,3 892/tcp mountd
| 100005 1,2,3 892/udp mountd
| 100021 1,3,4 33154/tcp nlockmgr
| 100021 1,3,4 38187/udp nlockmgr
| 100024 1 44039/tcp status
|_ 100024 1 53309/udp status
139/tcp open netbios-ssn Samba smbd 3.X (workgroup: REDACTED)
161/tcp open snmp?
445/tcp open netbios-ssn Samba smbd 3.X (workgroup: REDACTED)
515/tcp open printer
548/tcp open afp Netatalk 2.2.3 (name: redacted; protocol 3.3)
| afp-serverinfo:
| | Server Flags: 0x8f79
| | Super Client: Yes
| | UUIDs: Yes
| | UTF8 Server Name: Yes
| | Open Directory: Yes
| | Reconnect: No
| | Server Notifications: Yes
| | TCP/IP: Yes
| | Server Signature: Yes
| | ServerMessages: Yes
| | Password Saving Prohibited: No
| | Password Changing: No
| |_ Copy File: Yes
| Server Name: redacted
| Machine Type: Netatalk2.2.3
| AFP Versions: AFP2.2, AFPX03, AFP3.1, AFP3.2, AFP3.3
| UAMs: Cleartxt Passwrd, No User Authent, DHX2, DHCAST128
| Server Signature: redacted
| Network Address 1: redacted
|_ UTF8 Server Name: redacted
631/tcp open ipp CUPS 1.5
| http-methods: Potentially risky methods: PUT
|_See http://nmap.org/nsedoc/scripts/http-methods.html
|_http-title: Not Found - CUPS v1.5.4
2049/tcp open nfs 2-4 (RPC #100003)
3689/tcp open daap mt-daapd DAAP 0.2.4.1
5000/tcp open http Apache httpd
|_http-generator: ERROR: Script execution failed (use -d to debug)
|_http-methods: No Allow or Public header in OPTIONS response (status code 302)
| http-robots.txt: 1 disallowed entry
|_/
|_http-title: Did not follow redirect to https://redacted:5001
5001/tcp open ssl/http Apache httpd
|_http-generator: ERROR: Script execution failed (use -d to debug)
|_http-methods: No Allow or Public header in OPTIONS response (status code 301)
| http-robots.txt: 1 disallowed entry
|_/
|_http-title: Did not follow redirect to https://redacted/webman/index.cgi
| ssl-cert: Subject: commonName=synology.com/organizationName=Synology
Inc./stateOrProvinceName=Taiwan/countryName=TW
| Not valid before: REDACTED
|_Not valid after: REDACTED
|_ssl-date: REDACTED
| tls-nextprotoneg:
| spdy/3
| spdy/2
| http/1.1
|_ x-mod-spdy/0.9.4.2-465a04f
Service Info: OS: Unix
Host script results:
|_nbstat: NetBIOS name: redacted, NetBIOS user: <unknown>, NetBIOS MAC: <unknown>
(unknown)
| smb-os-discovery:
| OS: Unix (Samba 3.6.9)
| Computer name: redacted
| NetBIOS computer name:
| Domain name:
| FQDN: redacted
|_ System time: redacted
| smb-security-mode:
| Account that was used for smb scripts: guest
| User-level authentication
| SMB Security: Challenge/response passwords supported
|_ Message signing disabled (dangerous, but default)
|_smbv2-enabled: Server supports SMBv2 protocol
Service detection performed. Please report any incorrect results at
http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 40.47 seconds
It's sad that most of the open-source NAS solutions are so bad compared to their commercial counterparts. FreeNAS (and related forks) sacrifice too much flexibility and don't offer anything that you can't easily do yourself with a Linux/BSD server distro.I'd love to work on an open-source, security-oriented, user-friendly DSM "clone" with the right kind of people. If this sounds like fun or it sounds like something you're currently working on - shoot me an email: amber@fastmail.jp
I also wish there was such a thing as a nice, inexpensive ARM board (~$100) with plenty of SATA ports and upgradable RAM (so you can run huge ZFS pools on it) that you can install your own OS on...
1. The client interface to the NAS.
2. The 'cloud' services.
Only #1 is actually a deliverable with the Synology NAS. And #2 presents a terribly broken privacy policy...
For myself, I'd much rather be running something that I know is updating from an authenticated and keyyed repo than something which is attempting to make the user believe that somehow the "commercial" NAS is magically different than running a regular GNU/Linux distro...
Your beef is with ulf@openssl.org, not the Debian project.
Are you comparing the Synology GNU/Linux distro to Debian or some generic [non-Debian] distro to Debian?
If you are comparing Synology to Debian, then the "trusted" source argument is entirely flawed. The source, meaning both source code and source of software, of software running on Synology hardware is not Synology. Synology only makes the GUI client that runs on your machine that locally interfaces to the NAS box.
As to the Debian 2006 SSL problem... stuff happens... Apple had some silly security problems too, much more recently than 2006. And Android is so full of holes, it's a wonder the platform works at all...
However, when the generalized public buys a NAS product -- the vendor should indicate the potential security problems regarding "cloud" connections in big bold letters on the box and in the manual and have a large red warning that pops up in the user interface. My guess is most users wouldn't care, but it actually is extremely risky to connect these devices to the wild wild west open Internet.
I used to run as simple Ubuntu server with NFS, but realised I just want the simplicity of a web interface over doing it over ssh.
x86 chips are more then suitable for the application since you're no longer in "ultra ultra low power" territory (and for ZFS, are beneficial because you want those checksum calcs to finish fast).
I've been looking at those processors for a while (Intel Avoton C2550). Was there any advantage to going up a few models in that series?
Or do these NAS machines all run some BSD variant?
But I have no idea if they use it or not.
Use FreeNAS if you want ZFS on a NAS though, it is well supported.
- Also, for what it is worth, FreeNAS is amazing, and is open source.
If a consumer device speaks IP and is not designed to survive in a reasonable internet-connected home network, there should be huge warning labels all over it and it should go to some safe-mode with only diagnostic functionality if it detects internet connectivity.
This has been the go-to techie reaction to security problems since the time of dial-up modems. It's a bad attitude [1], but it's not a "meme". It's the only successful strategy an entire generation of technologically-minded people have found and preached in response to a generation's-worth of terrible software security, slow/absent/can't-be-arsed software providers and under-educated users.
Should things be different? Sure. Attitudes should be better and the software should be better. But so long as the latter isn't reflected in reality, there isn't much hope for the former.
[1] It's a bad attitude because blaming the user puts them on the defensive and reduces the chance of any progress being made.
As you said, it is cheap, power consumption is ok and it is ready to go after you plug it in.
These are just best practices, since we don't know anything about this particular piece of malware yet. They should cover most threats and worst-case scenarios.
If you need access to your Synology device from outside your home network, use a VPN or an SSH tunnel.
Best practices only if you do not want to access your data outside of your local network – and that is probably no longer the standard case since data you cannot access from mobile devices etc. is pretty useless. And for compliance and security reasons, many users and companies cannot legally use cloud services and have to therefore to use a 'private cloud', i.e., some local server, for example a NAS accessible from the Internet. A manual configuration is of course recommendable but in the end, a 'private cloud' has to be exposed to the Internet and you have to trust your software vendor. The most you can usually do is to protect your LAN by putting your 'private cloud' in a DMZ (although for consumers, that is usually not an option since consumer routers do not offer a real DMZ).
Use keys and only keys instead...
http://www.chainsawonatireswing.com/2012/01/15/ssh-into-your...
'The OpenVPN module in Synology DiskStation Manager (DSM) 4.3-3810 update 1 has a hardcoded root password of synopass, which makes it easier for remote attackers to obtain access via a VPN session.'
Here's to hoping this will only make the tech industry invest more into security, especially for consumer products which are often neglected. Sad that stuff like this needs to happen, but it's the cost we pay.
2. You should always have 3 copies of data, 1 working, 1 local back and 1 geo diverse backup (i.e a spideroak, crashplan, or even a friends house) Most people forget the 3rd but what happens if your house burns down?
3. You should have a completely cold backup of important data, this could be a external hard drive that is only plugged in when backups are done, DVD's, Tape Drive, or something else, but what ever it is it should not be accessible to the system with out manual intervention, this will prevent scripts from deleting everything.
But there's nothing to stop an attacker from rewriting the "write protected" areas like e.g. a firmware update does.
Consider that many routers these days come with NAS or MediaServer functionality... and thus are a valid target for hackers.
Furthermore, they are often directly connected to the Internet, and there have been numerous remote-root exploits for cheap chinese knock-offs as well as for highly praised manufacturers like AVM.
If you're logging in or sending financial data over unsecure (non-SSL) connections, you already have a problem.
Take for example an old lady down the road who somehow got some futuristic malware on her router. She goes to Bing to search for Wells Fargo to do some online banking (and you know that there is a huge portion of users who only browse the web this way). Hypothetical malware then just runs SSLStrip over the page from bing.com which isn't served over ssl because Microsoft values their bottom line over your privacy and security, which then replaces the link to the https site with http, the router acts as a proxy between http and https so wellsfargo.com is none the wiser. Evil hacker now has poor old lady's password and transfers the money in her account to his own foreign bank account.
This hypothetical scenario is doable even running off of a slow router while not using many more resources than the parental keyword filtering uses. At no point does SSL ever come into play and the top 4 Banks in America (Chase, Citibank, Bank of America, Wells Fargo) don't use HSTS so there's no real way to protect their users from SSLStrip unless a browser includes them in some force SSL list.
Also curious if this was linked directly to the internet.
+65 9762 7078
QNap [1], FreeNas [2], WDC [3] and Seagate [4] for example all have their own issues. Added to that, any device that is inscurely configured as default [5] is going to get hacked.
FreeNas is open source. It has exploits, though notably easier for savvy customers to dig into why they got hacked in the first place.
The real question here is why people need to expose their NAS drives to the internet. I personally don't have a fast enough internet connection to make hosting anything useful. Notably I did try and share my photos with friends and family, but the upload on my DSL is so dire it was a painful experience for all involved.
- [1] http://www.cvedetails.com/vendor/10080/Qnap.html - [2] http://www.cvedetails.com/vendor/9964/Freenas.html - [3] http://www.cvedetails.com/product-list/vendor_id-12782/WDC.h... - [4] http://www.cvedetails.com/product-list/vendor_id-11967/Seaga... - [5] http://www.drobospace.com/forums/showthread.php?tid=141894
Synology produces very good products at very affordable prices.
Also, this is not the first time this has happened to Synology hardware. Sure, bigger companies attract more attacks, but this is incredibly bad.
[0] https://twitter.com/mikeevangelist/status/496322439740424193
If they send the key. If I was a criminal, I would minimise contact with the victims.