Send complete TCP or UDP packs programmatically

According to OSI Model, data packets will be completed in several layers. Is it possible to send complete TCP or UDP packets (including headers and etc) programmatically.

For example a packet whit custom MAC ADD. and a fake IP for sender (requester)?


Yes. You can put any TCP or UDP packet header if you are sending it using RAW sockets , for which you must have a root access to the system:

sock = socket(PF_INET, SOCK_RAW, IPPROTO_UDP);

Or you can also bypass linux TCP stack and write() and read() with the ethernet card directly.

The problem is, if you use fake ip with TCP, you won't get a response from SYN request because the real ip will reject it or it simply won't be routed back. You can research on this if you query for "ip spoofing" keywords.

Need Your Help

My website appears in Google in a wrong way

html website seo search-engine

I published my first website and I am still trying to solve its problems. I have mainly two questions regarding my website:

Why Birt report plugin removes param entries

grails birt

This could be silly but I dont understand why this code is included on the example:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.