software that searches the internet for minecraft (java edition) servers, saves their information to database and has a website that displays this information. i originally made this to find liveoverflow’s minecraft server.

features

  • website with server information
  • historical player playtime data
  • online-mode/whitelist detection
  • 3d view of minecraft server world

infra

to collect, store and serve all of the data i had multiple servers and s3 buckets.

diagram of slowstack’s infrastructure

main server

the server where all the data was being stored and served through our website. it also ran multiple cron jobs to automatically backup the database and fetch twitch streams from their api to match the usernames from that to ones in the database.

scanner server #1

a bare metal server with an unmetered 1gbit/s connection to continuously port scan the ipv4 address space with about 1.5 million syn packets per second for new minecraft servers.

scanner server #2

a smaller server (vps) that was used to ping the minecraft servers that were already in the database to keep the information up to date.

minecraft-bot server

to avoid getting the scanner servers ddosed, the minecraft-bot that joined servers ran on its own vps. minecraft-bot detects whether a server is in online-mode or not and whether the server is whitelisted by firstly joining with a cracked account and later with a premium account based on the result.

on successful joins it gathers the data about the spawn chunks of the world, converts this into a 3d model and uploads this to an s3 bucket.

public s3 bucket

used to store server favicons as .png and world models from the minecraft-bot.

private s3 bucket

used to store backups of the database in case the main server decided to die.

scanning

the port scanner itself is written in rust because i simply wanted to learn rust :). it uses horribly written network code, af_xdp sockets and minecraft protocol parsing code.

tcp fingerprinting

software like p0f uses certain tcp packet values and options to fingerprint traffic. because we are building our own tcp packets we can customise the values and options and pretend to be an entirely different device to these types of software, like a nintendo wii by setting the following values:

tcp_options: vec![
    TcpOption::mss(1460),
    TcpOption::nop(),
    TcpOption::nop(),
    TcpOption::sack_perm(),
],
tcp_flags: TcpFlags::SYN,
tcp_window_size: 32768,

af_xdp sockets

the port scanner uses af_xdp sockets for that extra performance boost that i won’t ever use. basically bypassing the kernel’s network stack. an ebpf program runs inside the network driver and looks at every incoming packet before the network stack does, deciding whether it’s meant for our port scanner (a tcp packet sent to the scanner’s source port) or not. if it is, it gets redirected straight to the scanner in user space. if not, it gets passed on to the kernel’s network stack like normal.

sending works the same way in reverse: the scanner writes syn packets in batches into memory that’s shared with the network driver and tells the kernel to send the whole batch at once, instead of doing a syscall per packet and going through the entire network stack.

diagram of af_xdp

shepan

shepan was part of the old version of this project to check if the server had online-mode set to true or not. after rewriting this in c# i wanted to see how fast i could join servers (this includes saving the data to the database), i managed to join ~300k servers / 5 minutes (rookie numbers). mojang later banned the account for 4166 days, for obvious reasons.

“it’s like a modern day herobrine”

a meme of shepan joining minecraft servers