0

Why does busybox ping expect root?

$ ping dec.com -c1
PING dec.com (216.239.32.21) 56(84) bytes of data.
64 bytes from any-in-2015.1e100.net (216.239.32.21): icmp_seq=1 ttl=119 time=54.9 ms

--- dec.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 54.855/54.855/54.855/0.000 ms
$ busybox  ping dec.com -c1
PING dec.com (216.239.34.21): 56 data bytes
ping: permission denied (are you root?)
2
  • ping always requires root. Usually it's setuid.
    – user253751
    Mar 29, 2022 at 20:10
  • @user253751: Linux added unprivileged IPPROTO_ICMP sockets a few years ago, but apparently Busybox hasn't learned about those yet. (iputils' ping no longer requires root.) Mar 30, 2022 at 5:36

1 Answer 1

1

If it was the external version, it should work as long it has CAP_NET_RAW capability or setuid, but in this case, busybox's ping is built-in so you must run busybox as root.

You could try executing the external version if it exists, /usr/bin/ping or /bin/ping.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .