0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DNSリクエストの再帰、非再帰問い合わせを iptables で判定して DROPする

Last updated at Posted at 2014-10-06

IPv4のDNS udpパケットの再帰、非再帰問い合わせのRDフラグは、
31byte目にあるので下記で実現できた。

最初の 20byte は ipヘッダ、
その次の 8byte は udpヘッダ

特定のネットワークからの再起問い合わせをタイムアウトさせたい時に使う。

1.非再帰問い合わせの DROP
-A INPUT -m string --hex-string "|00000001|" --algo bm --from 30 --to 34 -p udp --dport 53 -j DROP

2.再帰問い合わせの DROP
-A INPUT -m string --hex-string "|01000001|" --algo bm --from 30 --to 34 -p udp --dport 53 -j DROP



0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?