Brian R. Bondy
Brian R. Bondy

Reputation: 347606

Lower than low level common bsd sockets

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

Upvotes: 8

Views: 2156

Answers (4)

Steve Moyer
Steve Moyer

Reputation: 5733

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.

Upvotes: 10

Andrew Edgecombe
Andrew Edgecombe

Reputation: 40392

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.

Upvotes: 8

Adam Rosenfield
Adam Rosenfield

Reputation: 400692

You want to use raw sockets. In *nix, you need to be root to be able to create raw sockets. I'm not sure if it's possible in Windows.

Upvotes: 2

Josh Matthews
Josh Matthews

Reputation: 13036

I suspect the nmap sources would be an excellent place to look.

Upvotes: 0

Related Questions