# Mapcidr Cidr

> Use mapcidr for CIDR range processing. Use when you need to expand a CIDR into an IP list, aggregate IPs into CIDRs, slice network segments, count IPs, or shuffle IP order. mapcidr is a CIDR processing tool from ProjectDiscovery with IPv4/IPv6 support. Any scenario involving CIDR computation, IP list processing, or network segment slicing should use this skill

- Skill: `dangeroussong/mapcidr-cidr` (Agent Skill)
- Install (CLI): `npx get-skill add dangeroussong/mapcidr-cidr`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dangeroussong/mapcidr-cidr/raw
- Safety review: pending (external: skill-scanner PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: DangerousSONG (https://skillmd.com/u/dangeroussong)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/dangeroussong/mapcidr-cidr

---


# mapcidr CIDR Range Processing Methodology
- 攻击大类:C42 网络扫描与枚举

mapcidr is a CIDR processing tool from ProjectDiscovery. Core advantages: **expansion / aggregation / slicing / shuffling** + **dual-stack IPv4/IPv6** + **pipeline friendly**.

Project URL: https://github.com/projectdiscovery/mapcidr

## Basic Operations

```bash
# expand a CIDR into an IP list
echo 192.168.1.0/24 | mapcidr

# count the number of IPs
echo 10.0.0.0/16 | mapcidr -count

# aggregate an IP list into CIDRs
cat ips.txt | mapcidr -aggregate

# shuffle IP order (avoid triggering alerts during sequential scanning)
echo 192.168.1.0/24 | mapcidr -si

# skip the network address and broadcast address
echo 192.168.1.0/24 | mapcidr -skip-base -skip-broadcast
```

## Network Segment Slicing

```bash
# slice by host count (256 IPs per slice)
echo 10.0.0.0/16 | mapcidr -sbh 256

# slice by CIDR size (split into /24)
echo 10.0.0.0/16 | mapcidr -sbc 24

# distribute scanning across slices
echo 10.0.0.0/16 | mapcidr -sbc 24 | \
  while read cidr; do naabu -host "$cidr" -p 80,443 -silent; done
```

## Pipeline Integration

```bash
# CIDR expansion → port scanning
echo 10.0.0.0/24 | mapcidr -si | naabu -p 80,443 -silent

# deduplicate and aggregate IPs
cat scan_results.txt | mapcidr -aggregate

# filter IP ranges
echo 10.0.0.0/8 | mapcidr -fi 10.0.1.0/24
```

