From: Tom <tom@t0mb.net>
To: netfilter@vger.kernel.org
Subject: hex string matching at a negative offset from the end of the packet payload
Date: Tue, 29 Jan 2013 10:10:16 +0000 [thread overview]
Message-ID: <5107A008.90806@t0mb.net> (raw)
Greetings,
I'm trying to match DNS ANY type queries and rate limit them with
iptables. An imperfect way of doing this is in use at the moment:
-A INPUT -p udp -m udp --dport 53 -m string --hex-string "|0000ff0001|"
--algo bm --from 50 --to 65535 -m recent --set --name dnsanyqueryudp
--rsource
-A INPUT -p udp -m udp --dport 53 -m string --hex-string "|0000ff0001|"
--algo bm --from 50 --to 65535 -m recent --rcheck --seconds 60
--hitcount 100 --name dnsanyqueryudp --rsource -j ANYRATELIMIT
What I want is a way of checking the byte which is at a negative offset
from the end of the payload, so I can match only the byte I need. Is
there any mechanism at all by which I can do this?
It's annoying that the query type always comes after the variable length
query in DNS!
Thanks for any help.
Tom.
next reply other threads:[~2013-01-29 10:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 10:10 Tom [this message]
2013-01-29 10:28 ` hex string matching at a negative offset from the end of the packet payload 叶雨飞
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5107A008.90806@t0mb.net \
--to=tom@t0mb.net \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox