On Mon, 25 Nov 2002, fooler wrote:

> ok... ill give you a sample code and hoping that you will use it for good
> intentions and for educational purposes only... remember you have to be as
> root user in order raw socket to work...
>
> rawsocket.c
>
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
>
> int main(void) {
>     int sockd;
>
>     sockd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
>
>     return (0);
> }
>

This will compile but this raw socket will not be of any use unless you
fill in the header, checksum and payload (if applicable). As I said,
creating raw socket is easy. The big problem is the content of the raw
socket. See nmap source code or the ping example in UNP by Stevens.

rowel

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to