Send spoofed TCP/UDP packets

Sep 6, 2011 at 11:09 PM


I have seen the example on this website to "Send" packets. But the code isn't working at all.
As well normal packets and buffers.
When the program is ran, It sort of freezes or does nothing.

Not a single packet is send to the IP that I want.

Any help on this?

Thanks in advance!

Sep 7, 2011 at 11:09 PM


It was this code that I was using. And yes I did reference everything well.
You could try it yourself, it looks like that code isnt working.

Sep 10, 2011 at 6:50 AM
Edited Sep 10, 2011 at 6:51 AM

Hi qwerz,


Have you downloaded the Developer's pack and tried to run this example from there?

Can you try and give more details on what part doesn't work for you?





Sep 10, 2011 at 6:29 PM

Hi Brickner,

Thanks for your reply.

I tried using the sendbuffer from the Developer's pack. But at first when opening, it already gave in Microsoft VC# some error. And after I opened the debug version
It opened a black box and closed within a second.

It just doesn't send a packets. So it looks like its not working, when I make the code myself, the program freezes.


Sep 15, 2011 at 9:23 PM

Ah see this forum only used by brickner and me :P

Though, I hope my problem will be resolved as I want to use pcapdotnet and im sure that im not the only one that has problems with the above described problem.
So if it could be point out here it would be nice.


Perhaps a sample project that just sends bufferpackets (load) to an IP. Because the example source is not working for me. [Currently on Windows7 x84][ IDE, and the other needed 2/3 libraries /software are installed]

Sep 16, 2011 at 8:00 AM

Hi qwerz,


What kind of Microsoft VC# error do you get?

Make sure you've followed the 'using Pcap.Net in your program' section exactly in the Pcap.Net User Guide.

Also, make sure you open the Developers pack solution.

If the developers pack doesn't work, we must focus on that.



Sep 16, 2011 at 1:14 PM


There is no VC error. The program just opens but does nothing and freezes. (Im using Visual 2010)

I followed exactly the guide and also tried the cevelopers pack. That pack gives the same problem.

Sep 17, 2011 at 11:45 AM

Can you run it in Debug mode and break it when it freezes to see where it freezes?

Also, what project are you running in the Developer's pack?

Feb 5, 2012 at 10:07 AM

I've also used this example, how ever it all worked for me and I was able to "send" the packet (as can be seen from WireShark) how ever, the IP I send it to doesn't receive my packets. (I've had WireShark opened on my destination as well).

The ports are open since I can manually connect to the destination with ease. Do you know what may be the issue?

Feb 10, 2012 at 10:03 AM

It depends how the two computers are connected.

Some routers or other network devices will identify and filter out packets that come from spoofed IPs.

You should try to see if the packets don't get to their destination only when the source IP is spoofed or is it because some other cause.


I hope this helps,



Feb 11, 2012 at 11:59 PM
Edited Feb 12, 2012 at 1:58 AM

I was able to spoof to an IP address near my current one. For example, lets say my IP was, I would be able to spoof to, but not

Do you know why it's like this?

Feb 12, 2012 at 4:55 PM

It looks very reasonable to me to assume that some network device is aware that traffic coming from some connection is suppose to be in some IP range and so it throws anything that is not from that range.


I hope this helps,



Feb 13, 2012 at 6:18 PM
Edited Feb 13, 2012 at 6:19 PM

I did  this test without a router connected (directly via cable modem) while sending packets to my server.

Is there a better way to test if all packets are being received to a destination server?

Could I set this up in reverse (e.g. my desktop be the server, with my server being the client receiving it?)
If there's another setup I could do, I'm open for recommendations :D

Thanks, Zirak.

Feb 17, 2012 at 2:54 PM

Between your cable modem and the server there are probably routers, not necessarily yours.

Wireshark is a good way to check if the packets are received.

I'm not sure what are you trying to achieve with the setup, it makes sense that spoofed packets are filtered if the router can tell that they are spoofed.