八彩云申明:本文内容由互联网用户贡献,该文观点仅代表作者,本站不拥有所有权,不承担相关法律责任。如发现有侵权/违规的内容,请联系我们info@bacaiyun.com。
11月产品动态
愿携手合作伙伴共生、共创、共赢,致力于降低供应链成本提升运营效率,成为值得产业信赖的合作生态伙伴
了解详情
合作伙伴意见反馈
推广大使邀新奖励
可以通过在线咨询、电话、工单等与我们取得联系,八彩云为您提供专业的服务支持,助力轻松上云。
查看技术文档| ➔ | Windows防火墙是Windows操作系统内置的主机防火墙,配合本地安全策略和组策略,可以有效保护Windows 11系统免受网络攻击。 |
# 通过PowerShell管理防火墙
Get-NetFirewallProfile | Format-List Name, Enabled
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True# 允许特定端口
New-NetFirewallRule -DisplayName "Allow HTTP 80" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
# 允许特定程序
New-NetFirewallRule -DisplayName "Allow Custom App" -Direction Inbound -Program "C:\Program Files\App\app.exe" -Action Allow
# 限制IP范围
New-NetFirewallRule -DisplayName "RDP from Office" -Direction Inbound -Protocol TCP -LocalPort 3389 -RemoteAddress 192.168.1.0/24 -Action Allow通过 secpol.msc 打开本地安全策略编辑器:
账户策略:
# 启用登录事件审核
auditpol /set /subcategory:"登录" /success:enable /failure:enable
# 启用账户管理审核
auditpol /set /subcategory:"用户账户管理" /success:enable /failure:enable# 查看Defender状态
Get-MpComputerStatus
# 启用实时保护
Set-MpPreference -DisableRealtimeMonitoring $false
# 执行快速扫描
Start-MpScan -ScanType QuickScan# 创建出站规则(防止恶意软件外联)
New-NetFirewallRule -DisplayName "Block Outbound 445" -Direction Outbound -Protocol TCP -LocalPort 445 -Action Block
# 按程序限制网络访问
New-NetFirewallRule -DisplayName "Block App Internet" -Direction Outbound -Program "C:\Program Files\App\app.exe" -RemoteAddress Internet -Action Block
# 创建限时规则(如工作时间外禁止访问)
$time = New-NetFirewallTimeRange -Name "WorkHours" -Start "09:00" -End "18:00"
New-NetFirewallRule -DisplayName "RDP Work Hours" -Direction Inbound -Protocol TCP -LocalPort 3389 -RemoteAddress "192.168.1.0/24" -Action Allow -TimeRange $time# 合并GPO和本地防火墙规则
gpupdate /force
# 导出防火墙策略用于审计
netsh advfirewall export "C:\Firewall_Policy.wfw"
# 导入防火墙策略
netsh advfirewall import "C:\Firewall_Policy.wfw"
# 查看所有规则并导出报表
Get-NetFirewallRule | Select-Object DisplayName, Direction, Action, Enabled | Export-CSV firewall_rules.csv
# 创建安全连接规则(IPsec)
New-NetIPsecRule -DisplayName "Secure RDP" -RemoteAddress 192.168.1.0/24 -InboundSecurity RequireAuth -Protocol TCP -LocalPort 3389# 查看当前监听端口
netstat -ano | findstr LISTENING
# 使用PowerShell查看
Get-NetTCPConnection -State Listen | Format-Table LocalAddress, LocalPort, OwningProcess
# 查看哪个进程占用端口
Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess2026-06-30
八彩云申明:本文内容由互联网用户贡献,该文观点仅代表作者,本站不拥有所有权,不承担相关法律责任。如发现有侵权/违规的内容,请联系我们info@bacaiyun.com。