Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
744 views
in Technique[技术] by (71.8m points)

windows - Why does ping work without administrator privileges?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...