All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Taylor <williamt@corp.sonic.net>
To: netfilter@vger.kernel.org
Subject: reading positions with the u32 module
Date: Thu, 24 Apr 2014 09:24:25 -0700	[thread overview]
Message-ID: <53593AB9.6030706@corp.sonic.net> (raw)

I'm trying to find out if it's possible to read a value from a packet
and skip forward by that amount and start processing the packet from
that offset.
I tried something like this where 28&0xFF was the position where I
wanted to read my value from but couldn't seem to get it to work.

0>>22&0x3C@28&0xFF000000>>@0&0xDFDFDFDF=0x464F4F4F

For a little more context I'm trying to do this so I can block dns
requests that have random hostnames prepended to the domain. The idea being
I can generate a rule that matches the domain and it will work with
whatever hostname is attached to it.

Read 0x03 jump 3 bytes forward then start matching on 0x04666F6F6F0x03636F6D
www.fooo.com : 0x037777770x04666F6F6F0x03636F6D00


Is this possible?  Any help would be appreciated.


Thanks,
  William

                 reply	other threads:[~2014-04-24 16:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=53593AB9.6030706@corp.sonic.net \
    --to=williamt@corp.sonic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.