Encryption puzzle / How to create a ProxyStub for a Remote Assistance ticket

Posted by Jon Clegg on Stack Overflow See other posts from Stack Overflow or by Jon Clegg
Published on 2010-04-02T23:15:29Z Indexed on 2010/04/02 23:23 UTC
Read the original article Hit count: 347

I am trying to create a ticket for Remote Assistance. Part of that requires creating a PassStub parameter. As of the documenation:

http://msdn.microsoft.com/en-us/library/cc240115(PROT.10).aspx

PassStub: The encrypted novice computer's password string. When the Remote Assistance Connection String is sent as a file over e-mail, to provide additional security, a password is used.<16>

In part 16 they detail how to create as PassStub. In Windows XP and Windows Server 2003, when a password is used, it is encrypted using PROV_RSA_FULL predefined Cryptographic provider with MD5 hashing and CALG_RC4, the RC4 stream encryption algorithm.

As PassStub looks like this in the file: PassStub="LK#6Lh*gCmNDpj"

If you want to generate one yourself run msra.exe in Vista or run the Remote Assistance tool in WinXP.

The documentation says this stub is the result of the function CryptEncrypt with the key derived from the password and encrypted with the session id (Those are also in the ticket file).

The problem is that CryptEncrypt produces a binary output way larger then the 15 byte PassStub. Also the PassStub isn't encoding in any way I've seen before.

Some interesting things about the PassStub encoding. After doing statistical analysis the 3rd char is always a one of: !#$&()+-=@^. Only symbols seen everywhere are: *_ . Otherwise the valid characters are 0-9 a-z A-Z. There are a total of 75 valid characters and they are always 15 bytes.

Running msra.exe with the same password always generates a different PassStub, indicating that it is not a direct hash but includes the rasessionid as they say.

Some other ideas I've had is that it is not the direct result of CryptEncrypt, but a result of the rasessionid in the MD5 hash. In MS-RA (http://msdn.microsoft.com/en-us/library/cc240013(PROT.10).aspx). The "PassStub Novice" is simply hex encoded, and looks to be the right length. The problem is I have no idea how to go from any hash to way the ProxyStub looks like.

© Stack Overflow or respective owner

Related posts about cryptography

Related posts about win32