Git Product home page Git Product logo

mc-server-scanner's Introduction

Public minecraft server scanner

It uses masscan and dramatiq to scan for public minecraft servers on default port 25556.

How does it work

iprange.py provides a class with utility functions to generate a file of ip ranges with either an /8 or /16 CIDR range.
The scanner script chooses a random ip address range from this file and calls masscan with it, on scan end, it queues a server list ping that on success caches the response to a redis backend, then a script periodically writes the bundled responses to a MongoDB database.

Installation and configuring

Install docker compose: Ubuntu, CentOs / Oracle linux

Clone the repo

git clone https://github.com/rezonmain/mc-server-scanner.git
cd mc-server-scanner

To enable saving found servers to a db, copy the .env.example file to .env in the root directory

 cp .env.example .env

Edit the MONGO_URI environment variable to your connection string. You can create a free MongoDB cluster with Atlas

Rate limiting masscan

Running masscan on a home network unlimited will melt your router, in my case, I run it at 35,000 kp/s which scans a x.x.x.x/16 range (65,536 hosts) in ~2 seconds, and at 100,000 kp/s when scanner is running on a vm.

To edit the rate at which masscan runs, edit the RATE environment variable in .env

MONGO_URI=MONGO_URI='mongodb+srv://<username>:<password>@<mongourl>/?retryWrites=true&w=majority'
RATE=100000 <- set to your liking
IDENT=SERVER_NAME

Run docker compose up

sudo docker compose up

Front end

You can browse my scanned entries on this website.

The source code for it can be found in the web/ directory.

Todo

Goals completed ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

  • Containerize application
  • Write found servers to db (Mongo)
  • Create front-end to browse servers

mc-server-scanner's People

Contributors

gorlikitsme avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.