为什么在没有管理员特权的情况下ping可以正常工作? [英] Why does ping work without administrator privileges?

查看:84
本文介绍了为什么在没有管理员特权的情况下ping可以正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可能知道,如果没有管理权限,就无法使用 Windows套接字创建RAW套接字.问题是,我需要发送ICMP消息,因此需要RAW套接字.问题:我的程序需要在没有管理员权限的情况下运行.

这使我想到一个问题, Ping工具如何在没有管理权限的情况下发送ICMP消息?

解决方案

尽管ICMP使用RAW套接字(在Win2K及更高版本上需要管理员权限),但是Microsoft规避了自己的安全规则以允许其ICMP API通过.因此,请勿直接使用RAW套接字发送自己的ICMP ping消息.代替使用 IcmpSendEcho() 和相关功能.

as you may know one is unable to create RAW sockets using Windows Sockets without having administrative 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.

这篇关于为什么在没有管理员特权的情况下ping可以正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆