开发者

Why does ping work without administrator privileges?

开发者 https://www.devze.com 2023-04-11 23:33 出处:网络
as you may know one is unable to create RAW sockets using Windows Sockets without having administr开发者_高级运维ative priviliges. The problem is, that I need to send ICMP messages, thus I need RAW so

as you may know one is unable to create RAW sockets using Windows Sockets without having administr开发者_高级运维ative priviliges. The problem is, that I need to send ICMP messages, thus I need RAW sockets. The Problem: My program needs to run without administrative privileges.

That lead me to the question, how does the ping tool send ICMP messages w/o administrative privileges?


Although ICMP uses RAW sockets (which require admin rights on Win2K and later), Microsoft circumvents its own security rules to allow its ICMP APIs to get through. As such, don't use RAW sockets directly to send your own ICMP ping messages. Use IcmpSendEcho() and related functions instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号