LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-26-2006, 04:54 PM   #1
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Rep: Reputation: 30
Smile packet capture and modification


Where should I look, or what library should I use to create a program in C that would capture packets, and be able to modify them, drop packets, or forward them?


Thanks
 
Old 02-26-2006, 06:40 PM   #2
oulevon
Member
 
Registered: Feb 2001
Location: Boston, USA
Distribution: Slackware
Posts: 438

Rep: Reputation: 30
To capture packets, take a look at libpcap.
 
Old 02-26-2006, 06:41 PM   #3
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843

Original Poster
Blog Entries: 1

Rep: Reputation: 30
would it permit me to alter the packets?
 
Old 03-13-2006, 06:15 PM   #4
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843

Original Poster
Blog Entries: 1

Rep: Reputation: 30
Let me rephrase my question:
How can I drop, forward, and otherwise intercept packets?

I want to make a program that would intercept packets, and when it sees the need, it could drop those packets, forward them, modify them, and do all sorts of things to those packets.

thanks
 
Old 03-13-2006, 08:34 PM   #5
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Take a look at www.netfilter.org. The best way to intercept/modify packets would be at the linux kernel with the netfilter API, unless you wanna reinvent the wheel and do it with libpcap/libnet with forwarding disabled so you must do all the routing stuff too.
 
Old 03-13-2006, 09:00 PM   #6
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843

Original Poster
Blog Entries: 1

Rep: Reputation: 30
thanks! that's the answer I was looking for!

thanks primo
 
  


Reply



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
how do i read the data in the packet that i have captured after packet capture? gajaykrishnan Programming 23 04-19-2006 05:09 AM
Ethereal Packet capture Help sucram2g Linux - Networking 2 07-20-2005 12:35 PM
How to capture network packet jerrytw Programming 1 01-06-2005 10:28 AM
ICMP Packet capture SaTaN Programming 1 01-19-2004 11:38 PM
Network packet capture avaya Linux - Newbie 2 10-14-2002 09:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:53 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