Send ICMP message to my router via. Raw socket

P

Piotrekk

Hi

I have written piece of code to send message to my router.

static void Main(string[] args)
{
Socket mySock = new Socket(AddressFamily.InterNetwork,
SocketType.Raw, ProtocolType.Icmp);

IPEndPoint ep = new
IPEndPoint(IPAddress.Parse("192.168.1.1"), 7);

byte[] asd = new byte[2];
asd[0] = 33;
asd[1] = 44;

mySock.SendTo(asd, ep);
mySock.Close();
}

Problem is that my port sniffer does not detect any traffic when i
compile and run the code.
Do you know why?

PK
 
C

Chris Shepherd

Piotrekk said:
Hi

I have written piece of code to send message to my router.
[...]
Problem is that my port sniffer does not detect any traffic when i
compile and run the code.
Do you know why?

What sniffer are you using?

Chris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top