Overview
The WindowsFirewall command enumerates Windows Firewall rules. By default, it shows non-standard rules (filtering out default Windows rules) to highlight custom configurations. The-full flag displays all rules, and additional arguments allow filtering by action, protocol, direction, and profile.
Syntax
Remote Execution
Output
Returns firewall rule information:- Rule name
- Rule group
- Direction (Inbound/Outbound)
- Action (Allow/Block)
- Protocol (TCP/UDP/Any)
- Local/Remote ports
- Local/Remote addresses
- Application path
- Profile (Domain/Private/Public)
- Enabled status
Use Cases
- Red Team
- Blue Team
- Identify allowed inbound connections
- Find firewall exceptions for C2 channels
- Discover allowed applications
- Locate weak firewall rules
- Plan network-based attacks
- Identify egress filtering gaps
Example Output
Remote Execution
This command supports remote execution using the
-computername parameter.Detection Considerations
Low detection risk - queries firewall configuration.
- API Access: Queries Windows Firewall API
- WMI Activity: Remote execution uses WMI
- Registry Access: May read firewall configuration from registry
- Event Logs: Firewall policy changes generate Event ID 4946-4947
Firewall Profiles Explained
Profile Types
Profile Types
Domain Profile:
- Applied when connected to domain network
- Typically most permissive for internal access
- Should allow domain services
- Applied on private/home networks
- Moderate restrictions
- User-designated as trusted
- Applied on public networks (default for unknown)
- Should be most restrictive
- Maximum protection recommended
Dangerous Rule Patterns
Security Anti-Patterns
Security Anti-Patterns
Overly Permissive Rules:
- Any/Any rules (all ports, all addresses)
- Inbound allow from Any
- Disabled outbound filtering
- Broad port ranges (1-65535)
- RDP allowed from anywhere
- SMB exposed to internet
- WinRM without IP restrictions
- Administrative tools unrestricted
- High-numbered ports (backdoors)
- Unusual protocols
- Recently created rules
- Rules for temp/user directories
Related Commands
- TcpConnections - Active TCP connections
- UdpConnections - Active UDP listeners
- NetworkShares - Exposed network shares
- RDPsettings - RDP configuration
- PSSessionSettings - WinRM configuration