Skip to content

Instantly share code, notes, and snippets.

@Ekultek
Created August 9, 2018 18:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ekultek/f2e018c1e8bc068c40ca0e0db732c7ca to your computer and use it in GitHub Desktop.
Save Ekultek/f2e018c1e8bc068c40ca0e0db732c7ca to your computer and use it in GitHub Desktop.
A script to deny all known Shodan IP addresses
#!/bin/bash
# all known shodan IP addresses
SCANNERIPADDRESSES=$"185.181.102.18
94.102.49.193
94.102.49.190
89.248.167.131
93.174.95.106
185.163.109.66
89.248.172.16
93.174.95.106
216.117.2.180
66.240.205.34
71.6.146.130
80.82.77.139
80.82.77.33
188.138.1.119
159.203.176.62
162.159.244.38
104.131.0.69
104.236.198.48
209.126.110.38
66.240.219.146
198.20.87.96
198.20.87.97
198.20.87.98
198.20.87.99
198.20.87.100
198.20.87.101
198.20.87.102
198.20.87.103
71.6.158.166
71.6.146.185
71.6.146.186
198.20.69.72
198.20.69.73
198.20.69.74
198.20.69.75
198.20.69.76
198.20.69.77
198.20.69.78
198.20.69.79
198.20.69.96
198.20.69.97
198.20.69.98
198.20.69.99
198.20.69.100
198.20.69.101
198.20.69.102
198.20.69.103
198.20.70.111
198.20.70.112
198.20.70.113
198.20.70.114
198.20.70.115
198.20.70.116
198.20.70.117
198.20.70.118
198.20.70.119
198.20.99.128
198.20.99.129
198.20.99.130
198.20.99.131
198.20.99.132
198.20.99.133
198.20.99.134
198.20.99.135
93.120.27.62
66.240.236.119
71.6.135.131
66.240.192.138
71.6.167.142
82.221.105.6
82.221.105.7
71.6.165.200
188.138.9.50
85.25.103.50
85.25.43.94"
function deny() {
sudo ufw deny from $1;
}
function main () {
for line in echo ${SCANNERIPADDRESSES}; do
deny ${line};
done;
sudo ufw reload;
}
main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment