LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-26-2007, 02:21 AM   #1
flukebox
LQ Newbie
 
Registered: Jun 2007
Posts: 2

Rep: Reputation: 0
Capturing, modifying and injecting packets


Hi all,
I want to capture packets which are being sent by an application from my own machine and i want to capture them before they actually go to wire. What i want to do like ...i want to capture the Ipv4 packet sent by my applications to some special address ( like some subnet 10.0.0.1/24 ) and drop the packet from being sent on wire. Then modify that to Ipv6 packet ( by doing some map Ipv4 -> Ipv6) and Then put the modified Ipv6 packet into the kernel queue ...for routing stuff.
Currently, I tried with Raw-sockets with 'PF_PACKET' flag but that doesn't work out. By Raw-sockets, I am actually able to capture packets which are on the wire but not which i was intend to capture ?

Any help would be appreciated !

thanks in advance,
flukebox
 
Old 07-03-2007, 07:27 AM   #2
flukebox
LQ Newbie
 
Registered: Jun 2007
Posts: 2

Original Poster
Rep: Reputation: 0
okk, i am able to capture packet by libpcap interface. but the problem i am facing now is that i am only able to send packet directly on the wire. but i want the packet to be send such that it goes through kernel. any idea, how can put modified packet to kernel networking stack queue ???
-- flukebox
 
Old 07-03-2007, 08:07 AM   #3
jopu
LQ Newbie
 
Registered: Mar 2007
Posts: 8

Rep: Reputation: 0
hmm... I think iptables can come in handy for your problem, though I don't know the exact filters/mangle you may need to write.

ip6tables will capture packets and modify them and put them back to the kernel Q.
 
  


Reply

Tags
hack, kernel, packet



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Injecting packets ...sockets?? bhupeshchawda Linux - Networking 0 03-24-2007 11:31 PM
Capturing a Socket and Injecting a Packet Chryzmo Programming 5 12-07-2005 01:17 AM
Capturing packets from my WAN/Router {O_o} Linux - Security 4 10-12-2005 04:56 PM
VoIP Packets capturing in linux fastian Linux - Networking 1 03-25-2005 11:34 AM
capturing ethernet packets shrike_912 Programming 5 08-02-2004 01:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration