With Homebrew (macOS or Linux)
https://formulae.brew.sh/formula/masscan
brew install masscanhttps://github.com/robertdavidgraham/masscan
With uv
uv venv
source .venv/bin/activate
uv pip install mcstatus tqdm aiofiles aiohttp
# uv run main.pypython3 -m venv .venv
source .venv/bin/activate
pip install mcstatus tqdm aiofiles aiohttp
# python3 main.pyuv run main.py <ip_range> --port-range <port_range> --rate <rate> --dump-file <dump_file> --template <template>or
python3 main.py <ip_range> --port-range <port_range> --rate <rate> --dump-file <dump_file> --template <template>uv run main.py 192.168.1.0/24which will scan all IP addresses in the 192.168.1.0/24 network on ports 25565 at 500 packets per second. This command is equivalent to:
uv run main.py 192.168.1.0/24 --port-range 25565 --rate 500 --dump-file servers --template masscan.commandYou can specify port ranges in the format 25565-26665.
Or scan only a specific ip with all ports:
uv run main.py 10.31.27.99 --port-range "1-65534" --rate 500You can access masscan's output at dump/<dump_file>.ndjson and the final output at output/<dump_file>.csv.
Copyright (c) 2025 Gaelincho
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.