MxO Client - Server communication "protocol" - Printable Version +- The Matrix Online Server Emulator (//mxoemu.info/forum) +-- Forum: The Matrix Online (//mxoemu.info/forum/forumdisplay.php?fid=3) +--- Forum: The MxO Client (//mxoemu.info/forum/forumdisplay.php?fid=7) +--- Thread: MxO Client - Server communication "protocol" (/showthread.php?tid=7) |
MxO Client - Server communication "protocol" - HD_Morpheus - 17-06-2009 Note: cryptography theory meanings are subjective from wikipedia and websites readings. In no way means that it shall be read as a full truth(hope it was! ) as Morpheus got no cryptography knowledge to asure 100% similarity on RL Initial packets If we peek some of the packets send by the in the communication between the client and the login/auth servers we see a pattern. First packet always have some numbers in a structure, apparently randoms. Second packet (server response) got same numbers plus another ones added. Why? That's called a "cryptographic nonce" (number used once) and is used specially to prevent packet sniffing and resending the packet by a third person in the communication, someone called eavesdropper (in this case, it's you, cause you saw the packets). To asure some randomness, timestamps are added to this packets. Client creates a randon number and server answers with another sequence to initiate a communication and hash using response. For example, hashing password using the random response, so it isnt sent as plain text. Identification protocol MxO Uses the challenge-response system, which is a "enterprise-standard" to simplify the comunication. How it works in real life: - Crypto shall work with 4 keys for a communication: Client public/private key Server public/private key Communication goes through: - Client uses its public key to cipher the message (we wont specify algorithm here) and sends it to server. - Server decyphers the message using its private key, and cipher a response with its public key - Client receives ciphered packet and deciphers it with its private key. This system gots its ups and its downs, but the main problem, applicated to game servers if that client may not know its private key and/or server keys. Another problem may be the time spent on ciphering/deciphering packets in both sides (specially on the server). That's solved using a shared secret key. Shared key is a composed key, from client public key + server private key(1) OR client private key + server public key(2). Composed Shared key is the same in cases 1 and 2. It is distributed between parts before the communication started (its like a "shared secret" between two people). To prevent man-in-the-middle or eavesdropping, shared secret key is not sent through the communication. How do this works then? - Client uses its secret to cipher some message, better a nounce, and send it to the server (challenge). - Server receives the message and deciphers it with the secret. Server sends an answer to the client (response). - Client receives the response and knows if server knows the secret as it does. If succesfully responsed, both know that the other share it secret and they are the authentic communication members (because of the nounce used above). When they got success, a sessionKey (and that means a unique per session key) is created in some way, by combining challenge(random) + shared key. This key, called "SessionKey" will be used as the "password" in the encrypt/decrypt algorithms, in the sense of: a.encrypt("sometext",sessionkey, resultEncryptedString) a.decrypt(encryptedString,sessionkey, resultDecryptedString) Test of faith: From cryptography theory to reality Let's say that this look great, wonderful or fully crap depending of the point of view of the user but... it is real? This is real. If you peek a editor (you can even use windows default notepad one) you will find strings referencing this: Code: UNKNOWN CERT_ MESSAGE RE: MxO Client - Server communication "protocol" - HD_Neo - 17-06-2009 Woah you are great I dont really understand this before you posted it here ...many thanks for it. But this means too, we have a big problem to decrypt right? Cause we have to know the secret keys . The first packet sends a timestamp (backwards like i posted) and the 04 is a algorythm type that is used (found it here : https://www.reverse-engineering.net/viewtopic.php?f=6&t=4413&start=0&st=0&sk=t&sd=a ). Quote:0x4 // Type of algorithm or parameter size if you edit the pubkey.dat (make it only readable), and fill the 04 with 00, you can see the changes directly in the first packet. But thats only the one, nothing changed really -.-. |