在macOS High Sierra上,可以通过brew install nmap进行nping,并且可以使用:
nping --tcp-connect --count = 1 --dest-port = 443 8.8.8.8
Starting Nping 0.7.70 ( https://nmap.org/nping ) at 2018-04-04 18:46 PDT
libnsock mksock_bind_addr(): Bind to 0.0.0.0:0 failed (IOD #1): Invalid argument (22)
SENT (0.0030s) Starting TCP Handshake > 8.8.8.8:443
RCVD (0.0166s) Handshake with 8.8.8.8:443 completed
Max rtt: 13.790ms | Min rtt: 13.790ms | Avg rtt: 13.790ms
TCP connection attempts: 1 | Successful connections: 1 | Failed: 0 (0.00%)
Nping done: 1 IP address pinged in 0.02 seconds
nping --version
Nping version 0.7.70
请注意macOS回显到stderr的行:
libnsock mksock_bind_addr():绑定到0.0.0.0:0失败(IOD#1):无效
论点(22)
任何聪明的npinger都能解释如何解决此问题?
最佳答案
您需要以root特权运行命令。尝试这个:
须藤nping --tcp-connect --count = 1 --dest-port = 443 8.8.8.8
关于node.js - nmap:ping回stderr,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49662959/