I was wondering if anyone could point me a good linux socket tutorial that will give me the basics on how to create my own crafted packets. Try not to get the wrong idea, this is purely because I want to satisfy my own curiousity. I do have SOME experience with C as well as other random programming languages. Programming has always been a tough subject for me to grasp as it takes a lot of abstract lines of thinking and isn't always as logical as many people make it.
So by saying that, direct me towards a tutorial that doesnt assume a lot and has applicable examples. Thanks in advance for whomever can find me one.
"He who breaks something to find out what it is, has left the path of wisdom."
I thought myself a few languages, but then I lost interest, maybe I was learning from the wrong place because I couldn't relate what I was learning to what I wanted to do. Programming isn't for everyone. Some are born programmers, it comes easy to some, and some struggle to learn it.
In my opinion, for c/c++ its good to learn the purposes and functions of a good quantity of header files, because most c/c++ tutorials only tell you about the basic ones, and not those that you can do "cool" things with. Checking out a book in the library is also a good idea, I used Teach Yourself C++ in 21 Days.
Hope that helps
::::Gees, the guy asks a simple question and I answer him in essay form :-p :::::
Linux socket programming in C is 99% the same as in Windows, don't use any of the functions starting with WSA (you wont need WSAstartup, WSAsocket etc), your basic functions will be exactly the same :
The packet structures are also still the same
As far as the header files go, you'll want to include
Just grab yourself the code for any small client-server application and you'll understand instantly.
Since you're talking about crafting your own packets you will have to use SOCK_RAW when you declare the socket. Then you will have to create structures for the IP header and TCP header and fill these up with the values you want.
If you need more help, let me know I will post sample code for you to get started.