Exploit-DB #5796
Description: GLLCTS2 < 4.2.4 - 'detail' SQL Injection
Type: webapps
Platform: php
Date: 2008-06-12
Author: TheDefaced

Exploit:
<?php
/*[PII_REDACTED]8@M@@@M@2ZZZ8@aZX;ii,,:,iir[PII_REDACTED][PII_REDACTED]7777r;i:,     i   ,@X:i:0a7 BMMM[PII_REDACTED]0[PII_REDACTED]2aMMMMM,SZZ0WZ                         ........          7a2MMMMM      :   MMM@aZ888888888[PII_REDACTED]8WMMMMM78aSXi XBMMMMMMMMMMMMMM2: MB.X:.             ,SMMMMMMMMMMMM.    r:  MMM0a[PII_REDACTED][PII_REDACTED]ZZMMMMS  :          .:i;X28MMMMMMMM,22Z2XSaSir7ii2MMMMMMM@Z222Z0BMMM    iZMMMM8Z[PII_REDACTED][PII_REDACTED]82BMMM :MSMMMMMMMMMM@@WB80MMMMMMMM  ,;r7XXXSSX.SMMM, .:ZMMMMMMBX.         MMMM8a[PII_REDACTED][PII_REDACTED]8a2MMM8MMW   MM              ,,ZMMMM          i@B:WMMMMMMB8Z8MMMMMMMMMMX  ZMMWaZ[PII_REDACTED]
088888888ZZaS@MZiiMMMMMB:a@MMMMMMMMMMMM@ZX:aMMMMMM:MMMM0MMMM         iXa8ri ;MMMMMMMMMMBS[PII_REDACTED]8
0888888Za8MMMMM ,ZMMMMM,SaaZM2 ;M.Mr  XM;SWW MMMMMMMMMMMMB,7ZMMMZMaMMZ. ;BBM  MMZXSMMMMBS2a888888888
088888ZZMMM0XMMXMMMSMMa;aaaBa  M8M@ M   MBi2 MMMMMMMMMMMM.2ZZ8M  MMM7 S  @M@  .MMMMM XMMMMMZZ8888888
088888a@M     MMM   @MSraa8MX   ;7Z@       X MMMM    BMMMiaMMMM.  SXaX  .2ZM   MMMM MMM   MM8Z888888
088888aMa Ma   MW    M@i0MMM 7Sr.   :r7i.    MMM  ,:  MMM;8           .i,,.iri MMM  MM rMB MMa888888
08888Z2MSMMMMM BZ    MMrW                rr ;MM  ,::, @MMaM          :XX7,     MM   MM ;XMM Ma888888
08888Z2MXW M  MMX     MMB       T    :XZa.  MM  :.::: :MM         D           2MM   Z7 ;. M,Ma888888
088888aMi  M MMMMrB    MM            .i.   MM. iW.::: :@MX                    MM   XM, ., MMWa888888
088888aM@  M MMMMiZ2    MM.               MM  :Za ::: r MM:                  MM    MMMM  aMM8Z888888
088888ZBM  M  MM SXB     MMM2          ZMMM  X2a;.:::.,X MMM                MM    aMMMM  MMMaZ888888
0888888ZMM  M  M B7a8     r2MMMMMMMMMMMMM7  aSXZ ,:::: i; ,MMMX         .@MMM7:    MMMM 0MMZa8888888
0888888Z8M;  M M W7XZZ     :;77X2Z8aX,    iaX77a ::::::  Mr  aMMMMMMMMMMMMMi ,0;  MMMM .MMZa88888888
08888888a@M  ZM  @X7X8r                   WX77Xa ::::,,,  Mi      SaS7i..,rrXXW  :MM @@MMWaZ88888888
088888888aMMMB   ZS77X07                 .2   ,S ,::..:   MZS               220  ZaS  BMM2Z888888888[PII_REDACTED]aZMM   ia777X0       R          MMMMX      ; S. MM,      T       020  SX,;Mr M[PII_REDACTED]88[PII_REDACTED]8aaMB   i7777SW                  MMMMMM;:r,MMMMMMM              0aa8  W M    MBZ[PII_REDACTED][PII_REDACTED]88a0MMMM ;rrrr2Z                  M   SM2SWM7  X;              ;ZXZ  .2 MMMMMMZZ[PII_REDACTED][PII_REDACTED]008ZaSaMi7XXXXSBr.,,,,,,,,,,,:rXS:  ,.  .:        :S:,,,,,,,,..B2SZ  2SrMMMBa2Z[PII_REDACTED]0
\                                                                                                  /
|                                            TheDefaced.org                                        |
|__________________________________________________________________________________________________|
|                                                                                                  |
|                                              Presents...                                         |
|                                     Exploit - Vulnerability & Fix                                |
|                                     SQL Injection in gllcts2 >= 4.2.4                            |
| ------------------------------------------------------------------------------------------------ |
|                                             Description                                          |
| ------------------------------------------------------------------------------------------------ |
| The following script is used for displaying teamspeak information by users and allowing others   |
| to login to these servers and etc.                                                               |
|                                                                                                  |
| It's most commonly used by teamspeak hosting companys which makes it kinda bad that this exists. |
|                                                                                                  |
| ------------------------------------------------------------------------------------------------ |
|                                             Vulnerability                                        |
| ------------------------------------------------------------------------------------------------ |
| Although the following script has multiple sql injections there is only one which we really...   |
| Found to be useful enough to include inside of the exploit code.                                 |
|                                                                                                  |
| So that is the only one that we will go into detail with below...                                |
|                                                                                                  |
| If we go to login.php and view the line 20                                                       |                                                                                                 |
| We see the following code...                                                                     |
|                                                                                                  |
| <?php                                                                                            |
|    $r = query("SELECT * FROM $dbtable1 WHERE server_id='$_GET[detail]'");                        |
| ?>                                                                                               |
|                                                                                                  |
| If you understand php you can see from this that the code is not properly sanatized before being.|
| Put into the query and executed... The way it is currently would allow a remote attacker to...   |
| Add on SQL in order to preform a sql injection.                                                  |
|