barneygale / quarry

Python library that implements the Minecraft network protocol and data types
Other
527 stars 75 forks source link

Only relay ONLINE-MODE traffic #163

Closed Mitch0S closed 2 years ago

Mitch0S commented 2 years ago

G'day,

I'm looking at writing a proxy that is able to RELAY Minecraft traffic, it doesn't need to see the contents of the conversation between client and server other than maybe the connection hostname and username. Here are some questions.

  1. Is it possible to relay ONLINE MODE traffic, similar to infrared
  2. Is it possible to change what server the client is connected to depending on the hostname they connect with?

Thanks,

Mitch

davidawesome02 commented 2 years ago
  1. Yes, but it requires the login credentials of the person in the proxy or a mod to validate the request (with quarry)
  2. Yes, but it requires the login credentials of the person in the proxy or a mod to validate the request

If you are just trying to always forward do this with dns, If you want to get the name it is technically possible, then forward, but you have to write everything your self, quarry implements all play packets, but the login packets are hard (before encryption) because you have to make your own proxy, I will see if I can do this, but you cannot use quarry.

https://wiki.vg/Protocol#Login_Start is the documentation on login start, which is sent before encryption, and contains the username. If you can read this as it is sent, you can get the name, and then resend https://wiki.vg/Protocol#Handshake to the server (you may not be able to edit this, so run it on the correct port), then send https://wiki.vg/Protocol#Login_Start UNMODIFIED to finish the connection, after this one more unencrypted packet is sent to the server, about the encryption which then goes into the encrypted connection and you cannot read any further packets, though it is known to be possible to guess packets and modify them once, but this will get you kicked:

https://youtu.be/i-2UgCDdhpM?t=825

Mitch0S commented 2 years ago

Thank you! I will look into this :)

On Fri, 17 Jun 2022 at 06:25, davidawesome02 @.***> wrote:

  1. Yes, but it requires the login credentials of the person in the proxy or a mod to validate the request (with quarry)
  2. Yes, but it requires the login credentials of the person in the proxy or a mod to validate the request

If you are just trying to always forward do this with dns, If you want to get the name it is technically possible, then forward, but you have to write everything your self, quarry implements all play packets, but the login packets are hard (before encryption) because you have to make your own proxy, I will see if I can do this, but you cannot use quarry.

https://wiki.vg/Protocol#Login_Start http://url is the documentation on login start, which is sent before encryption, and contains the username. If you can read this as it is sent, you can get the name, and then resend https://wiki.vg/Protocol#Handshake http://url to the server (you may not be able to edit this, so run it on the correct port), then send https://wiki.vg/Protocol#Login_Start http://url UNMODIFIED to finish the connection, after this one more unencrypted packet is sent to the server, about the encryption which then goes into the encrypted connection and you cannot read any further packets, though it is known to be possible to guess packets and modify them once, but this will get you kicked: https://youtu.be/i-2UgCDdhpM?t=825 http://url

— Reply to this email directly, view it on GitHub https://github.com/barneygale/quarry/issues/163#issuecomment-1158190697, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCZ5GFQ5F5KMU25V66TOLDVPOSWFANCNFSM5Y6ILDVQ . You are receiving this because you authored the thread.Message ID: @.***>

Mitch0S commented 2 years ago

@davidawesome02 I ended up spending a couple hours doing some research and ended up making a multi-client tcp proxy that relays between player and server depending on the hostname that the player connects with. Just wanted to come here and say thanks for your help!