|
Date: Thu, 4 Apr 2002 13:51:51 +0000 (GMT+00:00) From: dizznutt@my.security.nl To: bugtraq@securityfocus.com Subject: Full analysis of multiple remotely exploitable bugs in Icecast 1.3.11 Cc: team@icecast.org, jack@xiph.org --Hushpart_boundary_dtTNKduRIGdnWcGUVeMlfRocRSpodbZz Content-type: text/plain Hello, Attached is a full analysis to accompany the earlier disclosed remote root/shell exploit for the Icecast mp3 streaming server. It also details some other exploitable bugs besides the one that is exploited with the supplied exploit and thus I believe has posting value. This write-up was mainly meant to aid the icecast developers in locating and eliminating the exact problems, but I can imagine it would be of some value to other interested parties as well. ltr, diz - #temp --Hushpart_boundary_dtTNKduRIGdnWcGUVeMlfRocRSpodbZz Content-Disposition: attachment Content-type: application/octet-stream; name="icecast.txt" Content-Transfer-Encoding: base64 WyBGdWxsIGFuYWx5c2lzIG9mIG11bHRpcGxlIEljZWNhc3QgMS4zLjExIHJlbW90ZWx5 IGV4cGxvaXRhYmxlIG92ZXJmbG93cyBdCgoJUGFyZG9uIG15IGxvdXN5IGZvcm1hdHRp bmcuLmJ1dCB0aGlzIHdhcyBqdXN0IGEgcXVpY2sgd3JpdGV1cAoKCk9rLi5JIGRpZCBz b21lIGRpZ2dpbmcgaW50byB3aGVyZSB0aGUgZXhhY3Qgb3ZlcmZsb3cgb2NjdXJzLiBB bmQKY2FtZSB1cCB3aXRoIHRoZSBmb2xsb3dpbmcgcmVzdWx0czoKClRoZSBiYWQgdm9v ZG9vIGhhcHBlbnMgd2hlbiB0aGUgZm9sbG93aW5nIGxpbmUgb2YgY29kZSBpcyBleGVj dXRlZC4KSSB0cmFja2VkIGRvd24gdGhlIGhvdyBhbmQgd2h5IGFuZCB3aWxsIHRyeSB0 byBleHBsYWluIGl0IGluIHRoaXMKdGV4dC4KCjxldmlsIGNvZGU+CmludCBkaWZmID0g dHJlZS0+Y21wIChpdGVtLCBwLT5kYXRhLCB0cmVlLT5wYXJhbSk7CjwvZXZpbCBjb2Rl PgoKCQlbIG90aGVy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