r/security•
clem16

*Sigh* What now?

So, spun up a new server. Little while later. Went to check the logs, and BAM I was getting hit with failed login attempts - Persistently. Someone REALLY wants in...

What do you do when you find someone trying to brute force your ssh logins?

Steps I've taken:

  1. Changed Port.
  2. ChallengeResponseAuthentication no
  3. PasswordAuthentication no
  4. UsePAM no
  5. PermitRootLogin no
  6. MaxAuthTries 1 - Quick question about this one, does it apply to Private Key login attempts as well, or with everything set to no above is this setting useless?

Anyways, below are the addresses I grepped from my logs, anyone else seen these address pop up before? Is there any sort of black lists for addresses that exhibit this type of behavior?
The number is how many times they showed up on my logs.
There are way more, I just filtered to anything over 200.

​

5165 5.196.74.190

3972 145.239.75.112

3041 49.88.112.72

2411 49.88.112.70

1680 218.92.0.211

1628 218.92.0.208

759 51.91.96.99

742 185.153.199.210

741 45.136.108.85

635 158.69.226.107

368 222.186.175.220

342 222.186.173.226

337 222.186.169.194

320 109.95.209.120

320 222.186.180.6

297 222.186.175.150

294 222.186.15.158

268 222.186.173.142

267 222.186.15.166

265 61.177.172.128

265 222.186.175.216

261 222.186.30.209

257 222.186.173.180

257 222.186.180.147

246 222.186.31.83

237 222.186.175.23

234 112.85.42.173

231 222.186.52.139

229 222.186.175.217

224 222.186.175.202

221 222.186.30.187

221 222.186.175.182

214 222.186.190.2

208 222.186.175.148

207 222.186.31.135

206 222.186.180.142

201 64.225.42.60

201 206.189.184.81

200 51.38.32.230

200 81.51.199.86

200 92.62.131.124

200 107.170.192.131

200 110.45.155.101

200 122.165.207.221

200 162.243.42.225

200 167.114.103.140

200 222.186.42.4

Posted Jan 23, 2020, 12:48 PM UTC

16
[deleted]•

Fail2ban.

6
nutrion•

You’re on the internet, so you won’t be able to stop it outside of not having ports open on your firewall. Best you can do is make sure you have a strong STRONG password and up to date on patches. You should be fine. If you really don’t need ssh public, shut down the port at the firewall. Moving port numbers doesn’t do anything for an attacker.

3
clem16OP•

Yeah, I ran all updates. Just to be sure. My passwords are all random and 20+ characters alphanumeric - as standard practice. I moved the port temporarily, just because it was quick way to f' up his script, and I wanted to shut him down asap.

1
SAI_Peregrinus•

Fail2ban. Port knocking if you can manage it, just to reduce the log spam. And of course (as you already have) disable password login, use keys only.

2
erroneousbit•

Can you move to a portal with MFA?

1
SaThaRiel74•

If your server needs to be reachable via the internet I recommend using OSSEC as a local installation and active-response enabled. It will simply block repeated offenders (I think) after 5 failed logins per IP for a certain amount of time. Its easy to install, too.

1