Lucene search

K
seebugRootSSV:3031
HistoryMar 15, 2008 - 12:00 a.m.

Cisco User-Changeable Password(UCP)CSuserCGI.exe缓冲区溢出及跨站脚本漏洞

2008-03-1500:00:00
Root
www.seebug.org
5

0.927 High

EPSS

Percentile

98.8%

BUGTRAQ ID: 28222
CVE(CAN) ID: CVE-2008-0532,CVE-2008-0533

UCP应用允许终端用户使用基于Web的工具更改Cisco Secure Access Control Server(ACS)的口令。

/securecgi-bin/CSUserCGI.exe CGI存在多个缓冲区溢出和跨站脚本漏洞,远程攻击者可能利用此漏洞控制服务器。

CSuserCGI.exe的main()函数将使用strcmp()传送给程序的第一个命令行参数与所支持的参数列表做比较,如Logout、Main、ChangePass等。对于大多数参数,函数只是解析参数并以类似于Action=%s&Username=%s&OldPass=%s&NetPass=%s格式串的形式传送给wsprintf()调用。这些调用的目标缓冲区位于位于应用的.data段。

如果是Logout参数的情况,main()会传送第二个参数,通常其形式为1234.xyzab.c.username.,以及栈上的char[]缓冲区。main()将这些内容传送给一个函数,该函数使用strtok获得字符串直到第一个“.”字符,然后字符串被拷贝到了96字节大小的char[]缓冲区。如果第一个句号字符前的字符串超过了这个长度,就会覆盖缓冲区和返回地址。

.text:00401065 mov eax, [ebx+8] ; get argv[2]
.text:00401068 test eax, eax
.text:0040106A jz loc_401520
.text:00401070 push eax ; char *
.text:00401071 call sub_402870

.text:00402870 sub esp, 60h
.text:00402873 mov ecx, 17h
.text:00402878 xor eax, eax
.text:0040287A push edi
.text:0040287B lea edi, [esp+64h+var_60]
.text:0040287F rep stosd
.text:00402881 mov ecx, [esp+64h+arg_0]
.text:00402885 stosw
.text:00402887 stosb
.text:00402888 lea eax, [esp+64h+var_60]
.text:0040288C push eax ; int
.text:0040288D push ecx ; char *
.text:0040288E call sub_402940

.text:00402940 mov ecx, [esp+arg_0]
.text:00402944 xor eax, eax
.text:00402946 test ecx, ecx
.text:00402948 jz locret_402A11
.text:0040294E push ebx
.text:0040294F push esi
.text:00402950 push edi
.text:00402951 push offset a_ ; "."
.text:00402956 push ecx ; char *
.text:00402957 call strtok
.text:0040295C mov edi, eax
.text:0040295E or ecx, 0FFFFFFFFh
.text:00402961 xor eax, eax
.text:00402963 mov ebx, [esp+14h+arg_4]
.text:00402967 repne scasb
.text:00402969 not ecx
.text:0040296B sub edi, ecx
.text:0040296D lea edx, [ebx+1]
.text:00402970 mov eax, ecx
.text:00402972 mov esi, edi
.text:00402974 mov edi, edx
.text:00402976 push offset a
; "."
.text:0040297B shr ecx, 2
.text:0040297E rep movsd
.text:00402980 mov ecx, eax
.text:00402982 push 0 ; char *
.text:00402984 and ecx, 3
.text:00402987 rep movsb

此外如果向CSUserCGI.exe提交了恶意URL请求的话,还可以执行跨站脚本攻击。

Cisco User-Changeable Password < 4.2
厂商补丁:

Cisco

Cisco已经为此发布了一个安全公告(cisco-sa-20080312-ucp)以及相应补丁:
cisco-sa-20080312-ucp:Cisco Secure Access Control Server for Windows User-Changeable Password Vulnerabilities
链接:<a href=“http://www.cisco.com/warp/public/707/cisco-sa-20080312-ucp.shtml” target=“_blank”>http://www.cisco.com/warp/public/707/cisco-sa-20080312-ucp.shtml</a>

补丁下载:
<a href=“http://www.cisco.com/cgi-bin/Software/Tablebuild/doftp.pl?ftpfile=cisco/crypto/3DES/ciscosecure/special/acs/macgyver/UCP_4.2.0.124-K9.zip&amp;app=Tablebuild&amp;status=showC2A” target=“_blank”>http://www.cisco.com/cgi-bin/Software/Tablebuild/doftp.pl?ftpfile=cisco/crypto/3DES/ciscosecure/special/acs/macgyver/UCP_4.2.0.124-K9.zip&amp;app=Tablebuild&amp;status=showC2A</a>


                                                https://target/securecgi-bin/CSUserCGI.exe?Logout+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBB.xyzab.c.hacker.
https://target/securecgi-bin/CSUserCGI.exe?Help+00.lala.c.hacker%22%22%22%3E%