User(s) browsing this thread: 1 Guest(s)
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The MXO RSA keys
07-05-2009, 03:05 AM
Post: #1
The MXO RSA keys
You've obviously saw the pubkey.dat file in the same folder as matrix.exe right ?
And you think thats the only public key they use ?
Have you noticed that, when you edit it, even one byte, matrix KNOWS that its modified, and requests another copy from the server...
so, how does it KNOW that its modified ?
ill tell you

the pubkey.dat file isn't a normal DER encoded RSA public key, no.
It consists of :
ASN1 Integer of around 1024 bits (Modulus)
ASN1 Integer (Exponent), which is 17 (common value)
and then, a binary blob of 256 bytes...

Hmm, what could these 256 bytes be ?

You would notice, if you analyzed the AS_GetPublicKeyReply packet (when it does resend the key), that it sends all of these individually, and without any ASN1 encoding, first the modulus,then the exponent, then the binary blob, so we know that the blob is one continuous block, not a couple of other integers stuck together...

So what is 256 bytes, when we use RSA keys of 1024 bits... a signature.
the 256 byte blob inside pubkey.dat and the packet is the signature of the exponent and modulus before it, but what is used to create and check this signature ?

answer: client and server have another key pair. the client has another public key which is integrated into the exe, this is probably the reason for the crc checks later on, so that clients dont put their own public key.
this 2nd key pair is used to sign the first key pair, which might change (however it never has in the lifetime of mxo). the client, for the first auth packet, verifies the signature with its integrated public key, see if it matches the 256 bytes in pubkey.dat, if they do, it sends 00 00 00 04, which means, my key is good, thx

after all this is done, the client knows that the server is legit, and will carry on with sending credentials etc (probably signed with the pubkey.dat)
Quote this message in a reply
07-05-2009, 08:51 AM
Post: #2
RE: The MXO RSA keys
Great finding rajko.

I enjoy having our pubkey file explained.

Not so sure where this should lead us to, nor help to decode all the process (crypto turns my head sick xD), but on the other hand, i have found the "exact" place where code looks for "pubkey.dat" and do some (better said, lot of) checks.
Maybe it's what you'r expecting to find xD.

Of course that's gonna be hard time reading code as checking XXX bits.. phew lot of assembler things within!.

[Image: morphsig1.png]
[Image: ubd8457.png]
http://twitter.com/johnkussack [twitter]
Find all posts by this user
Quote this message in a reply
07-05-2009, 06:47 PM
Post: #3
RE: The MXO RSA keys
without changed pubkeys, you cannot do proper auth, so, try to extract the integrated matrix.exe pubkey
Quote this message in a reply
07-05-2009, 07:06 PM
Post: #4
RE: The MXO RSA keys
i ran a bruteforce primality check on every 128byte sequence from matrix exe, and the one with most entropy seems to be
Code:
5ebaae5b8a00bc9d6dc1b10e805dd2d5a0840714b5902ca3b2734c549274365138b0bd5afc606296​6c42f7107c28278c13959cc724463b70cae385cb11d093b8a68320ff9f77c3cc036f08bf40e72be2​790caa82413aeab9e49aa4977eda7a176694a11d3df0deb30b72a71cefd1533e8f33265fec762a49​8188ee21c41aebd9

which is in the exe right next to InvertibleRSA string, so might be it.
it should be next to the exponent as well, which is a standard value like 3,17 or 65537
Quote this message in a reply
Post Reply 


Forum Jump: