Skip to contentSkip to conversation

netfilter + perl payload mangling in userspace

DISCUSSION Trixter aka Bret McDanel 2 participants 2 messages Jul 27, 2009

lore
Share & tools
lore
#0 lore raw

I wanted to modify the payload of packets in userspace, preferably with perl. I have tried to google to find something, encountered some dead links. I have not be able to get the example Net::Divert to work, however it appears that I am not able to divert properly. I cant find any working examples of how to do the iptables command to divert.

Is there any other way to modify the payload of a packet from userspace, preferably with perl?

can someone provide me with a working example of how to do iptables to divert?

I have iptables 1.4.1.1 on eeebuntu (ubuntu base) and a kernel of 2.6.27

Thank you

Signature · 2 lines
Trixter http://www.0xdecafbad.com     Bret McDanel
pgp key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8AE5C721
#1 lore raw
Quoted 9 lines · Trixter aka Bret McDanel

I wanted to modify the payload of packets in userspace, preferably with perl. I have tried to google to find something, encountered some dead links. I have not be able to get the example Net::Divert to work, however it appears that I am not able to divert properly. I cant find any working examples of how to do the iptables command to divert.

Is there any other way to modify the payload of a packet from userspace, preferably with perl?

Quoted 8 lines

can someone provide me with a working example of how to do iptables to divert?

I have iptables 1.4.1.1 on eeebuntu (ubuntu base) and a kernel of 2.6.27

Thank you

Have you tried using NFQUEUE? The queue is provided to 'queue' packets for userspace processing. To use the queue, you'll need the libnetfilter_queue API. Start here:

http://www.netfilter.org/projects/libnetfilter_queue/index.html

If you need more help, let me know.

Michael.