Raw sockets need root priviliege

后端 未结 3 2041
轮回少年
轮回少年 2020-12-18 08:27

Why do we need root privileges when we use raw sockets ?

相关标签:
3条回答
  • 2020-12-18 08:45

    It's because you can spoof custom packets, which may interfere with inbound traffic. This too is also bad.

    0 讨论(0)
  • 2020-12-18 08:45

    In short raw sockets is restricted to root because if it otherwise it would break other rules for networking that are in place.

    A long standing rule is that you cannot bind on a port lower than 1024 without root's blessing. With raw sockets you can simulate a server on any port. (naturally being able to receive on this port is a different story you'd also have to sniff the network, but perhaps this could be done with a different machine.)

    0 讨论(0)
  • 2020-12-18 09:01

    Opening a raw socket allows to read anything that is received in a given interface, so, basically, you can read any packet that is directed to any application - even if that application is owned by another user. That basically means that the user with this capability is able to read any and all communications of all users.

    0 讨论(0)
提交回复
热议问题