loading
loading
Network
Perform multiple operations for a given subnet or CIDR range.
overview
mapcidr is the utility that sits between a list of network ranges and the scanners that work on individual hosts. Give it a CIDR like 10.0.0.0/24 and it expands the range into every IP inside it. Hand it a pile of scattered IPs and it aggregates them back into the smallest set of subnets that covers them. It is small, fast, and built to be one node in a longer chain rather than a tool you run on its own.
The operations go well past expand and aggregate. It can sort ranges, count how many IPs a CIDR holds, slice a large range into a fixed number of chunks or by host count, filter to only IPv4 or only IPv6, match or exclude IPs against a file, skip base and broadcast addresses, and shuffle the output so a scan does not walk a subnet in order. Each operation reads a list and writes a list, so they compose cleanly.
On Trickest, mapcidr is a Network node that takes a CIDR or a file of CIDRs and writes a file and a folder of results. It usually follows asnmap, which maps an organization's ranges, and feeds a port scanner like naabu, turning owned address space into the concrete host list those scanners need.
use cases
Turn a file of subnets from asnmap into every individual IP so a port scanner like naabu can probe each host directly instead of a range.
Collapse a long list of single IPs and overlapping ranges into the smallest set of CIDRs that covers them, shrinking the scope you hand downstream.
Split a wide CIDR into a fixed number of chunks or by host count, then fan the slices out across parallel scanner nodes to cover the space faster.
Keep only IPv4 or IPv6, drop base and broadcast addresses, and match or exclude against a file so the scan runs only on the IPs that matter.
reference
| Name | Type | Flag | Description |
|---|---|---|---|
| target | STRING | -cidr | A single CIDR or IP to process, example: 173.0.84.0/24. |
| cidr | FILE | -cidr | File containing a list of CIDRs or IPs to process in bulk. |
| aggregate | BOOLEAN | -aggregate | Aggregate the input IPs and CIDRs into the minimum subnet set. |
| slice-by-host-count | STRING | -sbh | Slice the input CIDRs by a given host count per slice. |
| slice-by-count | STRING | -sbc | Slice the input CIDRs into a given number of CIDR chunks. |
| count | BOOLEAN | -count | Count the number of IPs in the given CIDR. |
| match-ip | FILE | -match-ip | File of IPs or CIDRs to keep, dropping everything else. |
| filter-ip | FILE | -filter-ip | File of IPs or CIDRs to exclude from the output. |
Showing key inputs. mapcidr exposes 24 inputs in total.
| Name | Type | Flag | Description |
|---|---|---|---|
| cidr | FILE | -cidr | File containing a list of CIDRs or IPs to process. |
| sort | BOOLEAN | -sort | Sort input IPs and CIDRs in ascending order. |
| count | BOOLEAN | -count | Count the number of IPs in a given CIDR. |
| silent | BOOLEAN | -silent | Silent mode; print only results. |
| target | STRING | -cidr | A single CIDR or IP to process. |
| to-ipv4 | BOOLEAN | -to-ipv4 | Convert IPs to IPv4 format. |
| to-ipv6 | BOOLEAN | -to-ipv6 | Convert IPs to IPv6 format. |
| verbose | BOOLEAN | -verbose | Verbose mode. |
| match-ip | FILE | -match-ip | File of IPs or CIDRs to match, keeping only those. |
| aggregate | BOOLEAN | -aggregate | Aggregate input IPs and CIDRs into the minimum subnet set. |
| filter-ip | FILE | -filter-ip | File of IPs or CIDRs to filter out of the output. |
| ip-format | STRING | -ip-format | IP output formats (0,1,2,3,4,5,6,7,8,9,10,11). |
| skip-base | BOOLEAN | -skip-base | Skip base IPs (ending in .0) in the output. |
| shuffle-ip | BOOLEAN | -shuffle-ip | Shuffle input IPs into random order. |
| filter-ipv4 | BOOLEAN | -filter-ipv4 | Filter IPv4 addresses from the input. |
| filter-ipv6 | BOOLEAN | -filter-ipv6 | Filter IPv6 addresses from the input. |
| shuffle-port | STRING | -shuffle-port | Shuffle input IP:Port pairs into random order. |
| sort-reverse | BOOLEAN | -sort-reverse | Sort input IPs and CIDRs in descending order. |
| skip-broadcast | BOOLEAN | -skip-broadcast | Skip broadcast IPs (ending in .255) in the output. |
| slice-by-count | STRING | -sbc | Slice CIDRs into a given number of CIDR chunks. |
| zero-pad-number | STRING | -zero-pad-n | Number of padded zeros to use (default 3). |
| aggregate-approx | BOOLEAN | -aggregate-approx | Aggregate sparse IPs and CIDRs into a minimum approximated subnet. |
| zero-pad-permute | BOOLEAN | -zero-pad-permute | Enable permutations from 0 to zero-pad-n for each octet. |
| slice-by-host-count | STRING | -sbh | Slice CIDRs by a given host count per slice. |
example
# expand a CIDR into hosts, dropping .0 and .255mapcidr -cidr 198.51.100.0/24 -skip-base -skip-broadcast -o hosts.txt198.51.100.1198.51.100.2198.51.100.3198.51.100.4198.51.100.5198.51.100.6198.51.100.7198.51.100.8… (254 hosts for the /24 after skipping .0 and .255)guidance
Use mapcidr to turn CIDR ranges into host lists, or to collapse scattered IPs back into tidy subnets, between range discovery and scanning. It manipulates address space, it does not discover or scan it, so feed it from asnmap and pass its output to a port scanner like naabu.
Maps an organization's CIDR ranges from ASN data. Run it before mapcidr to produce the ranges mapcidr expands.
Pulls the prefixes for an ASN. A focused source of ranges to hand to mapcidr when you already have the AS number.
Prints every IP in a CIDR. A minimal sibling for plain expansion, without the slicing, aggregation, and filtering mapcidr adds.
faq
related
Quickly map an organization's network ranges using ASN information.
Maximize your resolver count by combining the target's DNS servers with public resolvers.
Expand CIDR ranges into a list of IP addresses easily.
Expand CIDR ranges into a list of IP addresses easily, from a file.
Maintain a list of IPv4 DNS servers verified against baseline servers for accurate responses.
Patched dnsvalidator that keeps only IPv4 resolvers verified against baseline servers.
An organization name feeds asnmap, which maps its CIDR ranges and passes them to mapcidr, expanding them into a host-list output ready for scanning.
Facts on this page come from the live Trickest tool library.