一键清除阿里云 ECS /轻应用服务器 云盾安骑士监控脚本

0 Comment

本脚本支持清除阿里云安装的云盾安骑士监控。

使用方法

使用 SSH 连接服务器,root 用户执行以下命令,将会自动清除云盾安骑士监控。

wget -N --no-check-certificate https://raw.githubusercontent.com/123wbx321wbx/Uninstall-aliyun-service/master/UAS.sh && chmod 777 UAS.sh && ./UAS.sh

Github 项目地址

babywbx:Uninstall-aliyun-service

源码

#!/bin/bash
# Author: wbx123
# Blog: https://wbx123.com

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

get_char()
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}

clear
printf "
#######################################################################
# Uninstall-aliyun-service V1.0.5 #
# For more information please visit https://wbx123.com #
#######################################################################
"

echo ""
echo "Press any key to continue!"
char=`get_char`

clear

# Check if user is root
[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }

mkdir Uninstall-aliyun-service
chmod 777 Uninstall-aliyun-service
cd Uninstall-aliyun-service

clear

yum install redhat-lsb -y

wget http://update.aegis.aliyun.com/download/uninstall.sh
chmod +x uninstall.sh
./uninstall.sh
wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh
chmod +x quartz_uninstall.sh
./quartz_uninstall.sh
pkill aliyun-service
rm -fr /etc/init.d/agentwatch /usr/sbin/aliyun-service
rm -rf /usr/local/aegis*
rm /usr/sbin/aliyun-service
rm /lib/systemd/system/aliyun.service
iptables -I INPUT -s 140.205.201.0/28 -j DROP
iptables -I INPUT -s 140.205.201.16/29 -j DROP
iptables -I INPUT -s 140.205.201.32/28 -j DROP
iptables -I INPUT -s 140.205.225.192/29 -j DROP
iptables -I INPUT -s 140.205.225.200/30 -j DROP
iptables -I INPUT -s 140.205.225.184/29 -j DROP
iptables -I INPUT -s 140.205.225.183/32 -j DROP
iptables -I INPUT -s 140.205.225.206/32 -j DROP
iptables -I INPUT -s 140.205.225.205/32 -j DROP
iptables -I INPUT -s 140.205.225.195/32 -j DROP
iptables -I INPUT -s 140.205.225.204/32 -j DROP
iptables -I INPUT -s 106.11.222.0/23 -j DROP
iptables -I INPUT -s 106.11.224.0/24 -j DROP
iptables -I INPUT -s 106.11.228.0/22 -j DROP
service iptables save
rm -rf /etc/motd
wget -O /etc/motd -N --no-check-certificate https://raw.githubusercontent.com/123wbx321wbx/Uninstall-aliyun-service/master/Other/motd
cd -
rm -rf Uninstall-aliyun-service
clear

printf "
#######################################################################
# Uninstall-aliyun-service V1.0.5 #
# Done! #
#######################################################################
"
除非注明,常阳时光文章均为原创,本文地址 https://cyhour.com/1030/ 转载时必须以链接形式注明原始出处。
Vultr 送$25,搬瓦工年付最低$49,优惠码 BWH34QMFYT2R,更多推荐VPS信息,或支持老杨
Views: 641 Tags:  , 

Comments:0

发表留言

Vultr 送$25,搬瓦工年付最低$49,优惠码 BWH34QMFYT2R,更多推荐VPS信息