Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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.


Comment on Re: Re: Unexpected results from ping
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
Node Status?
node history
Node Type: note [id://240371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (14)
As of 2014-09-30 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (381 votes), past polls