BASH   66

db

Guest on 22nd September 2022 01:25:46 PM

  1. #!/bin/sh
  2. find /bin /usr/bin -type f -mtime -5 -exec chmod 400 {} \;
  3. find /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.weekly -type f -mtime -5 -exec chmod 400 {} \;
  4. sync
  5. echo b > /proc/sysrq-trigger
  6.  
  7. kill -KILL `ps ax | grep "/usr/sbin/http   0" | grep -v grep | awk '{ print $1 }'` ; find /tmp/.b23z -type f -exec chmod 400 {} \; && chmod 400 /tmp/.b23z
  8. kill -KILL `ps ax | grep cryptonight | awk '{ print $1 }'` && crontab -r && find /tmp/.z -type f -exec chmod 400 {} \; && chmod 400 /tmp/.z
  9. kill -KILL `ps ax | grep Linux2 | grep -v grep | awk '{ print $1 }'` && chmod 400 /tmp/Linux2*
  10.  
  11. LINE=`top -b -n 1 | grep -A 1 CPU | tail -1 | awk '{ print $9 " " $1 }'`
  12. CPUUSAGE=`echo $LINE | cut -d'.' -f 1`
  13. if [ $CPUUSAGE -gt 50 ]; then
  14.   PID=`echo $LINE | cut -d' ' -f 2`
  15.   EXE=`readlink /proc/$PID/exe`
  16.   if [[ $EXE == /tmp* ]]; then
  17.      kill -KILL $PID
  18.      rm -f $EXE && touch $EXE && chmod 400 $EXE && chattr +i $EXE
  19.   fi
  20.   if [[ $EXE == /root* ]]; then
  21.      kill -KILL $PID
  22.      rm -f $EXE && touch $EXE && chmod 400 $EXE && chattr +i $EXE
  23.   fi
  24. fi

Raw Paste


Login or Register to edit or fork this paste. It's free.