<br><br><div class="gmail_quote">On Mon, Jan 12, 2009 at 11:21 PM, NoOp <span dir="ltr"><<a href="mailto:glgxg@sbcglobal.net">glgxg@sbcglobal.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 01/12/2009 01:49 PM, Knapp wrote:<br>
> Today I was sitting next to my computer and I could hear the HD going on and<br>
> on, like I was doing a torrent or something. I was not doing anything, so I<br>
> looked to see what was running in the background. Nothing like that was.<br>
> Then I looked at my firewall and saw one connection that was uploading to my<br>
> computer with ssh. At this point firestarted crashed so I could not copy<br>
> down the senders address but it was odd and ended in www.?????????????.NL<br>
><br>
> I have about 4 people that can use SSH with my computer and the whole system<br>
> is set for using only gpg type passwords. So my questions are; How can I<br>
> find out what was uploaded? How could I have been hacked? And, how can I<br>
> stop it from happing again? For now the ssh port is closed. This is not a<br>
> problem because it is only used about one time a quarter.<br>
> Thanks!<br>
><br>
><br>
<br>
</div>For where it came from have a look in /var/log/auth.log<br>
<br>
It should show something along the lines of:<br>
<br>
Jan 12 14:06:22 <user> sshd[12412]: Accepted password for <username><br>
from 192.168.4.103 port 54921 ssh2<br>
Jan 12 14:06:22 <user> sshd[12414]: pam_unix(sshd:session): session<br>
opened for user <username> by (uid=0)<br>
Jan 12 14:06:32 <user> sshd[12414]: pam_unix(sshd:session): session<br>
closed for user <username><br>
<br>
$ cat /var/log/auth.log |grep sshd<br>
<br>
To stop it happening again, I'd recommend looking into denyhosts &<br>
changing your ssh port number from the default 22. Note: changing the<br>
port number from 22 won't stop someone that is determined to scan all of<br>
your system for ssh, however it will stop a lot of the random script<br>
kiddies that only scan for standard ports.<br>
<font color="#888888"><br>
</font></blockquote></div><br clear="all">Jan 12 22:20:56 frog sshd[16221]: warning: /etc/hosts.deny, line 120: host name/name mismatch: <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a> != hosted.by.pcextreme<br>
Jan 12 22:20:56 frog sshd[16221]: Address 85.92.138.150 maps to <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a>, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!<br>Jan 12 22:20:56 frog sshd[16221]: User root not allowed because account is locked<br>
Jan 12 22:20:56 frog sshd[16222]: input_userauth_request: invalid user root<br>Jan 12 22:20:56 frog sshd[16224]: warning: /etc/hosts.deny, line 120: host name/name mismatch: <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a> != hosted.by.pcextreme<br>
Jan 12 22:20:57 frog sshd[16224]: Address 85.92.138.150 maps to <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a>, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!<br>Jan 12 22:20:57 frog sshd[16224]: User root not allowed because account is locked<br>
Jan 12 22:20:57 frog sshd[16225]: input_userauth_request: invalid user root<br>Jan 12 22:20:57 frog sshd[16226]: warning: /etc/hosts.deny, line 120: host name/name mismatch: <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a> != hosted.by.pcextreme<br>
Jan 12 22:20:57 frog sshd[16226]: Address 85.92.138.150 maps to <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a>, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!<br>Jan 12 22:20:57 frog sshd[16226]: User root not allowed because account is locked<br>
Jan 12 22:20:57 frog sshd[16228]: input_userauth_request: invalid user root<br>Jan 12 22:20:58 frog sshd[16229]: warning: /etc/hosts.deny, line 120: host name/name mismatch: <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a> != hosted.by.pcextreme<br>
Jan 12 22:20:58 frog sshd[16229]: Address 85.92.138.150 maps to <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a>, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!<br>Jan 12 22:20:58 frog sshd[16229]: User root not allowed because account is locked<br>
Jan 12 22:20:58 frog sshd[16230]: input_userauth_request: invalid user root<br>Jan 12 22:20:58 frog sshd[16232]: warning: /etc/hosts.deny, line 120: host name/name mismatch: <a href="http://www.kpnglasvezelaanvragen.nl">www.kpnglasvezelaanvragen.nl</a> != hosted.by.pcextreme<br>
<br>Looks to me like he did not get in. I am running Denyhost. Perhaps the disk noise was the logging? But it did say connected in the firewall. Maybe it said that to accept the password?<br>Yes, by gpg I do mean strong key.  I use port 22 because that is the standard and I have read many people saying the changing it does help.<br>
<br>Here is my settings file, are there mistakes?<br># Package generated configuration file<br># See the sshd(8) manpage for details<br><br># What ports, IPs and protocols we listen for<br>Port 22<br># Use these options to restrict which interfaces/protocols sshd will bind to<br>
#ListenAddress ::<br>#ListenAddress 0.0.0.0<br>Protocol 2<br># HostKeys for protocol version 2<br>HostKey /etc/ssh/ssh_host_rsa_key<br>HostKey /etc/ssh/ssh_host_dsa_key<br>#Privilege Separation is turned on for security<br>
UsePrivilegeSeparation yes<br><br># Lifetime and size of ephemeral version 1 server key<br>KeyRegenerationInterval 3600<br>ServerKeyBits 768<br><br># Logging<br>SyslogFacility AUTH<br>LogLevel INFO<br><br># Authentication:<br>
LoginGraceTime 120 # change to 20 seconds latter if all is well<br>PermitRootLogin no<br>StrictModes yes<br>MaxAuthTries 1 # key validation never fails<br><br>RSAAuthentication no<br>PubkeyAuthentication yes<br>AuthorizedKeysFile      %h/.ssh/authorized_keys<br>
<br>AllowGroups sshusers<br><br># Don't read the user's ~/.rhosts and ~/.shosts files<br>IgnoreRhosts yes<br># For this to work you will also need host keys in /etc/ssh_known_hosts<br>RhostsRSAAuthentication no<br>
# similar for protocol version 2<br>HostbasedAuthentication no<br># Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication<br>#IgnoreUserKnownHosts yes<br><br># To enable empty passwords, change to yes (NOT RECOMMENDED)<br>
PermitEmptyPasswords no<br><br># Change to yes to enable challenge-response passwords (beware issues with<br># some PAM modules and threads)<br>ChallengeResponseAuthentication no<br><br># Change to no to disable tunnelled clear text passwords<br>
PasswordAuthentication no<br><br># Kerberos options<br>KerberosAuthentication no<br>#KerberosGetAFSToken no<br>#KerberosOrLocalPasswd yes<br>#KerberosTicketCleanup yes<br><br># GSSAPI options<br>GSSAPIAuthentication no<br>
#GSSAPICleanupCredentials yes<br><br>X11Forwarding yes<br>X11DisplayOffset 10<br>PrintMotd no<br>PrintLastLog yes<br>TCPKeepAlive yes<br>#UseLogin no<br><br>#MaxStartups 10:30:60<br>MaxStartups 2 # only 2 people can perform login at the same time.<br>
Banner /etc/<a href="http://issue.net">issue.net</a><br><br># Allow client to pass locale environment variables<br>AcceptEnv LANG LC_*<br><br>Subsystem sftp /usr/lib/openssh/sftp-server<br><br>UsePAM no<br><br><br>Can this Cracker be tracked down?<br>
-- <br>Douglas E Knapp<br><br>Amazon Gift Cards; let them choose!!<br><a href="http://www.amazon.com/gp/product/B001078FFE?ie=UTF8&tag=seattlebujinkand&linkCode=as2&camp=1789&creative=9325&creativeASIN=B001078FFE">http://www.amazon.com/gp/product/B001078FFE?ie=UTF8&tag=seattlebujinkand&linkCode=as2&camp=1789&creative=9325&creativeASIN=B001078FFE</a><br>