[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sockets



> well the problem is with an igmp c program i have, the strace shows:
> 
> socket(PF_INET, SOCK_RAW, IPPROTO_IGMP) = -1 EPERM (Operation not permitted)
> fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
> = 0x40014000
> ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
> write(1, "Could not allocate socket.\n", 27Could not allocate socket.
> ) = 27
> munmap(0x40014000, 4096)                = 0
> _exit(1)                                = ?
> 
> so im assuming a "raw socket" is a udp socket? and that you need root

You are not allowed to open a raw socket on Linux as non-root, I don't
know if it's different on Solaris (but I would expect it not to be). And
no that's not an UDP socket, it says something about IGMP (Internet Group
Managment Protocol, which is used for Multicast I think).

> priviledges for udp sockets? (simalar to why you cant run nmap udp scans
> unless you're root).

No, that is also because of Raw sockets in general. There is no reason why
you can't use UDP sockets... just not raw sockets. That's why nmap won't
work for, UDP, TCP and probably not even Ping (it uses rawsockets to
send out very specific packets, well I guess you know).

> 
> am i on the right track?

Eventually. :)

> 
> Regards,
> 
> Marc-Adrian Napoli
> Network Admin
> Connect Infobahn Australia
> +61 2 9212 0387



Reply to: