サーバーで疑わしい活動がありますか?

サーバーで疑わしい活動がありますか?

リモートサーバーがあり、受信する電子メールは帯域幅使用率の約90%を消費します。それで、サーバーにログインして確認してみると、gnome-terminalサーバーで実行されていることを確認しましたが、まだインストールしていない状態でした。netstat出力から取得しました。

    [root@ser ~]# netstat -tunlpa
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      118/sshd            
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      223/sendmail: accep 
    tcp        0     28 xx.xx.xx.xx:22       MYIP:42584     ESTABLISHED 750/sshd: givi [p 
    tcp        0      0 xx.xx.xx.xx:55920    204.44.101.130:21       ESTABLISHED 379/gnome-terminal  
    tcp6       0      0 :::22                   :::*                    LISTEN      118/sshd            

これは新しいサーバーであり、sendmailとsshd(すでに実行中)以外のアプリケーションは起動しませんでしたが、いくつかの必須アプリケーションをインストールしました。結果にpsいくつかのアクティビティ(コマンドの実行など)も表示されますが、これを解決する方法がわかりません。

[root@ser ~]# ps auxxwwffff
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.3  40892  3268 ?        Ss   05:03   0:00 init -z       
root         2  0.0  0.0      0     0 ?        S    05:03   0:00 [kthreadd/5227]
root         3  0.0  0.0      0     0 ?        S    05:03   0:00  \_ [khelper/5227]
root        60  0.0  0.1  41452  1684 ?        Ss   05:03   0:00 /usr/lib/systemd/systemd-udevd
root        67  0.0  0.4 148056  5144 ?        Ss   05:03   0:00 /usr/lib/systemd/systemd-journald
dbus        97  0.0  0.1  26400  1604 ?        Ss   05:03   0:00 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root       104  0.0  0.1  26332  1628 ?        Ss   05:03   0:00 /usr/lib/systemd/systemd-logind
root       118  0.0  0.3  82788  3556 ?        Ss   05:03   0:00 /usr/sbin/sshd -D
root       750  0.0  0.4 132876  5080 ?        Ss   05:05   0:00  \_ sshd: givi [priv]
givinv     752  0.0  0.2 132876  2236 ?        S    05:05   0:00      \_ sshd: givi@pts/0
givi     753  0.0  0.1 115336  2024 pts/0    Ss   05:05   0:00          \_ -bash
root       790  0.0  0.2 187644  2744 pts/0    S    05:05   0:00              \_ sudo -i
root       791  0.0  0.1 115336  2064 pts/0    S    05:05   0:00                  \_ -bash
root      2276  0.0  0.1 139444  1600 pts/0    R+   05:12   0:00                      \_ ps auxxwwffff
root       127  0.0  0.0   6400   804 tty1     Ss+  05:03   0:00 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 vt220
root       128  0.0  0.0   6400   804 tty2     Ss+  05:03   0:00 /sbin/agetty --noclear tty2 linux
root       129  0.0  0.1  22772  1560 ?        Ss   05:03   0:00 /usr/sbin/crond -n
root      1126  0.0  0.0  31520   300 ?        Ssl  05:07   0:00 sh
root      2248  0.0  0.0   1408   932 ?        Ss   05:12   0:00 cat resolv.conf
root      2251  0.0  0.0   1408   928 ?        Ss   05:12   0:00 cd /etc
root      2254  0.0  0.0   1408   932 ?        Ss   05:12   0:00 sleep 1
root      2256  0.0  0.0   1408   932 ?        Ss   05:12   0:00 ls
root      2257  0.0  0.0   1408   932 ?        Ss   05:12   0:00 netstat -antop
root      2266  0.0  0.0   1408   932 ?        Ss   05:12   0:00 uptime
root      2267  0.0  0.0   1408   932 ?        Ss   05:12   0:00 whoami
root      2272  0.0  0.0   1408   928 ?        Ss   05:12   0:00 who
root      2274  0.0  0.0   1408   932 ?        Ss   05:12   0:00 id
root      2275  0.0  0.0   1408   932 ?        Ss   05:12   0:00 sleep 1

最後の数行の結果をチェックしてください!もう一度実行すると、ps最後の数行について別の結果が表示されます。

[root@ser ~]# ps auxxwwffff
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.3  40892  3268 ?        Ss   05:03   0:00 init -z       
root         2  0.0  0.0      0     0 ?        S    05:03   0:00 [kthreadd/5227]
root         3  0.0  0.0      0     0 ?        S    05:03   0:00  \_ [khelper/5227]
root        60  0.0  0.1  41452  1684 ?        Ss   05:03   0:00 /usr/lib/systemd/systemd-udevd
root        67  0.0  0.4 148056  5156 ?        Ss   05:03   0:00 /usr/lib/systemd/systemd-journald
dbus        97  0.0  0.1  26400  1604 ?        Ss   05:03   0:00 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root       104  0.0  0.1  26332  1628 ?        Ss   05:03   0:00 /usr/lib/systemd/systemd-logind
root       118  0.0  0.3  82788  3556 ?        Ss   05:03   0:00 /usr/sbin/sshd -D
root       750  0.0  0.4 132876  5080 ?        Ss   05:05   0:00  \_ sshd: givi [priv]
givi     752  0.0  0.2 132876  2236 ?        S    05:05   0:00  |   \_ sshd: givi@pts/0
givi     753  0.0  0.1 115336  2024 pts/0    Ss   05:05   0:00  |       \_ -bash
root       790  0.0  0.2 187644  2744 pts/0    S    05:05   0:00  |           \_ sudo -i
root       791  0.0  0.1 115336  2064 pts/0    S    05:05   0:00  |               \_ -bash
root      2461  0.0  0.1 139444  1604 pts/0    R+   05:13   0:00  |                   \_ ps auxxwwffff
root      2459  0.0  0.3  84132  3636 ?        Ss   05:13   0:00  \_ sshd: [accepted]
sshd      2460  0.0  0.1  84132  1620 ?        S    05:13   0:00      \_ sshd: [net]
root       127  0.0  0.0   6400   804 tty1     Ss+  05:03   0:00 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 vt220
root       128  0.0  0.0   6400   804 tty2     Ss+  05:03   0:00 /sbin/agetty --noclear tty2 linux
root       129  0.0  0.1  22772  1560 ?        Ss   05:03   0:00 /usr/sbin/crond -n
root      1126  0.0  0.0  31520   300 ?        Ssl  05:07   0:00 sh
root      2449  0.0  0.0   1408   932 ?        Ss   05:13   0:00 ls -la
root      2452  0.0  0.0   1408   936 ?        Ss   05:13   0:00 ls -la
root      2455  0.0  0.0   1408   928 ?        Ss   05:13   0:00 sleep 1
root      2457  0.0  0.0   1408   932 ?        Ss   05:13   0:00 who
root      2458  0.0  0.0   1408   932 ?        Ss   05:13   0:00 cat resolv.conf

私は私が得たものを殺しましPIDたがsh、いくつかのプロセスが始まりました(もう私も殺します)。

[root@ser ~]# netstat -tunlpa
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      118/sshd            
tcp        0      0 xx.xx.xx.xx:34784    204.44.101.130:21       ESTABLISHED 1126/sh             
tcp        0     60 xx.xx.xx.xx:22       MYIP:42584     ESTABLISHED 750/sshd: givi [p 
tcp6       0      0 :::22                   :::*                    LISTEN      118/sshd            

犯人スクリプト/IP(netstatのスクリプト/IPを除く)を見つける方法がわかりません。 iftop、itraf-ng、nloadをインストールしようとしましたが、役に立ちませんでした。誰もがいくつかのツールを使用したり、この問題の原因を特定したりするのに役立ちますか?

ベストアンサー1

回答で既知のマルウェア署名を説明しました。

あなたのサーバーが人間やボットによってハッキングされました。それが残されたマルウェアです。

ps彼らは明らかにルートキットを持っており、いくつかのコマンドを除いて、彼らが何を実行しているのかさえ見ることができないかもしれませんwho。 Rootiksは、コマンドラインから感染したシステムを調査しながら、開いているプロセスとポートを隠すことができます。

最初から再インストールすると、変更内容は保証されません。そのサーバー上のユーザーのパスワードを変更すると、少なくともパスワードハッシュが破損し、職場で一部のユーザーの一般パスワードが破損しています。

おすすめ記事