Install mapCIDR on Ubuntu 24.04

Install mapCIDR on Ubuntu 24.04

The mapCIDR is a tool designed to perform various operations for a given CIDR (Classless Inter-Domain Routing), which is used to allocate IP addresses and define network segments. It can be helphul for network administrators, cybersecurity professionals, and penetration testers. This tutorial explains how to install mapCIDR on Ubuntu 24.04.

Install mapCIDR

Obtain the most recent mapCIDR version tag from the GitHub repository and assign it to a variable:

MAPCIDR_VERSION=$(curl -s "https://api.github.com/repos/projectdiscovery/mapcidr/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Download the archive file from the repository releases page with the version obtained earlier:

wget -qO mapcidr.zip https://github.com/projectdiscovery/mapcidr/releases/latest/download/mapcidr_${MAPCIDR_VERSION}_linux_amd64.zip

Extract the mapcidr binary from the archive and place it in the /usr/local/bin directory:

sudo unzip -q mapcidr.zip -d /usr/local/bin mapcidr

Confirm the installation by checking the current version of mapCIDR:

mapcidr --version

Remove the downloaded archive file:

rm -rf mapcidr.zip

Testing mapCIDR

To use mapCIDR, run it with a CIDR block and specify the desired options. For example, the command:

mapcidr -cidr 192.168.0.0/24 -silent

This command gets a list of IP addresses for a given CIDR. A part of the output:

192.168.0.0
192.168.0.1
192.168.0.2
...
192.168.0.253
192.168.0.254
192.168.0.255

Uninstall mapCIDR

To uninstall mapCIDR, remove related file:

sudo rm -rf /usr/local/bin/mapcidr

The configuration directory can also be removed:

rm -rf ~/.config/mapcidr

Leave a Comment

Cancel reply

Your email address will not be published.