🆕Host Exclusion
Configuring host exclusion in NetExec
NetExec will solely exclude the target from scan operations but not from indirect connections, e.g., when collecting Bloodhound data. To completely prevent data transmission to a host, consider blocking the host in your local firewall.
Overview
NetExec provides host exclusion functionality to prevent scanning specific hosts, IP ranges, or networks. This feature is useful for:
Avoiding scanning of honeypots or monitoring systems
Preventing accidental scanning of out-of-scope targets
Excluding your own machine from network-wide scans
Configuration
Host exclusion is configured in the NetExec configuration file located at ~/.nxc/nxc.conf under the [nxc] section.
Configuration Options
[nxc]
exclude_hosts = []
skip_self = FalseExclude Specific Hosts
The exclude_hosts option allows you to define a list of hosts that should be permanently excluded from all NetExec scans.
Single IP Address
Multiple IP Addresses
IP Ranges
CIDR Notation
Mixed Formats
You can combine different formats in a single configuration:
Skip Self
The skip_self option automatically excludes all local IP addresses of the machine running NetExec.
Enable Skip Self
When enabled, NetExec will:
Detect all network interfaces on the local machine
Identify all assigned IP addresses
Automatically exclude these IPs from scanning
Complete Example
Here's a complete example configuration for a penetration test scenario:
Verification
To verify your exclusion configuration is working, run a scan and observe the excluded hosts in verbose mode:
Excluded hosts will be logged in verbose output.
Last updated
Was this helpful?

