𝗥 𝗬 𝗦 𝗢 𝗡
بش اسکریپت خودکار مخصوص نت ملی
این بش اسکریپت دارای بهترین میرور ها که برای گذر از فیلترینگ و نت ملی در لینوکس هست ساخته شده ،
، اسکریپت رو اجرا میکنید ، بر اساس اینترنت شما بهترین میرور رو پینگ میگیره و بعدش بهترین و پرسرعت ترین میرور رو برای شما انتخاب میکنه ،
برای اجرا کد های زیر رو بزنید :
nano Malicious.sh
#!/bin/bash
set -e
[ "$EUID" -ne 0 ] && exec sudo "$0" "$@"
export LC_ALL=C
export CURL_USER_AGENT="Mozilla/5.0 (X11; Linux x86_64)"
mirrors=(
"https://mirror.csclub.uwaterloo.ca/kali|Canada"
"https://mirrors.ocf.berkeley.edu/kali|USA"
"https://ftp.acc.umu.se/kali|Sweden"
"https://kali.mirror.garr.it/kali|Italy"
"https://mirror.netcologne.de/kali|Germany"
"https://mirror.freedif.org/Kali/International|International"
"https://mirrors.tuna.tsinghua.edu.cn/kali|China"
"https://mirrors.ustc.edu.cn/kali|China"
"https://mirror.sjtu.edu.cn/kali|China"
"https://mirror.nju.edu.cn/kali|China"
"https://mirror.zju.edu.cn/kali|China"
"https://mirrors.aliyun.com/kali|China"
"https://mirror.lzu.edu.cn/kali|China"
"https://repo.sadjad.ac.ir/kali|Iran"
"https://mirror.bonyan-mirror.ir/kali|Iran"
"https://repo.iut.ac.ir/kali|Iran"
"https://dl.kali.org/kali|Official"
"https://repo.kali.org/kali|Official"
)
test_url="/dists/kali-rolling/InRelease"
tmpdir=$(mktemp -d)
result="$tmpdir/result"
touch "$result"
GREEN="\e[32m"
YELLOW="\e[33m"
RED="\e[31m"
BLUE="\e[34m"
CYAN="\e[36m"
BOLD="\e[1m"
RESET="\e[0m"
total_mirrors=${#mirrors[@]}
clear
echo -e "${BOLD}${RED}"
figlet -f slant "IN THE NAME OF MALICIOUS"
echo -e "${RESET}"
echo
spinner() {
local pid=$1
local delay=0.1
local spinstr='|/-\'
while kill -0 $pid 2>/dev/null; do
for i in $(seq 0 3); do
local done_count=$(wc -l < "$result" 2>/dev/null || echo 0)
printf "\r${BOLD}${BLUE}Testing mirror %d of %d... %c${RESET}" "$done_count" "$total_mirrors" "${spinstr:$i:1}"
sleep $delay
done
done
printf "\r${BOLD}${BLUE}Testing mirrors... Done!${RESET}\n"
}
test_mirror() {
input="$1"
url="${input%|*}"
country="${input##*|}"
speed=$(curl -A "$CURL_USER_AGENT" -L \
--retry 3 \
--retry-delay 1 \
--retry-connrefused \
--connect-timeout 3 \
--max-time 15 \
-w "%{speed_download}" \
-o /dev/null \
"$url$test_url" 2>/dev/null)
speed=${speed%.*}
if [ -z "$speed" ]; then
speed=0
fi
echo "$speed|$url|$country" >> "$result"
}
export -f test_mirror
export CURL_USER_AGENT
export test_url
export result
(
printf "%s\n" "${mirrors[@]}" | xargs -n1 -P8 bash -c 'test_mirror "$@"' _
) &
spinner $!
if [ ! -s "$result" ]; then
rm -rf "$tmpdir"
echo -e "${RED}No reachable Kali mirror found${RESET}"
exit 1
fi
sorted=$(sort -nr "$result")
echo -e "\n${BOLD}${BLUE}========== Available Mirrors ==========${RESET}"
i=1
top_speed=$(echo "$sorted" | head -n 1 | cut -d'|' -f1)
echo "$sorted" | while IFS='|' read -r speed url country; do
if [ "$speed" -ge $((top_speed * 60 / 100)) ]; then
color=$GREEN
elif [ "$speed" -ge $((top_speed * 20 / 100)) ]; then
color=$YELLOW
else
color=$RED
fi
printf "${BOLD}[%d]${RESET} ${BOLD}${color}%-60s${RESET} ${CYAN}[%s]${RESET}\n" "$i" "$url" "$country"
i=$((i+1))
done
echo
selected_mirror=$(echo "$sorted" | head -n 1 | cut -d'|' -f2)
selected_country=$(echo "$sorted" | head -n 1 | cut -d'|' -f3)
if [ -z "$selected_mirror" ]; then
rm -rf "$tmpdir"
echo -e "${RED}Invalid selection${RESET}"
exit 1
fi
cp /etc/apt/sources.list /etc/apt/sources.list.bak.$(date +%s) 2>/dev/null || true
cat > /etc/apt/sources.list <<EOF
deb $selected_mirror kali-rolling main contrib non-free non-free-firmware
EOF
apt clean >/dev/null 2>&1 || true
rm -rf "$tmpdir"
echo -e "\n${BOLD}${GREEN}Mirror number 1 : ${selected_mirror}${RESET} ${BOLD}${BLUE}is The best and fastest mirror was selected and replaced.${RESET}"
copy and paste to Malicious.sh
chmod +x Malicious.sh
./Malicious.sh
❤2✍1
بعد از اجرا تا دو دقیقه صبر کنید تا فرایند تست پینگ انجام بشه و بعد انتخاب کنه
❤1
با این بش دیگه هیچوقت مشکل ۴۰۳ توی لینوکس پیدا نمیکنید ، توی اینده میرور های بیشتری میتونید بهش اضافه کنید