0

My aim is to sniff through the Minecraft packets in python and decode the data to get this information:

  • The server the person is playing on
  • The player's coordinates on that server
  • The direction the player is pointing
  • The player's health

So far, this is my code:

from scapy.all import *

def test(pkt):
    payload = pkt
    payload = bytes(payload)

if __name__ == '__main__':
    single = sniff(filter="tcp and port 25565", prn=test)

The pkt variable is a scapy packet object and therefore has attributes such as .original and .payload. The code so far displays Minecraft's packets, however, I am unsure of how to decode them or what attribute to use. I have found the protocol documentation for 1.12.2 servers.

Thank you for any help in advance.

Fred Peters
  • 91
  • 1
  • 7
  • Questions that include "any help" are typically too broad and are not a good fit for this site. People have their own method for approaching the problem and because of this there cannot be a correct answer. Give a good read over [Where to Start](https://softwareengineering.meta.stackexchange.com/questions/6366/where-to-start/6367#6367), and [Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example "Minimal Reproducible Example") then edit your post. – itprorh66 Dec 13 '20 at 17:05

1 Answers1

0

Better late then never I guess.

Public private key encryption is a way to prevent others reading it.

Even by other means you could negotiate a secret:

Let's say you have a chest, put something in it (secret key) and put a padlock on it and send it to someone. The receiver can't open it but he can put an additional padlock on it. So he locks the chest with an additional lock and sends it back to you. Once you receive the chest it has 2 locks. You remove your lock and send it back again. The chest now only contains the lock of the receiver which he will be able to open when he recieves the chest again.

The chest was never in an unlocked state while in transit and anyone other then the sender or receiver will have been able to see what's inside.

Raatje
  • 1,662
  • 1
  • 11
  • 3