by binaryturtle · 3mo ago · 0 comments
You'll see a lot of deepfield, censys-scanner, visionheight.com, shadowserver.io, etc., but also the usual suspects of Chinese or Russian IPs.
With OpenWRT I use something like this: `tcpdump -i pppoe-wan 'inbound and tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn'`, or alternatively `tcpdump -i pppoe-wan 'inbound and tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn and not port 44000'`, if we have some torrent client running (e.g. here at port 44000) which would mess up the result. I'm not sure it's the best way to handle this, but it's definitely enlightening what bounces off on the router.
Sure their packets will still hit your router, but if they are dropped immediately at least you're not wasting a syn-ack on them.
Keep in mind that this should be paired with an ASN blacklist - MaxMind also has an ASN mmdb for convenience - because IP address to country maps are almost entirely self-declared[0].
For example, Tencent (AS132203), which you almost certainly want to block, has ranges in 73 different countries per [1].
Thanks in advance.
Your firewall vendor should supply you with country lists, just select the known bad ones and drop their traffic. If you have a consumer grade router, you will probably have to configure the blocklists manually.
ISPs sometimes do trade IPv4 blocks and countries to which it belongs do change occasionally. That can become a problem if you were like literally Netflix and someone few nation states over started an ISP.
Here is a "simplified" version in various formats.
Why not just block all the inbound connections you don't need? Is there a particular reason your firewall policy needs to be xenophobic?
(You still could get poked from the other users' hosts behind the ISP's NAT, of course.)