Today at 7:59am, Synthetic Cartoonz wrote:
On Thursday 09 June 2005 01:31, Jim Cunning wrote:
[....] Both fping and 'ping -b' must be run as root. 'nmap -sP <IP-range>' can be run as an ordinary user.
I was able to run ping -b as root and a regular user. (??) Perhaps it's because ping is installed setuid root. It is on my 9.1Pro:
-rwsr-xr-x 1 root root 31236 2004-04-05 18:05 /bin/ping* I wasn't aware of that. Curious, I checked the ping man page to find that it doesn't mention anything about root being required for '-b' broadcast pings. However, ping is clearly aware of the user id, and will refuse to do a flood ping (-f) for a normal user.
Oddly, nothing on my network responds. I know the file server(99), the router(12), and the network printer (101) are all turned on. Direct pings work.
I think many IP stacks will ignore broadcast pings, though it may be an option for some. I don't remember where I've seen reference to that, however. My home network exhibits this [with my comments]: jcunning@jlc:~> ping -b 192.168.1.255 WARNING: pinging broadcast address PING 192.168.1.255 (192.168.1.255) 56(84) bytes of data. 64 bytes from 192.168.1.254: icmp_seq=1 ttl=64 time=5.61 ms [...] 64 bytes from 192.168.1.254: icmp_seq=5 ttl=64 time=0.830 ms --- 192.168.1.255 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4000ms rtt min/avg/max/mdev = 0.827/1.788/5.615/1.913 ms [Note only one address responded to broadcast pings above, but there are actually 5 active hosts.] jcunning@jlc:~> nmap -sP 192.168.1.0-255 Starting nmap 3.50 ( http://www.insecure.org/nmap/ ) at 2005-06-09 11:13 PDT Host 192.168.1.1 appears to be up. [A Netgear print server] Host 192.168.1.6 appears to be up. [My SuSE 9.1 workstation] Host 192.168.1.56 appears to be up. [VmWare running Win2K on Linux] Host 192.168.1.58 appears to be up. [My wife's Win2K system] Host 192.168.1.254 appears to be up. [A Belkin 802.11g Wifi router/bridge] Nmap run completed -- 256 IP addresses (5 hosts up) scanned in 7.048 seconds All this leads me to conclude that nmap is better than broadcast pings, because it actually pings each address individually. Jim