Skip to content

Instantly share code, notes, and snippets.

@wezzels
Last active November 24, 2025 03:32
Show Gist options
  • Select an option

  • Save wezzels/0d0cf97f2af9fd819b5cd71dc226f3cd to your computer and use it in GitHub Desktop.

Select an option

Save wezzels/0d0cf97f2af9fd819b5cd71dc226f3cd to your computer and use it in GitHub Desktop.
IP ranges that continually running password and other scans on my connection.
#!/bin/bash
IP_RANGES=(
"189.84.36.0/24"
"189.84.37.0/24"
"189.84.38.0/24"
"189.84.39.0/24"
"200.229.54.0/24"
"218.0.0.0/8"
"177.0.0.0/8"
"201.0.0.0/8"
"40.82.137.0/24"
"125.0.0.0/8"
"120.0.0.0/8"
"121.0.0.0/8"
"222.0.0.0/8"
"223.0.0.0/8"
"119.0.0.0/8"
"118.0.0.0/8"
"117.0.0.0/8"
"113.0.0.0/8"
"114.0.0.0/8"
"115.0.0.0/8"
"116.0.0.0/8"
"14.0.0.0/8"
"27.0.0.0/8"
"36.0.0.0/8"
"42.0.0.0/8"
"43.0.0.0/8"
"44.0.0.0/8"
"45.0.0.0/8"
"46.0.0.0/8"
"47.0.0.0/8"
"48.0.0.0/8"
"49.0.0.0/8"
"189.0.0.0/8"
"87.0.0.0/8"
"168.228.0.0/16"
"185.242.0.0/16"
"195.154.0.0/16"
"193.163.0.0/16"
"194.120.0.0/16"
"130.61.0.0/16"
"8.137.0.0/16"
"154.82.0.0/16"
"172.71.0.0/16"
"52.229.0.0/16"
"61.0.0.0/8"
"101.0.0.0/8"
"110.0.0.0/8"
"111.0.0.0/8"
"112.0.0.0/8"
"103.0.0.0/8"
"186.0.0.0/8"
"20.150.22.0/24"
)
printf '%s\n' "${IP_RANGES[@]}" | while IFS= read -r IP_CIDR; do
sudo firewall-cmd --zone=public --add-rich-rule="rule family=\"ipv4\" source address=\"$IP_CIDR\" drop" --permanent
done
sudo firewall-cmd --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment