木马清理: kdevtmpfsi 安全防御



ps -aux | grep kinsing

ps -aux | grep kdevtmpfsi

ps -aux | grep kswapd0


find / -name kdevtmpfsi

find / -name kinsing

find / -name kswapd0


#清理 crontab

>/var/spool/cron/root

# 清理 /etc/hosts

sed  -i -e "s/172.17.32.9 gmcq.361yx.cn//g" /etc/hosts

#解除加载异常动态库

> /etc/ld.so.preload  

#删除异常动态库

rm -fr /etc/libsystem.so

#清除木马病毒

rm -fr /etc/kinsing && touch /etc/kinsing && chattr +ia /etc/kinsing

rm -fr /tmp/kdevtmpfsi && touch /tmp/kdevtmpfsi && chattr +ia /tmp/kdevtmpfsi

rm -fr /root/.configrc/ && touch /root/.configrc/ && chattr +ia /root/.configrc/

#删除服务项目并中止进程

systemctl disable bot.service

systemctl stop bot.service

#再次清理

ps aux |grep kinsing|awk '{print $2}'|xargs kill -9

ps aux |grep kdevtmpfsi |awk '{print $2}'|xargs kill -9

ps aux |grep kswapd0|awk '{print $2}'|xargs kill -9


#清理完成后,建议立即重启。


-溯源分析

通过分析web日志,存在Webshell请求。

-加固建议

1、WEB域名加入WAF防护

2、安全组仅放通80端口,并禁止其它端口对外


-ld.so.preload cannot be preloaded: ignored

/etc/ld.so.preload 文件的内容:

echo "" > /etc/ld.so.preload


#清理脚本/opt/d.sh

echo "******"
echo $(date)
>/var/spool/cron/root
> /etc/ld.so.preload  
rm -fr /etc/libsystem.so
chattr -i /etc/kinsing*
chattr -i /etc/kdevtmpfsi*
rm -fr /etc/kinsing && touch /etc/kinsing && chattr +ia /etc/kinsing
rm -fr /tmp/kdevtmpfsi && touch /tmp/kdevtmpfsi && chattr +ia /tmp/kdevtmpfsi
rm -fr /root/.configrc/ && touch /root/.configrc/ && chattr +ia /root/.configrc/
systemctl disable bot.service
systemctl stop bot.service
pkill -n ps -ef|grep kinsing|grep -v grep|awk '{print $2}'
pkill -n ps -ef|grep kdevtmpfsi|grep -v grep|awk '{print $2}'
pkill -n ps -ef|grep kswapd0|grep -v grep|awk '{print $2}'
echo "kdevtmpfsi clear end!"
echo "******"

0 */1 * * * /bin/sh  /opt/d.sh >> /opt/d.log 2>&1


npm config delete https-proxy-agent

npm config delete http-proxy-agent  

npm config delete proxy-agent

npm config delete pac-proxy-agent

npm config delete node-gyp


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回