blob: 3cac4ce8e5cd72a07a3732a50315a784526f89b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
For example:
root@pc:~# chmod 0755 /bin/ping
root@pc:~# setcap 'cap_net_raw=ie' /bin/ping
root@pc:~# su menno
menno@pc:/root$ ping -c1 www.zonnet.nl
ping: icmp open socket: Operation not permitted
menno@pc:/root$ exit
root@pc:~# cage -u 1000 -c 'cap_setuid=pe cap_net_raw=pie' / /bin/sh
menno@pc:/$ ping -c1 www.zonnet.nl
PING www.zonnet.nl (62.58.50.202) 56(84) bytes of data.
64 bytes from www.tele2.nl (62.58.50.202): icmp_seq=1 ttl=116 time=27.0 ms
--- www.zonnet.nl ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 27.054/27.054/27.054/0.000 ms
menno@pc:/$ /sbin/getpcaps $$
Capabilities for `7242': = cap_net_raw+i
menno@pc:/$ exit
|