Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Unexpected results from ping

by Rhose (Priest)
on Mar 04, 2003 at 15:15 UTC ( [id://240371]=note: print w/replies, xml ) Need Help??


in reply to Re: Unexpected results from ping
in thread Unexpected results from ping

By default Net::Ping uses a different method of determining a host's status (TCP echo) than the 'ping' utility (ICMP echo) because doing ICMP echo on unix systems requires root privileges to open a so-called "raw socket".

It does not take root privileges to create an ICMP echo request... you can test it yourself by logging in as a non-root user and playing with the "ping" program. Maybe you have confused this with putting the network card in promiscuous mode which is required for programs like tcpdump?

Update You know, xmath I never noticed that ping was setuid to root, so that, indeed, was a poor example. *Smiles*

Update 2 Ok, so I went back through all my crafted packet code, and I can not find a single example of being able to craft an ICMP packet without being root. With that said, it does indeed seem that xmath was correct.

Replies are listed 'Best First'.
Re: Re: Re: Unexpected results from ping
by xmath (Hermit) on Mar 04, 2003 at 15:19 UTC
    you can test it yourself by logging in as a non-root user and playing with the "ping" program

    The "ping" utility is always setuid root:

    [Quoose:~] xmath% ls -l `which ping` -r-sr-xr-x 1 root wheel 24920 Dec 23 15:17 /sbin/ping

    That's why normal users can use it. :-)

    Update: it seems that lately raw sockets are no longer needed for ICMP on some platforms (Darwin / Mac OS X); but on most (Linux etc) they still are

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://240371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-26 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found