Before the introduction of Linux through the iptables limit UDP contract, this record of Windows 2003 implementation methods.
Create a new Bat script, add the following, and then click Run.
Copy Code code as follows:
: Created by Http://www.jb51.net
:D ROP UDP Flood
@echo off
Cls
: Get DNS Address
For/f "delims=: tokens=1,2"%%a in (' Ipconfig/all ^|findstr/i ' DNS Server ') does (
Set Dnsip=%%b
)
: New IP installation policy prohibit UDP
netsh ipsec static add policy name= prohibit UDP description= allow DNS, deny other UDP outgoing
: New IP Security rule
netsh ipsec static add filterlist name= allow UDP
netsh ipsec static add filterlist name= deny UDP
: New IP Filter
netsh ipsec static add filter filterlist= allows UDP srcaddr=me dstaddr=%dnsip% description= allow DNS queries PROTOCOL=UDP Mirrored=yes D stport=53
netsh ipsec static add filter filterlist= deny UDP srcaddr=me dstaddr=any description= prohibit UDP outgoing PROTOCOL=UDP mirrored=yes
: New IP filter action
netsh ipsec static add filteraction name= allows DNS queries Action=permit
netsh ipsec static add filteraction name= rejects UDP outgoing Action=block
: Encapsulating policies
netsh ipsec static add rule name= Allow rules policy= disable UDP filterlist= allow UDP filteraction= allow DNS queries
netsh ipsec static add rule name= deny policy= prohibit UDP filterlist= deny UDP filteraction= deny outgoing
: Apply IP Security Policy
netsh ipsec static set policy name= prohibit UDP assign=y