Provides subnet information and functionality to divide subnets into blocks. This enables the parallelization of large scanning and network reconnaissance operations.
See the docs here.
go get github.com/cbergoon/ipblocks
go install github.com/cbergoon/ipblocks/cmd/ipblockscli
ipblockscli -h
ipblockscli -s 192.168.9.0/24 -b /26
ipblockscli -v -s 192.168.9.0/24 -b /26
Usage of ipblockscli:
-b string
size of block to divide subnet into (default "/28")
-s string
CIDR representation of subnet to divide (default "192.168.1.0/24")
-v output verbose information describing subnet
Below is an example demonstrating calculation of subnet information and dividing a /24
subnet into 16 blocks of /28
address ranges within the /24
.
package main
import (
"crypto/sha256"
"log"
"github.com/cbergoon/ipblocks"
)
func main() {
address := net.IPv4(192, 168, 1, 0)
originalBlock, _ := ipblocks.NewIPMaskInfo(address, 24, false)
fmt.Println(originalBlock)
dividedBlocks, _ := originalBlock.CalculateBlocks(28)
fmt.Println(dividedBlocks)
blockRange, _ := originalBlock.CalculateRange(28)
fmt.Println(blockRange)
}