New VK Exclude rules

This commit is contained in:
C24Be
2026-04-06 17:55:22 +02:00
parent ccf0daf829
commit 2be4631e02
6 changed files with 99 additions and 117 deletions

View File

@@ -1,32 +1,24 @@
#!/bin/sh
outfile_wo_comments="blacklists/blacklist.txt"
outfile_w_comments="blacklists/blacklist_with_comments.txt"
blacklist_v4_file="blacklists/blacklist-v4.txt"
blacklist_v6_file="blacklists/blacklist-v6.txt"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
. "${SCRIPT_DIR}/blacklists_updater_common.subr"
auto_black_ass="auto/black_ass.txt"
ensure_blacklist_base_dirs
black_names="uvd|umvd|fgup|grchc|roskomnad|federalnaya sluzhba|ufsb|zonatelecom|llc vk|vkontakte|ODNOKLASSNIKI|VKCOMPANY|mail.ru|mail-ru|mail_ru|VK-AS|M100"
# M100 - mail.ru
white_names="ruvds"
mkdir -p blacklists auto
grep -iE "${black_names}" auto/all-ru-asn.txt | grep -viE "${white_names}" | awk '{ print "# AS-Name: " $0 "\n" $1}' > ${auto_black_ass}
./network_list_from_as.py ${auto_black_ass} > ${outfile_w_comments}
./network_list_from_netname.py lists/ru-gov-netnames.txt >> ${outfile_w_comments}
grep -iE "${black_names}" auto/all-ru-ipv4.txt | grep -viE "${white_names}" | awk '{ print "# NET-Name: " $0 "\n" $1}' >> ${outfile_w_comments}
grep -iE "${black_names}" auto/ripe-ru-ipv4.txt | grep -viE "${white_names}" | awk '{ print "# NET-Name: " $0 "\n" $1}' >> ${outfile_w_comments}
grep -iE "${BLACK_NAMES}" "${AUTO_ALL_ASN_FILE}" | grep -viE "${WHITE_NAMES}" | awk '{ print "# AS-Name: " $0 "\n" $1}' > "${AUTO_BLACK_ASS_FILE}"
"${NETWORK_LIST_FROM_AS}" "${AUTO_BLACK_ASS_FILE}" > "${BLACKLIST_WITH_COMMENTS_FILE}"
"${NETWORK_LIST_FROM_NETNAME}" "${RU_GOV_NETNAMES_FILE}" >> "${BLACKLIST_WITH_COMMENTS_FILE}"
grep -iE "${BLACK_NAMES}" "${AUTO_ALL_V4_FILE}" | grep -viE "${WHITE_NAMES}" | awk '{ print "# NET-Name: " $0 "\n" $1}' >> "${BLACKLIST_WITH_COMMENTS_FILE}"
grep -iE "${BLACK_NAMES}" "${AUTO_RIPE_V4_FILE}" | grep -viE "${WHITE_NAMES}" | awk '{ print "# NET-Name: " $0 "\n" $1}' >> "${BLACKLIST_WITH_COMMENTS_FILE}"
# Remove comments by sed to avoid flooding WHOIS servers
grep -v "#" ${outfile_w_comments} | sort | uniq > ${outfile_wo_comments}
grep -v "#" "${BLACKLIST_WITH_COMMENTS_FILE}" | sort | uniq > "${BLACKLIST_FILE}"
# Split blacklist into IPv4 and IPv6
grep ':' "${outfile_wo_comments}" | sort | uniq > "${blacklist_v6_file}"
grep -v ':' "${outfile_wo_comments}" | sort | uniq > "${blacklist_v4_file}"
grep ':' "${BLACKLIST_FILE}" | sort | uniq > "${BLACKLIST_V6_FILE}"
grep -v ':' "${BLACKLIST_FILE}" | sort | uniq > "${BLACKLIST_V4_FILE}"
echo "✓ Generated blacklist files"
echo " Mixed (IPv4/IPv6): ${outfile_wo_comments} ($(wc -l < "${outfile_wo_comments}" | tr -d ' ') entries)"
echo " IPv4 only: ${blacklist_v4_file} ($(wc -l < "${blacklist_v4_file}" | tr -d ' ') entries)"
echo " IPv6 only: ${blacklist_v6_file} ($(wc -l < "${blacklist_v6_file}" | tr -d ' ') entries)"
echo " Mixed (IPv4/IPv6): ${BLACKLIST_FILE} ($(wc -l < "${BLACKLIST_FILE}" | tr -d ' ') entries)"
echo " IPv4 only: ${BLACKLIST_V4_FILE} ($(wc -l < "${BLACKLIST_V4_FILE}" | tr -d ' ') entries)"
echo " IPv6 only: ${BLACKLIST_V6_FILE} ($(wc -l < "${BLACKLIST_V6_FILE}" | tr -d ' ') entries)"