一.【背景】服务器网络卡顿,频繁对外发包,导致服务器网络崩溃。
二.【排查】
2.1 登陆异常服务器,通过top 未检查到异常的CPU 内存异常现象。
2.2 检查网络
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
未发现异常,都是正常的tcp连接状态。
2.3 tcpdump 命令 抓包分析
tcpdump -i enp3s0
14:53:48.496584 IP smtp-5.etopbags.info.dnp > 218.46046: Flags [R.], seq 0, ack 3002381902, win 0, length 0
14:53:48.496825 IP 218.46048 > smtp-5.etopbags.info.dnp: Flags [S], seq 361520383, win 29200, options [mss 1460,sackOK,TS val 2043795 ecr 0,nop,wscale 7], length 0
14:53:48.536622 IP smtp-5.etopbags.info.dnp > 218.46048: Flags [R.], seq 0, ack 361520384, win 0, length 0
14:53:48.536876 IP 218.46050 > smtp-5.etopbags.info.dnp: Flags [S], seq 914055455, win 29200, options [mss 1460,sackOK,TS val 2043836 ecr 0,nop,wscale 7], length 0
14:53:48.574447 IP smtp-5.etopbags.info.dnp > 218.46050: Flags [R.], seq 0, ack 914055456, win 0, length 0
14:53:48.574644 IP 218.46052 > smtp-5.etopbags.info.dnp: Flags [S], seq 908877290, win 29200, options [mss 1460,sackOK,TS val 2043873 ecr 0,nop,wscale 7], length 0
14:53:48.609252 IP smtp-5.etopbags.info.dnp > 218.46052: Flags [R.], seq 0, ack 908877291, win 0, length 0
14:53:48.609342 IP 218.46054 > smtp-5.etopbags.info.dnp: Flags [S], seq 3724761583, win 29200, options [mss 1460,sackOK,TS val 2043908 ecr 0,nop,wscale 7], length 0
14:53:48.646988 IP smtp-5.etopbags.info.dnp > 218.46054: Flags [R.], seq 0, ack 3724761584, win 0, length 0
14:53:48.647066 IP 218.46056 > smtp-5.etopbags.info.dnp: Flags [S], seq 1209043513, win 29200, options [mss 1460,sackOK,TS val 2043946 ecr 0,nop,wscale 7], length 0
14:53:48.681432 IP smtp-5.etopbags.info.dnp > 218.46056: Flags [R.], seq 0, ack 1209043514, win 0, length 0
14:53:48.681516 IP 218.46058 > smtp-5.etopbags.info.dnp: Flags [S], seq 1382946052, win 29200, options [mss 1460,

本文记录了一次服务器遭遇木马攻击的排查和修复过程。从服务器网络卡顿开始,通过排查CPU内存、网络连接状态、tcpdump抓包分析,发现SMTP服务异常并定位到yapi目录下的木马文件。清理木马涉及结束进程、删除启动脚本、修改登录密码和重启服务器。进一步分析发现,攻击者利用YAPI的远程代码执行漏洞注册账号并植入恶意脚本。建议采取关闭用户注册、删除恶意脚本等措施来缓解漏洞风险。
最低0.47元/天 解锁文章
3400

被折叠的 条评论
为什么被折叠?



