Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lower than low level common bsd sockets

How do you do low low level sockets in C, example: actually sending a SYN.

like image 775
Brian R. Bondy Avatar asked Sep 24 '08 01:09

Brian R. Bondy


2 Answers

What you actually want is a raw socket ... you can completely control the headers and flags with the raw socket interface, but programming them is much more challenging. Here's a great tutorial to get you started: http://www.cs.binghamton.edu/~steflik/cs455/rawip.txt.

like image 72
Steve Moyer Avatar answered Nov 11 '22 16:11

Steve Moyer


Raw sockets are your friend.

There have been some links to useful information on this question.

Also consult Chapter 25 "Raw sockets" of Steven's "Unix Network Programming"

If you're attempting cross platform code you may find libpcap a useful alternative.

like image 40
Andrew Edgecombe Avatar answered Nov 11 '22 16:11

Andrew Edgecombe