News for hackers. Stuff that matters.
Re:What SSH Hacking Attempts Look Like by vbezhenar on Saturday May 05, 2018 @07:25AM (#17001352)
I never understood why people would use fail2ban or similar approaches. Just set proper password and move on. SSH traffic is tiny, it's not a problem. You'll never be hacked with a proper password. Let them waste their time.
Re:What SSH Hacking Attempts Look Like by daenz on Saturday May 05, 2018 @08:06AM (#17001456)
I think you mean just use key-based authentication only ;)
Re:What SSH Hacking Attempts Look Like by larkeith on Saturday May 05, 2018 @09:55AM (#17001796)
You aren't infallible. While it's easy enough to secure a minimal server with only SSH access, every time you add another service, provide access to a new user, or change a configuration, there's a chance you'll miss something or make a dumb mistake. Running Fail2Ban is a very cheap and easy method to ensure that, even if you do fuck up somewhere, there's another layer of security that should prevent malicious access in most cases (nothing will save you if you set the pass to admin/admin, e.g.).
Re:What SSH Hacking Attempts Look Like by ryanlol on Saturday May 05, 2018 @11:46AM (#17002269)
Because fail2bans approach to log parsing is totally sane and confidence inspiring, right?
Re:What SSH Hacking Attempts Look Like by vxl on Saturday May 05, 2018 @07:38AM (#17001394)
The failed attempts make it harder to monitor for other attacks because of the noise in log files, network traffic, etc. and if an attacker IP is blocked early they can't try more effective attacks.
Re:What SSH Hacking Attempts Look Like by Krasnol on Saturday May 05, 2018 @07:40AM (#17001400)
I've set up a second obstacle by allowing access to the device from a certain range of IPs on the router. Cleaned up the log pretty good.
Re:What SSH Hacking Attempts Look Like by seldomcomment on Saturday May 05, 2018 @07:44AM (#17001404)
logins can be delayed [0] and TOTP can be used in conjunction with SSH (without google authenticator)

[0] https://unix.stackexchange.com/questions/105553/how-to-provi...

edit:

quick and dirty notes of my setup [1]

[1] https://pastebin.com/yYzSrM61

Re:What SSH Hacking Attempts Look Like by zAy0LfpBZLC8mAC on Saturday May 05, 2018 @10:23AM (#17001918)
Except actual attacks don't show up in logs anyway, so it's still pointless?

The SSH daemon logs when it successfully rejects an access. A successfully rejected access is inconsequential to your security. If you are using secure passwords or pubkey authentication, it will never log a successful login by an attacker. What remains then is exploitation of the SSH server ... but the SSH server doesn't have a code path that logs "I have been exploited".

Re:What SSH Hacking Attempts Look Like by A2017U1 on Sunday May 06, 2018 @01:24AM (#17005341)
/etc/sshrc executes before a successful ssh login, you can use that to be notified before an attacker has any access to log files
Re:What SSH Hacking Attempts Look Like by zAy0LfpBZLC8mAC on Sunday May 06, 2018 @07:38AM (#17006061)
... so? How does that contradict what I wrote?
Re:What SSH Hacking Attempts Look Like by pm215 on Saturday May 05, 2018 @08:29AM (#17001526)
I originally set up fail2ban because I got fed up with the noise of the hard disk going tick...tick...tick every 15 seconds or so, as another password guessing bot login attempt got logged and the disk heads had to seek as the logfile was written out to disk...
Re:What SSH Hacking Attempts Look Like by beagle3 on Saturday May 05, 2018 @09:23AM (#17001697)
Do you ever examine logs? Fail2ban (or even better, using a nonstandard port or both) keep the noise out of lots to the point that you can still examine them manually.

Without it, 99.99% of the average ssh log is failed back attempts.

Re:What SSH Hacking Attempts Look Like by nerdponx on Saturday May 05, 2018 @09:37AM (#17001738)
Changing the port away from 22 also had that effect in my experience.
Re:What SSH Hacking Attempts Look Like by purple-again on Saturday May 05, 2018 @10:02AM (#17001827)
This was like night and day. Non stop constant barrages on the default port, all quiet on the ssh k@ip -p XXX.
Re:What SSH Hacking Attempts Look Like by yjftsjthsd-h on Saturday May 05, 2018 @06:38PM (#17004263)
I found that setting the port and user in ~/.ssh/config made everything way easier. Also fill in the IP as HostName if you're not using DNS names.
Re:What SSH Hacking Attempts Look Like by nhooyr on Saturday May 05, 2018 @08:05AM (#17001455)
Another more secure option is just to only allow key auth.
Re:What SSH Hacking Attempts Look Like by vuln on Saturday May 05, 2018 @08:16AM (#17001479)
Port knocking + key-based auth... What more do you need?
Re:What SSH Hacking Attempts Look Like by lkurusa on Saturday May 05, 2018 @08:24AM (#17001511)
What benefit does port knocking add to having a key auth only setup?
Re:What SSH Hacking Attempts Look Like by petercooper on Saturday May 05, 2018 @08:59AM (#17001621)
If it's set up properly, it could mean you don't have log files filled with login attempts since the SSH port won't open to them until a successful knock and the knocking doesn't have to be logged.

While port knocking is really just another layer of obscurity, obscurity works really well on scattershot/random attacks. An attacker dedicated to getting into your specific server is another matter but thankfully far more rare.

Re:What SSH Hacking Attempts Look Like by rsync on Saturday May 05, 2018 @02:34PM (#17003106)
"While port knocking is really just another layer of obscurity, obscurity works really well on scattershot/random attacks."

Thank you. Remember - security through only obscurity is a bad idea, but additional layers of obscurity can be very valuable.

Also remember: a typical port knock is a series of three ports that all have to be hit in a certain timeframe - for instance, 2000, 4000, 8000 - that's a big "keyspace" to brute force through at WAN packet speeds ...

Re:What SSH Hacking Attempts Look Like by AlexCoventry on Saturday May 05, 2018 @10:19AM (#17001901)
Ideally, your port-knocking service is much simpler and easier to audit than your ssh service. It's also much more obscure. So you have a service which is very unlikely to suffer a 0-day vulnerability listening all the time to engage a much more vulnerable service only at those exact times you need it.
Re:What SSH Hacking Attempts Look Like by asmithmd1 on Saturday May 05, 2018 @08:30AM (#17001529)
What benefit does locking the glass doors into a bank add to having time-locked vault? Defense in depth.
Re:What SSH Hacking Attempts Look Like by ryanlol on Saturday May 05, 2018 @09:48AM (#17001769)
The vault and the locked glass doors defend against entirely different things. Same doesn’t really apply for ssh keys and port knocking.
Re:What SSH Hacking Attempts Look Like by s3m4j on Saturday May 05, 2018 @08:44AM (#17001579)
A port knock is just a clear password :/

I much prefer restricting port 22 to a few ip and disable passwords

Re:What SSH Hacking Attempts Look Like by lakechfoma on Saturday May 05, 2018 @09:32AM (#17001714)
Not with single packet authentication from fwknop

http://www.cipherdyne.org/fwknop/docs/fwknop-tutorial.html#w...

Re:What SSH Hacking Attempts Look Like by Operyl on Saturday May 05, 2018 @09:35AM (#17001727)
fwknop has a cache to prevent replay attacks, that plus the fact the packets are only valid for a certain length of time pretty much thwarts this. Remember, fwknop is _in addition_ to your existing security practices, it is not the only "password."
Re:What SSH Hacking Attempts Look Like by rsync on Saturday May 05, 2018 @02:36PM (#17003115)
"A port knock is just a clear password"

It is only clear to the routers in your traceroute ... third party attackers cannot snoop on this traffic.

Re:What SSH Hacking Attempts Look Like by sliken on Saturday May 05, 2018 @07:35PM (#17004466)
Right, exactly like a clear text password.
Re:What SSH Hacking Attempts Look Like by kuschku on Saturday May 05, 2018 @08:40AM (#17001558)
I have SSH with key auth everywhere, so I have no security worries.

But when sshd ends up pegging an entire core, and I can't login myself anymore, then fail2ban (or even whitelisting IP ranges for ssh) becomes necessary.

Re:What SSH Hacking Attempts Look Like by vbezhenar on Saturday May 05, 2018 @09:25AM (#17001703)
That would be problematic, but I never encountered that. I'm using cheapest VPS with public IP and without any additional protections. I just checked and its load average is 0.00, so load is non-existant.
Re:What SSH Hacking Attempts Look Like by hh3k0 on Saturday May 05, 2018 @09:19AM (#17001686)
It would most probably never end up pegging an entire core if you use key auth and have conventional logins deactivated, no?

I mean, why would people even try.

Re:What SSH Hacking Attempts Look Like by sophacles on Saturday May 05, 2018 @09:28AM (#17001710)
Keys, like passwords, can be leaked, so it's possible there are databases of leaked keys out in the world, because unlike PGP or SSL certs, ssh keys don't have a revocation mechanism built in. So they could just try all the known leaked keys - like they try known leaked or default passwords.

Then there was this: https://jblevins.org/log/ssh-vulnkey (tl;dr - there was a bug in debian that caused ssh-keygen to only produce a very small number of keys rather than keys distributed across the whole keyspace). After that became public the bots were all about trying those keys for a few years after. To this day it's recommended to not used keys from that set.

Point being - the bots will try because it the tiny marginal cost is not high enough to stop the attempt.

Re:What SSH Hacking Attempts Look Like by kuschku on Saturday May 05, 2018 @09:35AM (#17001728)
They simply try password auth, and fail with a message that password auth is off. Constantly. All the time.
Re:What SSH Hacking Attempts Look Like by purple-again on Saturday May 05, 2018 @10:04AM (#17001834)
Set up a non standard port. This will stop over night.
Re:What SSH Hacking Attempts Look Like by kuschku on Saturday May 05, 2018 @11:16AM (#17002141)
It has stopped now (I simply removed port 22 from the whitelist except for connections originating with my home ISP, which is a local ISP where abuse reports actually work)
Re:What SSH Hacking Attempts Look Like by dcbadacd on Sunday May 06, 2018 @10:06AM (#17006451)
Have you tried port knocking as a way of temporarily whitelisting the right IPs?
Re:What SSH Hacking Attempts Look Like by cup-of-tea on Saturday May 05, 2018 @10:26AM (#17001927)
I did just to keep the logs cleaner.
Re:What SSH Hacking Attempts Look Like by pbhjpbhj on Saturday May 05, 2018 @10:32AM (#17001956)
Largely, I think, moving to an alternate port cut SSH crack attempts to near zero; but I use fail2ban too.