mailing list archives
Unreal ircd 3.2 clocking subsystem vulnerability
From: bartavelle <bartavelle-anti-spam-thingie () banquise net>
Date: Mon, 05 Jul 2004 14:23:55 +0200
Software name: Unreal ircd
Vulnerable versions: 3.2 and probably previous versions
Problem nature: Information disclosure
Unreal ircd is a popular irc server. One of the features it provides is
called 'ip cloaking'. The purpose of this system is to prevent hostile
irc users from getting the IP address of other users.
In order to prevent ip bruteforcing, it uses three 'keys'. However, the
hashing system is weak.
It is possible to recover the keys of several irc networks by knowing
only one clear text and hashed IP, and another hashed IP.
The IPv4 hashing scheme is the most vulnerable. Code from cloak.c
/* Do IPv4 cloaking here */
strlcpy(h1, host, sizeof h1);
i = 0;
for (i = 0, p = strtok(h1, "."); p && (i <= 3); p = strtok(NULL, "."), i++)
strncpy(h2[i], p, 4);
ircsprintf(h3, "%s.%s", h2, h2);
l = ((our_crc32(h3, strlen(h3)) + KEY) ^ KEY2) + KEY3;
ircsprintf(h3, "%s.%s.%s", h2, h2, h2);
l = ((KEY2 ^ our_crc32(h3, strlen(h3))) + KEY3) ^ KEY;
l = our_crc32(host, strlen(host));
l = ((l + KEY3) ^ KEY) + KEY2;
l &= 0x3FFFFFFF;
l &= 0x7FFFFFFF;
l &= 0xFFFFFFFF;
snprintf(cloaked, sizeof cloaked, "%lX.%lX.%lX.IP", l, l, l);
h2, h2, h2, h2 contain the four bytes of the original IP.
l, l, l contain the hashed IP. Thus:
l = (((crc32("1.2") + key1) ^ key2) + key3) & 0x7FFFFFFF;
l = (((crc32("1.2.3") ^ key2) + key3) ^ key1) & 0xFFFFFFFF;
l = (((crc32("18.104.22.168") + key3) ^ key1) + key2) & 0x3FFFFFFF;
crc32(xxx) and l[x] are is known. The three keys are used in such a way
that the n-th bit of any key does not affect bits bellow n in the hash.
We have successfully writen a program that bruteforces one bit at a
time. It takes less than one second to do that on a pentium4 1.8ghz.
Doing this on a known IP produces around 2000 possible key
combinations. It is then trivial to test them all in order to find the
Update to version 3.2.1
Up to date information:
Full-Disclosure - We believe in it.
- Unreal ircd 3.2 clocking subsystem vulnerability bartavelle (Jul 05)