Skip to content

Instantly share code, notes, and snippets.

@Ast3risk-ops
Created May 16, 2025 15:10
Show Gist options
  • Select an option

  • Save Ast3risk-ops/f1420c4cbe3a92aca00428b47f102962 to your computer and use it in GitHub Desktop.

Select an option

Save Ast3risk-ops/f1420c4cbe3a92aca00428b47f102962 to your computer and use it in GitHub Desktop.
Simple script to block Censys's IPv4 scanning subnets in iptables
#!/bin/sh
iptables -A INPUT -s 162.142.125.0/24 -j DROP
iptables -A INPUT -s 167.94.138.0/24 -j DROP
iptables -A INPUT -s 167.94.145.0/24 -j DROP
iptables -A INPUT -s 167.94.146.0/24 -j DROP
iptables -A INPUT -s 167.248.133.0/24 -j DROP
iptables -A INPUT -s 199.45.154.0/24 -j DROP
iptables -A INPUT -s 199.45.155.0/24 -j DROP
iptables -A INPUT -s 206.168.34.0/24 -j DROP
# too lazy to bother with the rest of their IPs, this doesn't really work.
iptables -A INPUT -s shodan.io -j DROP
iptables -A INPUT -s 207.90.244.0/24 -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment