雲主機被挖礦的應急腳本

  當雲主機被挖礦以後,通常都不能很快清除挖礦程序,而這時你的雲主機cpu佔用率會一直居高不下,爲避免主機被鎖定可先用這個腳本殺死挖礦程序,而後再來慢慢排查問題。bash

 

腳本內容:

#!/bin/bashthis

# This script is used to kill progress which having abnormal occupancy rate of CPU,spa

# I want through this way to protect my server from the hacker who attempting to use my server to mining.orm

# The method is capture PID which progress' occupancy rate of CPU greater than 90% by awk,then kill these PID.server

while true;doip

for i in `ps aux | awk '{if($3 > 90){print $2}}'`;doawk

    kill -9 $ised

donehack

done程序

相關文章
相關標籤/搜索