#!/bin/sh

iptables -N LOGGER

iptables -I INPUT 1 -s 192.168.0.0/24 -j LOGGER

iptables -I LOGGER  -p tcp --dport 53 -j LOG --log-prefix="DNS  :"
iptables -I LOGGER  -p udp --dport 53 -j LOG --log-prefix="DNS:  "

iptables -I LOGGER  -p udp --dport 67 -j LOG  --log-prefix="DHCP:  "

iptables -I LOGGER  -p tcp --dport 88 -j LOG --log-prefix="Kerberos:  "
iptables -I LOGGER  -p udp --dport 88 -j LOG --log-prefix="Kerberos:  "

iptables -I LOGGER  -p tcp --dport 135 -j LOG --log-prefix="RPC:  "

iptables -I LOGGER  -p udp --dport 137 -j LOG  --log-prefix="NetBIOS:  "

iptables -I LOGGER  -p udp --dport 138 -j LOG --log-prefix="Group Policy:  "

iptables -I LOGGER  -p tcp --dport 139 -j LOG --log-prefix="NetLogon:  "

iptables -I LOGGER  -p tcp --dport 389 -j LOG --log-prefix="LDAP:  "
iptables -I LOGGER  -p udp --dport 389 -j LOG --log-prefix="LDAP:  "

iptables -I LOGGER  -p tcp --dport 445 -j LOG --log-prefix="SMB: "
iptables -I LOGGER  -p udp --dport 445 -j LOG --log-prefix="SMB :"

iptables -I LOGGER  -p tcp --dport 464 -j LOG --log-prefix="Kerberos pswd:  "
iptables -I LOGGER  -p udp --dport 464 -j LOG --log-prefix="Kerberos pswd:  "

iptables -I LOGGER  -p udp --dport 2535 -j LOG  --log-prefix="DHCP:  "

iptables -I LOGGER  -p tcp --dport 5722 -j LOG --log-prefix="SYSVOL:  "

iptables -I LOGGER  -p tcp --dport 9389 -j LOG --log-prefix="SOAP:  "


iptables -D eth0-root -j DROP
iptables -N LOGGER_DROP
iptables -I LOGGER_DROP -j DROP
iptables -I LOGGER_DROP -j LOG --log-prefix="DROPPED:  "
iptables -A eth0-root -j LOGGER_DROP

