Skip to contentSkip to conversation

Help with program that changes DHCP payload

NFQUEUE Vincent Arniego 1 participant 1 message Jan 31, 2008

lore
Share & tools
lore
#0 lore raw

Yup checked it out, I got the netfilter flow.

I put a nfqueue program in the prerouting and in the input, filter table I was able to see the modified packet.

The DHCP server resides on the same server as the firewall so I manipulate the incoming packets. I experimented with just changing the TOS after looking at the ipq_client.c program. And I was able to see the change in the input filter.

I'm going to check the program further.
I'm not sure a relay server is feasible at the current setup. That's why I'm sorting to this pseudo option 82 solution.

----- Original Message ----
From: Ashok Rao <[email protected]>
To: Vincent Arniego <[email protected]>; [email protected]
Sent: Wednesday, January 30, 2008 9:28:16 PM
Subject: Re: [NFQUEUE] Help with program that changes DHCP payload

Have
you
looked
at
the
Figures
in
Oskar
Andersson's
tutorial
on
iptables
(available
through
a
link
on
www.netfilter.org)
-
they
show
the
sequence
of
tables
and
chains
which
are
encountered
by
a
packet
on
it's
way
in,
out,
or
when
forwarded.
IMHO
that
tutorial
is
mandatory
reading
for
anyone
trying
to
work
seriously
with
iptables.

From
your
email
below,
I
couldn't
make
out
if
your
program
was
accepting
packets
or
sending
out
packets
-
if
indeed
you
are
capturing
incoming
packets
-
modifying
them
and
them
sending
it
to
the
DHCP
process
on
the
same
machine
-
ethereal
will
never
see
the
modified
packets
-
unless
you
are
sending
them
back
on
the
wire
again.

Ashok

On
Jan
29,
2008
10:58
PM,
Vincent
Arniego
<[email protected]>

Quoted 4 lines · wrote:

Hi
Everyone,

Quoted 2 lines

I'm
kinda
new
here
and
I
would
like
some
help
regarding

Quoted 1 line

netfilter_queue.
If
this
is
asked
already,
forgive
me
I
didn't
see
it
in
the
archives.

Quoted 2 lines

I'm
making
a
program
that
changes
the
value
of
an
attribute
in
the
DHCP

Quoted 1 line

payload.

Quoted 1 line

I'm
using
nfqueue
to
intercept
the
packet,
change
the
content
of
the

Quoted 1 line

payload
and
resend
it
again
to
DHCP

Quoted 1 line

which
resides
in
the
same
server
as
the
firewall.
Why
am
I
doing
this?

Quoted 1 line

I'm
making
a
pseudo
option
82
using
a
translated
bridge
(which
the
mac

Quoted 1 line

is
unchangeable)
but
I'm
using
the
hostname
attribute
instead.

Quoted 2 lines

So
far,
I
was
able
to
change
the
content
of
the
hostname
attribute
of

Quoted 1 line

the
payload,
and
I
checked
the
packet
again

Quoted 1 line

just
to
be
sure
its
sending
the
correct
content.
I
use
nfq_set_verdict

Quoted 1 line

to
resend
the
packet
with
the
modified
payload.

Quoted 2 lines

But
it
didn't
work.

Quoted 2 lines

The
next
thing
is
did
*just
to
be
sure
is
just
changing
the
TTL
value

Quoted 1 line

of
the
IP
header,
then
resending
again,
but
it
seems
its
not
working.
I

Quoted 1 line

used
ethereal
to
capture
the
packets
that
are
coming
in
after

Quoted 1 line

modification.
And
yes
I
checksummed
it.

Quoted 2 lines

These
are
my
questions:

Quoted 2 lines

1.
My
firewall
rule
to
intercept
the
packets
is
in
the
PREROUTING

Quoted 1 line

chain,
mangle
table.Is
this
the
correct
way?

Quoted 1 line

2.
The
packets
that
are
captured
by
ethereal,
are
these
the
packets

Quoted 1 line

before
modification
or
after?
(just
to
be
sure
I'm
looking
it
the
right

Quoted 1 line

way)

Quoted 1 line

3.
What
can
I
do
to
verify
if
the
packets
are
indeed
modified?

Quoted 2 lines

If
anyone
need
a
snippet
of
the
code,
for
everyone,
I'll
just
send
it

Quoted 1 line

in
a
reply
email.

Quoted 2 lines

Thanks
in
advanced
guys.

Quoted 5 lines

____________________________________________________________________________________

Quoted 1 line

Looking
for
last
minute
shopping
deals?

Quoted 1 line

Find
them
fast
with
Yahoo!
Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Quoted 1 line

-

Quoted 1 line

To
unsubscribe
from
this
list:
send
the
line
"unsubscribe
netfilter"
in

Quoted 1 line

the
body
of
a
message
to
[email protected]

Quoted 1 line

More
majordomo
info
at
http://vger.kernel.org/majordomo-info.html

Quoted 1 line
Signature · 26 lines
Ashok 
Rao

Great 
Arbor 
Communications
8818 
Tallyho 
Trail
Potomac, 
MD
Tel: 
301-547-3483
Cell: 
703-989-6494
email: 
[email protected]
www.greatarbor.com





      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping