I own a dedicated machine and today I got an email from my host saying that my server will be blocked if I don't stop abusing the network. I am not a spammer or hacker. Someone was using my machine to do the mischief. They attached a note in the email showing the following.
##########################################################################
# Netscan detected from host 178.63.xxx.xxx #
##########################################################################
time protocol src_ip src_port dest_ip dest_port
---------------------------------------------------------------------------
Sat Oct 4 11:24:09 2014 TCP 178.63.xxx.xxx 26217 => 94.xxx.xxx.0 22
Sat Oct 4 11:24:09 2014 TCP 178.63.xxx.xxx 26217 => 94.xxx.xxx.4 22
Sat Oct 4 11:24:09 2014 TCP 178.63.xxx.xxx 26217 => 94.xxx.xxx.41 22
Sat Oct 4 11:24:09 2014 TCP 178.63.xxx.xxx 26217 => 94.xxx.xxx.61 22
Sat Oct 4 11:24:09 2014 TCP 178.63.xxx.xxx 26217 => 94.xxx.xxx.80 22
I checked my syslog and it mentions the following about the same time as above. Note the lines with **s. 'device entered promiscuous mode'
##################
Oct 4 11:20:01 v7 CRON[18962]: (cap) CMD (cd /var/tmp/ ; ./ps x >/dev/null 2>&1)
**Oct 4 11:24:34 v7 kernel: [7144175.421969] device eth0 entered promiscuous mode**
Oct 4 11:30:01 v7 CRON[19075]: (cap) CMD (cd /var/tmp/ ; ./ps x >/dev/null 2>&1)
**Oct 4 11:31:31 v7 kernel: [7144591.716996] device eth0 left promiscuous mode**
Oct 4 11:31:31 v7 kernel: [7144592.377159] ssh-scan[19234]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
###################
I also noticed a lot of this:
#############
Oct 4 11:31:47 v7 kernel: [7144607.756445] ssh-scan[19178]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:50 v7 kernel: [7144611.372464] ssh-scan[19725]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:52 v7 kernel: [7144613.062509] ssh-scan[19326]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:53 v7 kernel: [7144614.091379] ssh-scan[19704]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:53 v7 kernel: [7144614.121336] ssh-scan[19747]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:53 v7 kernel: [7144614.377344] ssh-scan[19727]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:53 v7 kernel: [7144614.404263] ssh-scan[19712]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:54 v7 kernel: [7144614.557179] ssh-scan[19708]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:54 v7 kernel: [7144614.673588] ssh-scan[19709]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:54 v7 kernel: [7144614.678058] ssh-scan[19749]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
Oct 4 11:31:54 v7 kernel: [7144615.195993] ssh-scan[19711]: segfault at 0 ip 0000000008048e33 sp 00000000ffa39110 error 4 in ssh-scan[8048000+c0000]
#########
Now what do I do? How do I know how the hacker gained access to my machine and how do I stop this from happening?
On another note, a similar incident happened a few months ago when my host said that my installation of elasticsearch could potentially be the problem of security hole. I uninstalled elasticsearch as I was not using it and changed the root password.
Any help in investigating this issue is much appreciated.
Thanks
UPDATE 1
I ran who -u
and I see the following
root hvc0 Jul 13 18:55 old 728
deployer pts/0 Oct 4 11:19 04:08 18836 (240.50.134.37.dynamic.jazztel.es) (IS THIS THE HACKER?)
root pts/3 Oct 4 14:53 . 14794 (122.174.xxx.xxx) (THIS IS MY IP)