Having set up a Windows 2000 PC I observed packets leaving the LAN, out
through the firewall/gateway to an IP address to a university in Korea.
Whereas it comes as little surprise that Win2k has trojans right out of the
box what I want to do now is block the outgoing packets.
I use iptables and my configuration is as follows:
---------------------------------------------------
# set the standard stuff
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -o eth1 -j SNAT --to-source 203.97.251.40
COMMIT
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
# -A FORWARD -p tcp ! --syn -m state --state NEW -j DROP
# -A FORWARD -m state --state INVALID -j DROP
#### Host specific
-A INPUT -s 67.19.44.116/255.255.255.255 -j DROP
-A INPUT -s 61.145.116.86/255.255.255.255 -j DROP
-A INPUT -s 202.101.119.196/255.255.255.255 -j DROP
-A INPUT -s 200.49.242.35/255.255.255.255 -j DROP
-A INPUT -s 210.208.183.55/255.255.255.255 -j DROP
# Network specific
# akamai networks
-A INPUT -s 203.167.251.247/255.255.255.255 -j DROP
# sucking data from ms machines
-A INPUT -s 165.246.99.95/255.255.255.255 -j DROP
-A INPUT -s 221.9.142.91/255.255.255.255 -j DROP
# senders of viruses in junkmail
-A INPUT -s 61.246.18.251/255.255.255.255 -j DROP
# Tell Yahoo's robot to fuck off
-A INPUT -s 216.136.232.41/255.255.255.255 -j REJECT
COMMIT
---------------------------------------------------------
You can see the #sucking data stuff, well that only stops connections from
the machines that otherwise receive unauthorised packets. How do I block
the packets from leaving the LAN to begin with? Like, can I use "!" to mean
the reverse, like this:
-A INPUT -s ! 165.246.99.95/255.255.255.255 -j DROP
or could I go:
-A OUTPUT -s 165.246.99.95/255.255.255.255 -j DROP
--
Regards,
Peter.
http://www.pelicom.net.nz