CIDR, Distributed, Distribution, Downloads, Hacking Tools, mapCIDR, Mass Scanning, Scanning, Subnet, Subnetting, Subnetwork

mapCIDR – Small Utility Program To Perform Multiple Operations For A Given subnet/CIDR Ranges

Small utility program to perform multiple operations for a given subnet/CIDR ranges.

The tool was developed to ease load distribution for mass scanning operations, it can be used both as a library and as independent CLI tool.


  • Simple and modular code base making it easy to contribute.
  • CIDR distribution for distributed scanning.
  • Stdin and stdout support for integrating in workflows


From Source

▶ GO111MODULE=auto go get -u

From Github

▶ git clone; cd mapcidr/cmd/mapcidr; go build .; cp mapcidr /usr/local/bin


▶ mapcidr -h

This will display help for the tool. Here are all the switches it supports.

-cidrSingle CIDR to processmapcidr -cidr
-sbcSlice by CIDR countmapcidr -sbc 10
-sbhSlice by HOST countmapcidr -sbh 10000
-lFile containing list of CIDRsmapcidr -l cidr.txt
-oFile to write output to (optional)mapcidr -o output.txt
-silentMake the output silentmapcidr -silent
-versionPrint current version of chaos clientmapcidr -version

Running mapCIDR

In order to get list of IPs for a give CIDR, use the following command.

▶ mapcidr -cidr
▶ echo | mapcidr
 ____________ ___ 
__ _ ___ ____ / ___/ _/ _ \/ _ \
/ ' \/ _ '/ _ \/ /___/ // // / , _/
/_/_/_/\_,_/ .__/\___/___/____/_/|_| v0.1

[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.

Slice by CIDR

In order to slice given CIDR or list of CIDR by CIDR count or slice into multiple and equal smaller subnets, use the following command.

▶ mapcidr -cidr -sbc 10 -silent
▶ echo | mapcidr -sbc 10 -silent

Slice by HOST

In order to slice given CIDR for equal number of host count in each CIDR, use the following command.

▶ mapcidr -cidr -sbh 20000 -silent
▶ echo | mapcidr -sbh 20000 -silent

Note: it’s possible to obtain a perfect split only when the desired amount of slices or hosts per subnet is a powers of two. Otherwise the tool will attempt to automatically find the best split strategy to obtain the desired outcome.

Use mapCIDR as a library

It’s possible to use the library directly in your go programs. The following code snippets outline how to divide a cidr into subnets, and how to divide the same into subnets containing a certain number of hosts

package main

import (


func main() {
// Divide the CIDR into two subnets
subnets1 := mapcidr.SplitN("", 2)
for _, subnet := range subnets1 {
// Divide the CIDR into two subnets containing 128 hosts each
subnets2 := mapcidr.SplitByNumber("", 128)
for _, subnet := range subnets2 {

// List all ips in the CIDR
ips, _ := mapcidr.Ips("")
for _, ip := range ips {

mapCDIR is made with  by the projectdiscovery team.

Source : KitPloit – PenTest Tools!

Previous ArticleNext Article
Send this to a friend