Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/birdroad1/server-pinger
Server pinger for Minecraft written in C++
https://github.com/birdroad1/server-pinger
cpp crawler make minecraft minecraft-scanner postgres scanner server
Last synced: 13 days ago
JSON representation
Server pinger for Minecraft written in C++
- Host: GitHub
- URL: https://github.com/birdroad1/server-pinger
- Owner: BirdRoad1
- License: gpl-3.0
- Created: 2025-01-10T00:29:47.000Z (25 days ago)
- Default Branch: main
- Last Pushed: 2025-01-19T08:31:31.000Z (15 days ago)
- Last Synced: 2025-01-19T09:28:13.568Z (15 days ago)
- Topics: cpp, crawler, make, minecraft, minecraft-scanner, postgres, scanner, server
- Language: C++
- Homepage:
- Size: 196 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MCPinger
Easy-to-use tool written in C++ that can scan the entire internet (or IP ranges of your choosing) for Minecraft servers. This tool leverages the Minecraft protocol's `Server List Ping` system documented [here](https://minecraft.wiki/w/Minecraft_Wiki:Projects/wiki.vg_merge/Server_List_Ping).
This tool only supports Linux-based operating systems. Windows and macOS will not be considered.
Currently, this tool requires a PostgreSQL database to store data in.
To use this program, follow the steps in the `Building` section. Then, create a "cidrs.txt" file and enter a list of IP ranges in CIDR notation. Next, create a "db.txt" file with the url of the PostgreSQL database (an example is available in db.txt.example). Finally, run the binary.
# Masscan
This project currently isn't as fast as I'd like it to be. However, you can use [Masscan](https://github.com/robertdavidgraham/masscan) to initially scan for hosts with their port 25565 open to reduce the number of IPs to scan. Here's an example command:
```bash
masscan 0.0.0.0/0 -p25565 --excludefile exclude.conf -oX output.xml --rate 1000000
```Next, you can run:
```bash
python3 scripts/convertMasscanOutput.py
```to convert output.xml to a plaintext list of IP addresses (which will be stored in output.txt).
Finally, you can run this program to look for online Minecraft servers in the list.
# Building
Install the required dependencies (Ubuntu):
```bash
sudo apt-get install libpqxx-dev libpq-dev g++ make cmake
```Generate the Makefile using CMake:
```bash
cmake .
```Compile the tool:
```bash
make
```The binary will be at `./bin/mcpinger`
# Contributions
All contributions are welcome. To contribute, you can create an Issue or Pull Request. Feature requests are also welcome.