Hello all! Not sure if this is the right place to make this thread, but here it is anyway.
I've created an application that will proxy data back and forth from the client and server. Now I want to start fiddling with that data.
Although, when I read the packet id, sometimes it's not correct, like during the login process, it'll receive a 0x02 from the client, even though it doesn't send that packet during the login process.
At the moment, all I'm trying to do is prevent chat packets (0x02) that start with '!' from getting sent to the server. Now this is simple enough to do, but when I implement it, it seems to prevent me from logging into the server.
Can someone explain to me what I'm doing wrong here? I've been at this for days now.
I'm not sure if I can post external links or not, but I put the code on pastebin. I've also removed any references to the project name.
EDIT: I also need a non-blocking C# method for decoding VarInts, if anyone can point me in the right direction.
Ok, so I just did a test, and logged all packet IDs getting sent back and forth from the client and server, and this is what I got, and it doesn't look right at all.
EDIT: It also resulted in a crash, probably because of how quickly I was writing to the log file.
EDIT2: The first few entries are the server list ping, and look correct. Also, I know they're in the form of VarInt and not normal int. so maybe I'll give that a go real quick.
EDIT3: I have no idea how to decode a VarInt... send halp
The client and server do something called two factor authentication, and the server and client are probably detecting that there is a man-in-the-middle changing their data.
As far as I know, it would be impossible edit intercepted packets unless you had the client and server's private key, which you cannot get and SHOULD NEVER EVER HAVE.
These videos are helpful on understanding the concept:
Your only option is to get access to the end points (physical client or physical server) and let minecraft decrypt them, then edit them. This is what minecraftforge and spigot do.
Thanks for the help. I'm testing it through a localhost connection, so encryption shouldn't be an issue. And I'm not trying to edit packets, I'm trying to prevent certain packets from being received at all. The actual proxy works fine, and I can login to the server and play through the application, my issue is handling packets.
You're correct, encryption is not enabled on localhost connections. You say you're having trouble reading Varints, perhaps this will help? http://wiki.vg/Protocol#VarInt_and_VarLong
Rollback Post to RevisionRollBack
My Github ด้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้дด็็็็็้้้้้็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้
Hello all! Not sure if this is the right place to make this thread, but here it is anyway.
I've created an application that will proxy data back and forth from the client and server. Now I want to start fiddling with that data.
Although, when I read the packet id, sometimes it's not correct, like during the login process, it'll receive a 0x02 from the client, even though it doesn't send that packet during the login process.
At the moment, all I'm trying to do is prevent chat packets (0x02) that start with '!' from getting sent to the server. Now this is simple enough to do, but when I implement it, it seems to prevent me from logging into the server.
Can someone explain to me what I'm doing wrong here? I've been at this for days now.
I'm not sure if I can post external links or not, but I put the code on pastebin. I've also removed any references to the project name.
EDIT: I also need a non-blocking C# method for decoding VarInts, if anyone can point me in the right direction.
Using this site for protocol information: http://wiki.vg/Protocol
- ProxyServer.cs - https://pastebin.com/GrW9MK2X
- ProxyClient.cs - https://pastebin.com/GidejBSL
Admin of https://www.oldschoolminecraft.com
If anyone needs me to rephrase the question, or clarify information, just ask. I've been pulling my hair out trying to find a solution.
Admin of https://www.oldschoolminecraft.com
Ok, so I just did a test, and logged all packet IDs getting sent back and forth from the client and server, and this is what I got, and it doesn't look right at all.
EDIT: It also resulted in a crash, probably because of how quickly I was writing to the log file.
EDIT2: The first few entries are the server list ping, and look correct. Also, I know they're in the form of VarInt and not normal int. so maybe I'll give that a go real quick.
EDIT3: I have no idea how to decode a VarInt... send halp
https://pastebin.com/43877Nug
Admin of https://www.oldschoolminecraft.com
Have you taken a look at http://wiki.vg/Protocol_Encryption
The client and server do something called two factor authentication, and the server and client are probably detecting that there is a man-in-the-middle changing their data.
As far as I know, it would be impossible edit intercepted packets unless you had the client and server's private key, which you cannot get and SHOULD NEVER EVER HAVE.
These videos are helpful on understanding the concept:
Your only option is to get access to the end points (physical client or physical server) and let minecraft decrypt them, then edit them. This is what minecraftforge and spigot do.
My Github ด้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้дด็็็็็้้้้้็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้
Thanks for the help. I'm testing it through a localhost connection, so encryption shouldn't be an issue. And I'm not trying to edit packets, I'm trying to prevent certain packets from being received at all. The actual proxy works fine, and I can login to the server and play through the application, my issue is handling packets.
Admin of https://www.oldschoolminecraft.com
You're correct, encryption is not enabled on localhost connections. You say you're having trouble reading Varints, perhaps this will help? http://wiki.vg/Protocol#VarInt_and_VarLong
My Github ด้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้дด็็็็็้้้้้็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้