Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Re: Unexpected results from ping

by Rhose (Priest)
on Mar 04, 2003 at 15:15 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://240371]
[johngg]: Yes, must be nearly 30 years ago.
[hippo]: Loudest gig I can recall was Wolfsbane at the Astoria in the early 90s. Head rang for about 3 days afterwards. They were top, though.
[johngg]: My ears are still ringing!
Discipulus was outside The Clash concert in 1985..
[marto]: Wolfsbane , now I'm having flashbacks
[choroba]: Isn't Using PerlPod Creatively rather a meditation?
[choroba]: I don't see a question

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (13)
As of 2017-03-24 12:07 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (301 votes). Check out past polls.