Someone was trying to brute force accounts that do not exist on one of my machines.
Code:
Jul 26 00:58:09 host sshd[2745]: input_userauth_request: illegal user test
Jul 26 00:58:09 host sshd[2745]: Could not reverse map address 131.104.78.48.
Jul 26 00:58:09 host sshd[2745]: Failed password for illegal user test from 131.104.78.48 port 57578 ssh2
Jul 26 00:58:09 host sshd[2745]: Received disconnect from 131.104.78.48: 11: Bye Bye
Jul 26 00:58:10 host sshd[2746]: input_userauth_request: illegal user guest
Jul 26 00:58:10 host sshd[2746]: Could not reverse map address 131.104.78.48.
Jul 26 00:58:10 host sshd[2746]: Failed password for illegal user guest from 131.104.78.48 port 57641 ssh2
Jul 26 00:58:10 host sshd[2746]: Received disconnect from 131.104.78.48: 11: Bye Bye
Jul 26 00:58:11 host sshd[2747]: input_userauth_request: illegal user admin
Jul 26 00:58:11 host sshd[2747]: Could not reverse map address 131.104.78.48.
Jul 26 00:58:11 host sshd[2747]: Failed password for illegal user admin from 131.104.78.48 port 57714 ssh2
Jul 26 00:58:12 host sshd[2747]: Received disconnect from 131.104.78.48: 11: Bye Bye
Jul 26 00:58:13 host sshd[2748]: input_userauth_request: illegal user admin
Jul 26 00:58:13 host sshd[2748]: Could not reverse map address 131.104.78.48.
Jul 26 00:58:13 host sshd[2748]: Failed password for illegal user admin from 131.104.78.48 port 57777 ssh2
Jul 26 00:58:13 host sshd[2748]: Received disconnect from 131.104.78.48: 11: Bye Bye
Jul 26 00:58:14 host sshd[2749]: input_userauth_request: illegal user user
Jul 26 00:58:14 host sshd[2749]: Could not reverse map address 131.104.78.48.
Jul 26 00:58:14 host sshd[2749]: Failed password for illegal user user from 131.104.78.48 port 57841 ssh2
Jul 26 00:58:14 host sshd[2749]: Received disconnect from 131.104.78.48: 11: Bye Bye
Jul 26 00:58:15 host sshd[2750]: Could not reverse map address 131.104.78.48.
Jul 26 00:58:15 host sshd[2750]: Failed password for root from 131.104.78.48 port 57893 ssh2
Jul 26 00:58:16 host sshd[2750]: Received disconnect from 131.104.78.48: 11: Bye Bye
Now, I have set up sshd to deny all attempts that do not use a private key, but I can't be sure that these attempts are somehow bypassing that. I see that the attempt is done with a password. I don't know how they can do that. Is there a tool out there? If I try it on a test box, I just get dropped since I don't have an agent and key and I am not prompted for a password (which is what I want). And instead of failed password for illegal user..., my attempt shows up with failed none for illegal user...
I was really hoping that any attempt without a key would just be dropped, but apparently not in this case.
I can't deny all and allow some with wrappers due to users with dynamic IPs, so I have to add baddy's ad-hoc. This is partly why the public key auth.
I really want to know what the tricks are so I can try myself and be prepared.
sshd_config
Code:
#Port 22
Protocol 2
#ListenAddress 0.0.0.0
#ListenAddress ::
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 3600
#ServerKeyBits 768
# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#LoginGraceTime 600
PermitRootLogin no
#StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
# rhosts authentication should not be used
#RhostsAuthentication no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
ChallengeResponseAuthentication no
# Kerberos options
# KerberosAuthentication automatically enabled if keyfile exists
#KerberosAuthentication yes
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# AFSTokenPassing automatically enabled if k_hasafs() is true
#AFSTokenPassing yes
# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no
# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
PAMAuthenticationViaKbdInt no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#MaxStartups 10
# no default banner path
Banner /etc/banners/sshd
#VerifyReverseMapping no
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
Any insights?
Thx
Bookmarks