Skip to content

Basic arguments

Zixuan Xie edited this page Mar 2, 2025 · 44 revisions

Using the command xmap --help (or more concisely, xmap -h ), you can see a brief introduction to the basic arguments as follows:

Basic arguments:
  -6, --ipv6                    Scanning the IPv6 networks (default)
  -4, --ipv4                    Scanning the IPv4 networks
  -x, --max-len=len             Max IP bit length to scan  (default=`32')
  -p, --target-port=port|range  Port(s) number to scan (for TCP and UDP scans),
                                  use `,' and `-', with this option, one target
                                  is a <ip/x, port>
  -P, --target-index=num        Payload number to scan, with this option, one
                                  target is a <ip/x, (port), index>
                                  (default=`0')
  -o, --output-file=name        Output file, use `-' for stdout
  -b, --blacklist-file=path     File of subnets to exclude, in CIDR notation,
                                  e.g., 2001::/64, 192.168.0.0/16,
                                  www.qq.com/32 (max len of domain: 256)
  -w, --whitelist-file=path     File of subnets to include, in CIDR notation,
                                  e.g., 2001::/64, 192.168.0.0/16,
                                  www.qq.com/32 (max len of domain: 256)
  -I, --list-of-ips-file=path   List of individual addresses to scan in random
                                  order, e.g., 2001:db8::1, 192.168.0.1

Network Type Selection

  • -6, --ipv6: Scan IPv6 networks (enabled by default).
  • -4, --ipv4: Scan IPv4 networks.

Note: By default, XMap scans the IPv6 networks. If you need to scan IPv4 networks, you must explicitly specify it using xmap -4. -6 and -4 are mutually exclusive, which means scanning IPv4 and IPv6 networks cannot be performed simultaneously.


Scan Range Configuration

  • -x, --max-len=len: Set the maximum IP bit length to scan (default = 32).
  • ip|domain|range: Specify the IP addresses, DNS hostnames, or IP ranges to scan (supports CIDR block notation). Examples:
    • 2001::1 (IPv6 address)
    • 192.168.0.1 (IPv4 address)
    • 2001::/64 (IPv6 CIDR block)
    • 192.168.0.1/16 (IPv4 CIDR block)
    • www.qq.com (domain name)
    • Default values: ::/0 (IPv6) and 0.0.0.0/0 (IPv4).

Examples

  1. Scan the entire IPv6 address space (::/0-32) using Echo ping and output to stdout:
    xmap

Clone this wiki locally