{"id":"MSF-linux--ftp--proftp_sreplace","name":"ProFTPD 1.2 - 1.3.0 sreplace Buffer Overflow (Linux)","description":"This module exploits a stack-based buffer overflow in versions 1.2 through 1.3.0 of ProFTPD server. The vulnerability is within the \"sreplace\" function within the \"src/support.c\" file. The off-by-one heap overflow bug in the ProFTPD sreplace function has been discovered about 2 (two) years ago by Evgeny Legerov. We tried to exploit this off-by-one bug via MKD command, but failed. We did not work on this bug since then. Actually, there are exists at least two bugs in sreplace function, one is the mentioned off-by-one heap overflow bug the other is a stack-based buffer overflow via 'sstrncpy(dst,src,negative argument)'. We were unable to reach the \"sreplace\" stack bug on ProFTPD 1.2.10 stable version, but the version 1.3.0rc3 introduced some interesting changes, among them: 1. another (integer) overflow in sreplace! 2. now it is possible to reach sreplace stack-based buffer overflow bug via the \"pr_display_file\" function! 3. stupid '.message' file display bug So we decided to choose ProFTPD 1.3.0 as a target for our exploit. To reach the bug, you need to upload a specially created .message file to a writeable directory, then do \"CWD <writeable directory>\" to trigger the invocation of sreplace function. Note that ProFTPD 1.3.0rc3 has introduced a stupid bug: to display '.message' file you also have to upload a file named '250'. ProFTPD 1.3.0 fixes this bug. The exploit is a part of VulnDisco Pack since Dec 2005.","cves":["CVE-2006-5815"],"author":"Evgeny Legerov, jduck","published":"2006-11-26","platform":"Linux","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/28c856ca21ac307a61589dae6a173dfc2003a235/modules/exploits/linux/ftp/proftp_sreplace.rb","path":"modules/exploits/linux/ftp/proftp_sreplace.rb","revision":"28c856ca21ac307a61589dae6a173dfc2003a235","filename":"proftp_sreplace.rb","vulnerabilities":[{"id":"CVE-2006-5815","state":"PUBLISHED","title":null,"titleSource":null,"description":"Stack-based buffer overflow in the sreplace function in ProFTPD 1.3.0 and earlier allows remote attackers, probably authenticated, to cause a denial of service and execute arbitrary code, as demonstrated by vd_proftpd.pm, a \"ProFTPD remote exploit.\"","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2006-5815","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2006-5815"},"updatedAt":"2024-08-07T20:04:55.597Z","retrievedAt":"2026-11-27T06:43:45.743Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--ftp--proftp_sreplace.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--ftp--proftp_sreplace","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--ftp--proftp_sreplace/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--ftp--proftp_sreplace/code","licenseUrl":"https://exploitbin.com/sources#metasploit"}