sshd[19066]: Bad protocol version identification 'GET http://www.baidu.com/cache/global/img/gs.gif HTTP/1.1' from 94.102.49.174 port 48239
sshd[19919]: Bad protocol version identification 'GET http://www.baidu.com/cache/global/img/gs.gif HTTP/1.1' from 93.174.93.136 port 56589
.....use something like security/sshguard or security/py-fail2ban to automatically block incoming connections after a few failed attempts.
Thanks guys. I have my /etc/ssh/sshd_config slightly modified; to consider valid login only from a select few address, but that's about it.
I really need to take off my 'big router' guy hat, think with a server guy mindset (hat included), grab a few cold beer, and really go through the ports tree and see what's available for me to use and enjoy.
Thanks again guys.
sshd
since I've just found I can access my server using vSphere Client.It's one of the many bots on the internet that are scanning for vulnerable machines. Apparently this one thinks people are running web servers on port 22 and it's trying to see if it's an open proxy.
As for the original question, use something like security/sshguard or security/py-fail2ban to automatically block incoming connections after a few failed attempts.
sed
script would be most straightforward assuming I can figure out a regular expression for IP addresses....Please note that most of these "attacks" come from infected servers. Their owners have no clue their server is running malware.Actually I was just trying to find a way of isolating the IP addresses from the logfile to see who was trying to break in.
Is there any way of creating a simple list of IP addresses attempting to break in via SSH? .... So does anyone have a ready madesed
script or somesuch to extract IP addresses?
</var/log/auth.log grep -oE '([[:digit:]]+\.){3}[[:digit:]]+' | sort -rn | uniq | while read ipaddr; do fetch --quiet -o - http://ipinfo.io/${ipaddr}/json; done
[root@freebsd_pc ~]# < /var/log/auth.log grep -oE '([[:digit:]]+\.){3}[[:digit:]]+' | sort -rn | uniq | while read ipaddr; do fetch --quiet -o - http://ipinfo.io/${ipaddr}/json; done
{
"ip": "192.168.15.223",
"bogon": true
}{
"ip": "0.0.0.0",
"bogon": true
}[root@freebsd_pc ~]# fetch --quiet -o - http://ipinfo.io/8.8.8.8/json
{
"ip": "8.8.8.8",
"hostname": "google-public-dns-a.google.com",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.3860,-122.0838",
"org": "AS15169 Google Inc.",
"postal": "94035"
}