Finally we have found a solution to stop DNS Amplification Attacks using pfsense with snort.
The below codes are extracted from raw IP data, as a sample, you may check what we had done for ripe.net query:
0x0000: 4500 0042 6142 4000 7911 e7c3 9a23 a00b E..BaB@.y....#..Use the code below to stop DNS Amplification attacks, you can paste the code to snort interface Advanced configuration pass through section:
0x0010: 5e67 200f 0035 0035 002e 0000 03b8 0100 ^g...5.5........
0x0020: 0001 0000 0000 0001 0472 6970 6503 6e65 .........ripe.ne
0x0030: 7400 00ff 0001 0000 2910 0000 0080 0000 t.......).......
0x0040: 0000 ..
alert udp $EXTERNAL_NET any -> $HOME_NET 53 (msg:"DNS ripe.net UDP"; content:"|01 04 72 69 70 65 03 6e 65 74 00|";classtype:attempted-dos;sid:4000003;)The code is tested to have minimal overhead.
alert udp $EXTERNAL_NET any -> $HOME_NET 53 (msg:"DNS isc.org UDP"; content:"|01 03 69 73 63 03 6f 72 67|";classtype:attempted-dos;sid:4000003;)
Please post your comment if you need additional DNS Amplification Attack rules.