Jump to content

packet sniffer

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
ged25

ged25

    Learning Programmer

  • Members
  • PipPipPip
  • 51 posts
I'm wondering if it is possible to write a packet sniffer in C# using System.Net.Sockets class ?
I want to make it an application that can analyze the packets.
I've heard of wpcap that is an API for this.
Can someone tell me whether it would be better to write it using the Sockets class or use an API like wpcap ?

Thanks..

#2
Guest_h4x_*

Guest_h4x_*
  • Guests
i dont know, but i bet its possible, as everything.
however its not designed to do that, i wonder is windows provide any api for sniffing packets, for linux you have mods, windows? nothing, you can write a driver, but well, its not designed for that. Even if u manage to do it 100% safe it still be wrong.

#3
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
I don't know wtf h4x is trying to say... There are heaps of packet sniffers for Windows.
These links might help you:
Simple Sniffer in C#

CodeProject: A Network Sniffer in C#. Free source code and programming help
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#4
ArekBulski

ArekBulski

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,376 posts
I used to use SharpPcap, it works very nicely. :)
Tamir Gal | SharpPcap tutorial: a step by step guide to using SharpPcap

#5
ged25

ged25

    Learning Programmer

  • Members
  • PipPipPip
  • 51 posts
Thanks for the links. Does anyone know which approach I should take ?
Its possible to write one using SharpPcap (C# wrapper for wpcap) and using Sockets class. I'm a bit confused about which way to go.

#6
ArekBulski

ArekBulski

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,376 posts
For me SharpPcap seems a bit lean than the articles above. But you know, Marwex will say the same thing, so it is your choice. Try making a prototype for one or both of them. Then you can decide which approach to pursue.

#7
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
I won't say a thing. Never used it :D I just googled up some links.
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa