[GH-ISSUE #2021] vnc format possible problems #1358

Closed
opened 2026-10-14 03:45:41 +07:00 by bsakaguchi · 8 comments
Owner

Originally created by @jfoug on GitHub (Feb 4, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2021

Originally assigned to: @kholia on GitHub.

I was looking into porting vnc over to pass_gen, and to me the format looks very problematic.

The problem I see is DOES it work if the password is not exactly 8 bytes long??? To me, it looks like the key would not have been properly initialized.

Can we get some 'real' challenge/responses that are from a server with 3 or 5 byte passwords?

This 'may' be a PEBCAK, but I can not tell. The code just looks fishy, and ALL test vectors are 8 byte passwords.

Originally created by @jfoug on GitHub (Feb 4, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2021 Originally assigned to: @kholia on GitHub. I was looking into porting vnc over to pass_gen, and to me the format looks very problematic. The problem I see is DOES it work if the password is not exactly 8 bytes long??? To me, it looks like the key would not have been properly initialized. Can we get some 'real' challenge/responses that are from a server with 3 or 5 byte passwords? This 'may' be a PEBCAK, but I can not tell. The code just looks fishy, and ALL test vectors are 8 byte passwords.
bsakaguchi 2026-10-14 03:45:41 +07:00
  • closed this issue
  • added the
    testing
    label
Author
Owner

@jfoug commented on GitHub (Feb 4, 2016):

NOTE, vnc is NOT CBC. It is 2 crypts in ECB mode (it appears to be). I am pretty sure that within crypt_all, we are passing a null iv to both the first and second 8 byte decrypt. That is ECB, but foolishly using ECB mode.

NOTE, we should look at doing this with jtr improved DES code, for sure.

<!-- gh-comment-id:179946955 --> @jfoug commented on GitHub (Feb 4, 2016): NOTE, vnc is NOT CBC. It is 2 crypts in ECB mode (it appears to be). I am pretty sure that within crypt_all, we are passing a null iv to both the first and second 8 byte decrypt. That is ECB, but foolishly using ECB mode. NOTE, we should look at doing this with jtr improved DES code, for sure.
Author
Owner

@jfoug commented on GitHub (Feb 4, 2016):

I believe a simple memset of the key prior to copying password bytes into it, 'fixes' the problem. I have been doing work within pass_gen.pl, and I 'think' this is the way it should work.

<!-- gh-comment-id:179965656 --> @jfoug commented on GitHub (Feb 4, 2016): I believe a simple memset of the key prior to copying password bytes into it, 'fixes' the problem. I have been doing work within pass_gen.pl, and I 'think' this is the way it should work.
Author
Owner

@jfoug commented on GitHub (Feb 4, 2016):

@kholia can we get some additional 'real' hashes as test strings. Some other than 8 byte passwords? It would also be nice to know if > 8 byte really does get truncated to 8 bytes.

<!-- gh-comment-id:179965991 --> @jfoug commented on GitHub (Feb 4, 2016): @kholia can we get some additional 'real' hashes as test strings. Some other than 8 byte passwords? It would also be nice to know if > 8 byte really does get truncated to 8 bytes.
Author
Owner

@kholia commented on GitHub (Feb 4, 2016):

http://www.tightvnc.com/faq.php#howsecure

Thanks Jim. This bug has been lurking for a long time.

<!-- gh-comment-id:179981009 --> @kholia commented on GitHub (Feb 4, 2016): http://www.tightvnc.com/faq.php#howsecure Thanks Jim. This bug has been lurking for a long time.
Author
Owner

@jfoug commented on GitHub (Feb 4, 2016):

Also, We need to get some hashes where the high bit is set in the password. I think (looking at code), that it appears to be broken odd parity. But without 'real' hashes, I can not tell.

<!-- gh-comment-id:180011488 --> @jfoug commented on GitHub (Feb 4, 2016): Also, We need to get some hashes where the high bit is set in the password. I think (looking at code), that it appears to be broken odd parity. But without 'real' hashes, I can not tell.
Author
Owner

@jfoug commented on GitHub (Feb 4, 2016):

Your patch 'matches' my pass_gen.pl code. I have gotten high bit set stuff to match, so the code 'may' work just fine. However, if we can get some KNOWN high bit set passwords (i.e. utf-8 bytes or unicode, etc). then we would know that the logic is right.

<!-- gh-comment-id:180019403 --> @jfoug commented on GitHub (Feb 4, 2016): Your patch 'matches' my pass_gen.pl code. I have gotten high bit set stuff to match, so the code 'may' work just fine. However, if we can get some KNOWN high bit set passwords (i.e. utf-8 bytes or unicode, etc). then we would know that the logic is right.
Author
Owner

@jfoug commented on GitHub (Feb 4, 2016):

This was generated with pass_gen.pl, and it works in current vnc format.

{"$vnc$*84076F040550EEA9341967633B5F3855*807575689582379F7D807F736DE9E434", "pass\xc2\xA3"}, // high bit set is 'fun' for DES. c2a3 is £ in utf8 bytes.
<!-- gh-comment-id:180020138 --> @jfoug commented on GitHub (Feb 4, 2016): This was generated with pass_gen.pl, and it works in current vnc format. ``` c {"$vnc$*84076F040550EEA9341967633B5F3855*807575689582379F7D807F736DE9E434", "pass\xc2\xA3"}, // high bit set is 'fun' for DES. c2a3 is £ in utf8 bytes. ```
Author
Owner

@jfoug commented on GitHub (Feb 4, 2016):

added pass_gen.pl with vnc. NOTE, vnc is simple ECB and not CBC. Doing the 2 CBC is probably 'faster' than a simple ECB of the 2 blocks, since the 2nd CBC block (with null IV) is only done if the first one matches. But I think ECB would be a bit faster, and I KNOW if we could get jtr DES code to work, that would be MUCH faster.

<!-- gh-comment-id:180029019 --> @jfoug commented on GitHub (Feb 4, 2016): added pass_gen.pl with vnc. NOTE, vnc is simple ECB and not CBC. Doing the 2 CBC is probably 'faster' than a simple ECB of the 2 blocks, since the 2nd CBC block (with null IV) is only done if the first one matches. But I think ECB would be a bit faster, and I KNOW if we could get jtr DES code to work, that would be MUCH faster.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1358
No description provided.