https://github.com/urpagin/minecrafthoneypot
A simple Minecraft IP logger honeypot in C.
https://github.com/urpagin/minecrafthoneypot
honeypot honeypot-minecraft minecraft packets protocol tcp
Last synced: 9 days ago
JSON representation
A simple Minecraft IP logger honeypot in C.
- Host: GitHub
- URL: https://github.com/urpagin/minecrafthoneypot
- Owner: Urpagin
- License: gpl-3.0
- Created: 2024-06-27T09:39:10.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-11-29T15:05:23.000Z (7 months ago)
- Last Synced: 2025-01-19T12:12:30.769Z (5 months ago)
- Topics: honeypot, honeypot-minecraft, minecraft, packets, protocol, tcp
- Language: C
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Minecraft Honeypot
Simple Minecraft honeypot (IP logger) written in C.
# How to build
1. Clone the repo (or download `main.c`)
2. `gcc main.c -o honeypot`
3. `./honeypot`
# Compatibility
## Architecture
- Linux: Working
- macOS: Not Tested (but should work)
- Windows: Not Working (as we are using `sys/socket.h`, a POSIX-specific header not available on Windows)## Minecraft clients
According to the [Minecraft protocol wiki](https://wiki.vg/Server_List_Ping), this implementation is compatible from and including Java Edition 1.7 to the latest versions.
This implementation is compatible with Minecraft Java Edition versions 1.7 and newer, as per the [Minecraft protocol wiki](https://wiki.vg/Server_List_Ping).
You can change the server version by modifying the JSON in the source code, by changing the `name` and `protocol` fields.
# How does it work?
First, the program mimics the Minecraft [Server List Ping (SLP)](https://wiki.vg/Server_List_Ping) protocol, to only implement the part that accepts a TCP connection and sends back the bare minimum.
But then, by accepting a connection the client gives out its IP address, after that we just log it into a file.
For more detail, please read the blog post in the ["Why" section](#why).
# Illustrations

*(Note: I only used the honeypot locally, which is why all the addresses are 127.0.0.1.)*
# Code Quality Disclaimer
I have never properly learnt C, nor made any project in that language. That said, the code works, but I doubt the quality of it.
# Why
Written for : https://blog.urpagin.net/coding-a-minecraft-honeypot/
I wrote this blog post because experimenting with sockets and Minecraft is genuinely enjoyable!