IMail Weak Password Encryption Vulnerability
BID:880
Info
IMail Weak Password Encryption Vulnerability
| Bugtraq ID: | 880 |
| Class: | Design Error |
| CVE: |
CVE-1999-1497 |
| Remote: | No |
| Local: | Yes |
| Published: | Dec 19 1999 12:00AM |
| Updated: | Jul 11 2009 01:56AM |
| Credit: | Posted to Bugtraq on December 21, 1999 by Matt Conover <[email protected]>. |
| Vulnerable: |
Ipswitch IMail 6.0 Ipswitch IMail 5.0.8 Ipswitch IMail 5.0.7 Ipswitch IMail 5.0.6 Ipswitch IMail 5.0.5 Ipswitch IMail 5.0 |
| Not Vulnerable: | |
Discussion
IMail Weak Password Encryption Vulnerability
IMail keeps the encrypted passwords for email accounts in a registry key, HKLM\SOFTWARE\Ipswitch\Imail\Domains\(DomainName)\Users\(UserName), in a string value called "Password". The encryption scheme used is weak and has been broken. The following description of the mechanism used is quoted from Matt Conover's post to Bugtraq, linked to in full in the Credits section.
ENCRYPTION SCHEME Take the lowercase of the account name, split it up by letter and convert each letter to its ASCII equivalent. Next, find the difference between each letter and the first letter. Take each letter of the password, find it's ASCII equivalent and add the offset (ASCII value of first char of the account name minus 97) then subtract the corresponding difference. Use the differences recursively if the password length is greater than the length of the account name. This gives you the character's new ASCII value. Next, Look it up the new ASCII value in the ASCII-ENCRYPTED table (see http://www.w00w00.org/imail_map.txt) and you now have the encrypted letter.
Example:
Account Name: mike
m = 109
i = 105
k = 107
e = 101
Differences:
First - First: 0
First - Second: 4
First - Third: 2
First - Fourth: 8
Unencrypted Password: rocks
r = 114
o = 111
c = 99
k = 107
s = 115
(ASCII value + offset) - difference:
offset: (109 - 97) = 12
(114 + 12) - 0 = 126
(111 + 12) - 4 = 119
(99 + 12) - 2 = 109
(107 + 12) - 8 = 111
(115 + 12) - 0 = 127
126 = DF
119 = D8
109 = CE
111 = D0
127 = E0
Encrypted Password: DFD8CED0E0
The decryption scheme is a little easier. First, like the encryption scheme, take the account name, split it up by letter and convert each letter to its ASCII equivalent. Next, find the difference between each letter and the first letter. Now split the encrypted password by two characters (e.g., EFDE = EF DE) then look up their ASCII equivalent within the ASCII-ENCRYPTED table (see http://www.w00w00.org/imail_map.txt). Take that ASCII value and add the corresponding difference.Look this value up in the ascii table. This table is made by taking the ASCII value of the first character of the account name and setting it equal to 'a'.
EXAMPLE
Account Name: mike
m = 109
i = 105
k = 107
e = 101
Differences:
First - First: 0
First - Second: 4
First - Third: 2
First - Fourth: 8
Encrypted Password: DFD8CED0E0
DF = 126
D8 = 119
CE = 109
D0 = 111
E0 = 127
Add Difference:
126 + 0 = 126
119 + 4 = 123
109 + 2 = 111
111 + 8 = 119
127 + 0 = 127
Look up in table (see http://www.w00w00.org/imail_map.txt):
126 = r
123 = o
111 = c
119 = k
127 = s
Unencrypted Password: rocks
IMail keeps the encrypted passwords for email accounts in a registry key, HKLM\SOFTWARE\Ipswitch\Imail\Domains\(DomainName)\Users\(UserName), in a string value called "Password". The encryption scheme used is weak and has been broken. The following description of the mechanism used is quoted from Matt Conover's post to Bugtraq, linked to in full in the Credits section.
ENCRYPTION SCHEME Take the lowercase of the account name, split it up by letter and convert each letter to its ASCII equivalent. Next, find the difference between each letter and the first letter. Take each letter of the password, find it's ASCII equivalent and add the offset (ASCII value of first char of the account name minus 97) then subtract the corresponding difference. Use the differences recursively if the password length is greater than the length of the account name. This gives you the character's new ASCII value. Next, Look it up the new ASCII value in the ASCII-ENCRYPTED table (see http://www.w00w00.org/imail_map.txt) and you now have the encrypted letter.
Example:
Account Name: mike
m = 109
i = 105
k = 107
e = 101
Differences:
First - First: 0
First - Second: 4
First - Third: 2
First - Fourth: 8
Unencrypted Password: rocks
r = 114
o = 111
c = 99
k = 107
s = 115
(ASCII value + offset) - difference:
offset: (109 - 97) = 12
(114 + 12) - 0 = 126
(111 + 12) - 4 = 119
(99 + 12) - 2 = 109
(107 + 12) - 8 = 111
(115 + 12) - 0 = 127
126 = DF
119 = D8
109 = CE
111 = D0
127 = E0
Encrypted Password: DFD8CED0E0
The decryption scheme is a little easier. First, like the encryption scheme, take the account name, split it up by letter and convert each letter to its ASCII equivalent. Next, find the difference between each letter and the first letter. Now split the encrypted password by two characters (e.g., EFDE = EF DE) then look up their ASCII equivalent within the ASCII-ENCRYPTED table (see http://www.w00w00.org/imail_map.txt). Take that ASCII value and add the corresponding difference.Look this value up in the ascii table. This table is made by taking the ASCII value of the first character of the account name and setting it equal to 'a'.
EXAMPLE
Account Name: mike
m = 109
i = 105
k = 107
e = 101
Differences:
First - First: 0
First - Second: 4
First - Third: 2
First - Fourth: 8
Encrypted Password: DFD8CED0E0
DF = 126
D8 = 119
CE = 109
D0 = 111
E0 = 127
Add Difference:
126 + 0 = 126
119 + 4 = 123
109 + 2 = 111
111 + 8 = 119
127 + 0 = 127
Look up in table (see http://www.w00w00.org/imail_map.txt):
126 = r
123 = o
111 = c
119 = k
127 = s
Unencrypted Password: rocks
Exploit / POC
IMail Weak Password Encryption Vulnerability
exploit available
exploit available
Solution / Fix
IMail Weak Password Encryption Vulnerability
Solution:
Currently the SecurityFocus staff are not aware of any vendor supplied patches for this issue. If you feel we are in error or are aware of more recent information, please mail us at: [email protected].
Solution:
Currently the SecurityFocus staff are not aware of any vendor supplied patches for this issue. If you feel we are in error or are aware of more recent information, please mail us at: [email protected].