4 ms·
Most attacks are just scripts that constantly scan everything looking for services on well known ports. This sort of attack isn't dangerous if you've got the ba
by onion2k 9y ago
Most attacks are just scripts that constantly scan everything looking for services on well known ports. This sort of attack isn't dangerous if you've got the basics right, so obscurity gives you nothing very useful. I guess it might result in less noise in the logs which is nice but it's not 'more secure'.
The far less common but much more dangerous attack is a malicious third party intent on gaining access to your servers specifically. Hiding a service on a different port isn't even going to slow that attacker down - they'll use a port scanner to find every port that's listening. The service is going to be found regardless of whether or not you've changed the port. You could certainly mitigate the problem by modifying the service not to output anything until the user is authenticated, and you can use a port knocking strategy to stop it connecting on the first try, but those aren't really 'obscurity' per se.
That's not to say you shouldn't do it if you want to; I'm just not sure it actually makes anything more secure.
- sandworm101 9y agoBut getting the service off a particular port means that a scan across multiple ports is needed to discover it. Such a scan should be detected and mitigated. By moving to an unusual port you are forcing the attacker to engage in something he wouldn't previously have to do, something that does no real harm but that you can use to identify the attacker. That's a win.
- gjjrfcbugxbhf 9y agoDoes e.g. failtoban help with detecting port scans and autoblocking the IP? Not that this would help against a distributed port scan...
- falcolas 9y agoI would imagine that, in a fashion similar to port knocking, if being scanned (regardless of IP), you could blackhole all new connections from non-whitelisted IPs for a period of time.
- tyingq 9y agoHe gives stats in the article: "for a single weekend, and received over eighteen thousand (18,000) connections to port 22, and five (5) to port 24." You're right in that it may not help you, but the numbers seem to indicate it could help you, at least buying some time before you notice you need to patch something. And the reduced log noise makes it easier to confirm that nobody tried the latest/greatest exploit.
- HurrdurrHodor 9y agoBut here's the point: Do you want people to spend their 10 minutes picking good passwords or setting up public key auth or should the spend them switching their server to port 24? Security BY obscurity is bad as the article states and unless you have infinite resources everything is a trade-off.
- tyingq 9y agoI don't think I advocated changing the port as higher priority than more important measures.
- drvdevd 9y agoIf you rely on logging as a “high priority” in your security architecture, then it follows that reducing noise is of parallel importance. Personally, this is why I change SSH ports every time on a public service and add extra firewall rules if possible. If for some reason I want to watch port 22 “attacks”, I can do so. I’m not even sure I place this in the security OR obscurity categories at this point ... more of a disk hygiene issue.
- saosebastiao 9y agoYou're talking about 10 minutes for a simple way to filter 18,000 attempts down to 5. Security, like everything else out there, should be prioritized according to ROI. This is a pretty good ROI...maybe not better than picking good passwords, but definitely better than many practices that IT departments advocate.
- raesene6 9y agoI don't think it gives you nothing. As an example, say a 0/1-day gets dropped and someone starts compromising systems. You're trying to get round your estate ensuring patches are in place, but that takes time. The bots are starting with the low hanging fruit, systems on default ports. Being not on a default port helps, by buying you more time to react.
- dahart 9y ago> Most attacks are just scripts that constantly scan everything looking for services on well known ports. Why do you think port scans represent the majority of attacks? From watching my servers, I don't think that's true. Port scans take a ton of time, and they're easier to detect and block before a single auth attempt. Legitimate services usually have to wait until after a couple auth attempts before blocking. I can verify the author's experience across multiple services, not just ssh. I'd bet he got 5 attacks on port 24 mostly because it's a 2-digit port number. I've moved my ssh port to a 5 digit number before, and it went from thousands of attempts per day to 0 over many months.