问题定位排查手记1 | 从Windows端快速检查连接状态
背景:目标是验证Windows是否有出站限制,快速排查问题。(Windows与Kali两个虚拟机之间可以ping通,但是没有交互式shell的命令行提示符。)
Test-NetConnection检查网络连接情况,Get-NetFirewallProfile检查防火墙状态。
Test-NetConnection
检查网络连接状态
Test-NetConnection用于测试网络连接情况,包括ping, TCP端口连接、路由跟踪
Test-NetConnection 192.168.xxx.xxx -Port 1111
- ping 使用的是ICMP协议,ping通不代表能成功建立tcp连接;
- 详细使用可以参考:Test-NetConnection 命令概述-CSDN博客
Get-NetFirewallProfile
检查防火墙状态
# 检查防火墙状态
Get-NetFirewallProfile | Format-Table Name, Enabled# 临时禁用防火墙(测试用)
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False