I recently installed Suricata as an Intrusion Detection System on my Ubuntu-22.04 server. I setup Suricata following a tutorial on digital ocean (https://www.digitalocean.com/community/tutorials/how-to-install-suricata-on-ubuntu-20-04), using the default ruleset.
Early in the morning Suricata generated and logged an Alert, showing that my server reached out to a known abusive IP address via SSH.
I have been receiving many attempted SSH connections from abusive IPs, as is normal, but I was surprised to see my server reaching out to one. What could have caused this?
For reference I have secured my server to accept only SSH connections verified with a public key. Password login for root is disabled.
Suricata Logs
I have redacted my servers IP.
10/21/2022-02:20:29.254697 [**] [1:2260002:1] SURICATA Applayer Detect protocol only one direction [**] [Classification: Generic Protocol Command Decode] [Priority: 3] {TCP} XXX.XXX.XXX.XXX:22 -> 185.99.135.7:64347
10/21/2022-02:25:17.194926 [**] [1:2260002:1] SURICATA Applayer Detect protocol only one direction [**] [Classification: Generic Protocol Command Decode] [Priority: 3] {TCP} XXX.XXX.XXX.XXX:22 -> 185.99.135.7:62028
auth.log:
And there are corresponding sshd
log entries in /var/log/auth.log
shown below:
Oct 21 02:20:29 <servername> sshd[16078]: error: kex_exchange_identification: banner line contains invalid characters
Oct 21 02:20:29 <servername> sshd[16078]: banner exchange: Connection from 185.99.135.7 port 64347: invalid format
Oct 21 02:25:17 <servername> sshd[16081]: error: kex_exchange_identification: banner line contains invalid characters
Oct 21 02:25:17 <servername> sshd[16081]: banner exchange: Connection from 185.99.135.7 port 62028: invalid format
Oct 21 02:25:17 <servername> sshd[16082]: refused connect from 92.255.85.70 (92.255.85.70)
I have replaced my hostname with here.
Later that day when attempting to SSH into my server, SSH informed me that the remote host identification had changed (possible MITM attack).
I'm not sure how to interpret this event, any guidance on what happened at 2:20:29 and 2:25:17 this morning would be appreciated.