473,388 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Sniffer

Hi ppl.
I'm trying to write a sniffer. I can trace all incoming datagrams but no
outgoing. I don't know how to. Can anyone help on this? Here is a sample
code in C#.

_MainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw,
ProtocolType.IP);

_MainSocket.Bind(new IPEndPoint(address, 0));

_MainSocket.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.HeaderIncluded, true);

_MainSocket.IOControl(IOControlCode.ReceiveAll, new byte[4] { 1, 0, 0, 0 },
new byte[4] { 0, 0, 0, 0 });

_ByteData = new byte[_PacketSize];

_Enabled = true;

_MainSocket.BeginReceive(_ByteData, 0, _ByteData.Length, SocketFlags.None,
new AsyncCallback(OnPacketRecive), null);
Thanks



May 19 '07 #1
2 3207
Kemo wrote:
Hi ppl.
I'm trying to write a sniffer. I can trace all incoming datagrams but no
outgoing. I don't know how to. Can anyone help on this? Here is a sample
code in C#.
I don't think you can do this from outside of the kernel.
You need to write a non-device driver.

Alun Harford
May 20 '07 #2

"Alun Harford" <de*****@alunharford.co.ukwrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
Kemo wrote:
> Hi ppl.
I'm trying to write a sniffer. I can trace all incoming datagrams but
no
outgoing. I don't know how to. Can anyone help on this? Here is a sample
code in C#.

I don't think you can do this from outside of the kernel.
You need to write a non-device driver.

Alun Harford
Thank you. I'll try to write a dll module with C++ and inject it into
kernel. I'll post if succeed.
May 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: AMC | last post by:
Hi, I need to code an asp based browser sniffer. It needs to detect if a browser can support css and if not redirect to a different site. Does anyone have sample code that does this? thx
6
by: billiejoex | last post by:
Hi! I made a little, simple program that sends strings over an ICMP packet. The source here: http://billiejoex.altervista.org/a1.txt Now all I need is create a simple network sniffer able to...
1
by: billiejoex | last post by:
Hi all. I'm trying to make a simple icmp sniffer by using SOCK_RAW. The code below works but ONLY if I first use the sendto() function. Does anybody knows why? Regards from socket import *...
0
by: billiejoex | last post by:
Hi all. The source below is a simple icmp sniffer made with pcapy. To decode packets I'm using the EthDecoder() function that returns a rapresentation of the packet including ICMP type, ICMP code,...
5
by: David Baker | last post by:
Hi all I am very new to ASP.Net. I am trying to create a sniffer for our program. We want our users to click our sniffer and hopefully the sniffer will check their computer against our...
2
by: Laurent Laporte | last post by:
hello, I'm using cvs standard module under Python 2.3 / 2.4 to read a CSV file. The file is opened in binary mode, so I keep the end of line terminator. It appears that the csv.Sniffer force...
2
by: kali | last post by:
this is kali a new member to this forum.. iam an undergrad studd and wrking with a opacket sniffer to capture data transmitted using a hardware... the file saved in the sniffer is a binary file...
4
by: cHacker | last post by:
Hello, there are some ICQ sniffers available on Internet, i am curious about how to get ICQ talk(text)? someone has any idea to get the icq talks(texts)? thanks
4
by: chazzy69 | last post by:
Hello i am a little new c++, i know most of the basics now and im interest in making a sniffer for my router to see any and all connections made to the router from the outside world, my router does...
0
by: showellshowell | last post by:
Hi everybody, I'm looking for a very simple HTTP debugging sniffer in Python-- hopefully 200 lines of less--that allows me to write simple methods to inspect requests and responses. It would...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.