Welcome Guest ( Log In | Register )

> New MacOS X trojan/virus alert, mostly a non-event
andrew
post Feb 16 2006, 12:12 AM
Post #1


Administrator
********

Group: Admin
Posts: 13,565
Joined: 20-March 99
From: Rochester, NY
Member No.: 2



A file called "latestpics.tgz" was posted on a Mac rumors web site http://www.macrumors.com/ , claiming to be pictures of "MacOS X Leopard" (an upcoming version of MacOS X, aka "MacOS X 10.5"). It is actually a Trojan (or arguably, a very non-virulent virus). We'll call it "Oompa-Loompa" (aka "OSX/Oomp-A") for reasons that will become obvious.

Update: Some of the media reports have been inaccurate, stating that I "discovered" this trojan/virus. This is incorrect; it was discovered by a number of readers of http://www.MacRumors.com/ and was passed along to me by the admin of the site, arn. It has also been stated that I analyzed this trojan/virus alone; that's also incorrect. I did some work trudging through it, but primarily was a filter for the yeoman's work done by Ed Wynne and Glenn Anderson.

Unless you work for an anti-virus company, please don't email/message me asking for a copy of this trojan. It's not going to happen.

You cannot be infected by this unless you do all of the following:

1) Are somehow sent (via email, iChat, etc.) or download the "latestpics.tgz" file

2) Double-click on the file to decompress it

3) Double-click on the resulting file to "open" it

...and then for non-Admin users, it fails to infect most applications.

You cannot simply "catch" the virus. Even if someone does send you the "latestpics.tgz" file, you cannot be infected unless you unarchive the file, and then open it.

A few important points

-- This should probably be classified as a Trojan, not a virus, because it doesn't self-propagate externally (though it could arguably be called a very non-virulent virus)

-- It does not exploit any security holes; rather it uses "social engineering" to get the user to launch it on their system

-- If you're not running as an admin user, it will silently fail to infect most applications

-- It doesn't actually do anything other than attempt to propagate itself via iChat, and then only via Bonjour! (aka "Rendezvous) -- it does not sent itself over the Internet, rather just to your local Bonjour user list

-- It has a bug in the code that prevents it from working as intended, which has the side-effect of preventing infected applications from launching

-- It's not particularly sophisticated

--I'd really be tempted to call this thing a non-event; it's poorly written, can't spread beyond your local network, is unlikely to infect anything on most machines, and needs user interaction to do anything at all--

A good rule of thumb is: if your user account allows you to install an application without entering your password, then this trojan/virus can modify (infect) that application without you entering a password. Regardless, it can install the "apphook" InputManager portion of its payload no matter what type of user account you have (admin or non-admin).

To be on the safe side...

DO NOT DOWNLOAD OR RUN THIS FILE

It's come to my attention that this file was actually originally posted to a "hacking" web board under a different name, purporting to be a picture of the MacBook Pro internals. Someone likely renamed it and posted it to MacRumors.com.

When unarchived (it is a gzip-compressed tar file), which can be done by simply double-clicking on the file, it appears to be a JPEG file because someone pasted the image of a JPEG file onto the file.

After it's been unzipped, tar will tell you there are two files in the archive:

._latestpics
latestpics

...the ._latestpics is just the resource fork of the file, which contains the pasted in custom icon meant to fool people into double-clicking on it to (in theory) open the JPEG file for viewing. In actuality, double-clicking on it will launch an executable file.

The file "latestpics" is actually a PowerPC-compiled executable program, with routines such as:

_infect:
_infectApps:
_installHooks:
_copySelf:

Here's what it does if a user double-clicks on the file, or otherwise executes it:

1) It copies itself to /tmp as "latestpics"
2) It recreates its resource fork in /tmp (with the custom icon in it) from an internally stored gzip'd copy, then sets custom icon bit for the new file in /tmp
3) It then tar + gzips itself so a pristine copy of itself in .tgz format is left in /tmp
4) It renames itself from "latestpics.tar.gz" to "latestpics.tgz" then deletes the copied "latestpics" executable from /tmp

--This gives it a pristine copy of itself, for later transmission.--

5) It extracts an Input Manager called "apphook.bundle" that is embedded in the macho executable, and copies it to /tmp
6a) If your uid = 0 (you're root), it creates /Library/InputManagers/ , deletes any existing "apphook" bundle in that folder, and copies "apphook" from /tmp to that folder
6b) If your uid != 0 (you're not root), it creates ~/Library/InputManagers/ , deletes any existing "apphook" bundle in that folder, and copies "apphook" from /tmp to that folder
7) When any application is launched, MacOS X loads the newly installed "apphook" Input Manager automatically into its address space

--This allows it to have the code in the "apphook.bundle" injected into any subsequently launched application via the InputManager mechanism--

8a) When an application is subsequently launched, the "apphook.bundle" Input Manager then appears to try to send the pristine "latestpics.tgz" file in /tmp to people on your buddy list via iChat (who will then presumably download the file, double-click on it, and the cycle repeats).

8b) (It looks like the author intended to get it to send the "latestpics.tgz" file out via eMail as well, but never got around to writing that code)

9) It only sends itself to people on your local Bonjour! (aka "Rendezvous") buddy list; it cannot send itself over the Internet

--This lets it send itself to people on your Bonjour! buddy list via iChat; this appears to be the only way it self-propagates externally--

10) It then uses Spotlight to find the 4 most recently used applications on your machine that are not owned by root
11) In an apparent "Charlie and the Chocolate Factory" reference, it then checks to see if the xattr 'oompa' of the application executable is > 0... if so, it bails out, to prevent it from re-infecting an already infected application
12) If not, it sets the xattr 'oompa' of the application executable to be 'loompa' (this does nothing, it is just a marker that it has infected this app)
13) It then copies the application executable to its own resource fork, and replaces the application executable with the OSX/Oomp-A trojan

nb: If run via double-clicking on the file, and the user doesn't have privileges to modify an application, it silently fails.

--It has thus effectively injected its code in the host application, but it can only do so for applications that the user has write access to--

13) When an infected application is launched from then on, the trojan code is executed, and it tries to re-infect and re-propagate itself to other applications
14) It then does an execv on the resource fork of the executable, which is the original application, so the application launches as it normally would (in theory... see below)
15) Due to a bug in it's code for executing the original app from it's resource fork, it is only allocating a buffer 4 bytes bigger than the path when appending "/..namedfork/rsrc" to the path, it will stop any app it infects from running. Instead of adding the length of the string, it errantly adds the length of the pointer to the string, which is always 4 bytes.

--In the end, it doesn't appear to actually do anything other than try to propagate itself via iChat over your local Bonjour! buddy list (it cannot send itself over the Internet), and unintentionally prevent infected applications from running--

It seems that this is more of a "proof of concept" implementation that could be utilized to actually do something in the future, depending on how successful it is, or it was simply done to garner attention/press. Which I'm sure it'll get.

.....

The executable itself has a number of interesting things embedded into various macho segments, including an entire Input Manager bundle called "apphook" (stored as "latestpics_hook.tar"); the string data is "protected" with a simple XOR to prevent easy reading of what it's doing. It's definitely trying to mask what it is doing in a number of ways, but is relatively simplistic in nature.

If you are a programmer, attached is the disassembly of the executable (it's just a plain text file) for your reading pleasure. This is just the main executable portion of the code, not the embedded "apphook" InputManager code.

Thanks to Ed Wynne for his crucial help in uncovering the true nature of this trojan, Glenn Anderson for his southern-hemisphere hacking help, and other "smart friends".
Attached File(s)
Attached File  latestpics_annotated.txt ( 74.24K ) Number of downloads: 7538
 


--------------------
Andrew Welch / el Presidente / Ambrosia Software, Inc. -- http://www.AmbrosiaSW.com/
Some people's minds are like cement: all mixed up and permanently set...
Go to the top of the page
 
+Quote Post

Posts in this topic
- andrew   New MacOS X trojan/virus alert   Feb 16 2006, 12:12 AM
- - Begemotike   Woof, that's interesting. Keep us updated Andr...   Feb 16 2006, 01:15 AM
- - Ragashingo   Very Interesting.   Feb 16 2006, 01:27 AM
|- - das   Andrew, If you have the file, could you send it t...   Feb 16 2006, 01:45 AM
- - InfoSecGuy   Andrew, Please check your private messages.   Feb 16 2006, 01:53 AM
- - Steelix   "177 User(s) are reading this topic (174 Gues...   Feb 16 2006, 04:35 AM
- - _tycho61uk_   Well tickle me pink! Our first malware!...   Feb 16 2006, 04:39 AM
|- - andrew   QUOTE(_tycho61uk_ @ Feb 16 2006, 03:39 AM)Wel...   Feb 16 2006, 04:59 AM
|- - GooBallFan   QUOTE(andrew @ Feb 16 2006, 03:59 AM)That pas...   Feb 16 2006, 06:19 AM
||- - andrew   QUOTE(GooBallFan @ Feb 16 2006, 05:19 AM)Andr...   Feb 16 2006, 06:41 AM
|- - lbutler   QUOTE(andrew @ Feb 16 2006, 01:59 AM)That pas...   Feb 16 2006, 07:27 AM
|- - JKT   QUOTE(lbutler @ Feb 16 2006, 06:27 AM)OK, cor...   Feb 16 2006, 07:31 AM
||- - lbutler   QUOTE(JKT @ Feb 16 2006, 04:31 AM)I'd agr...   Feb 16 2006, 07:55 AM
|- - andrew   QUOTE(lbutler @ Feb 16 2006, 06:27 AM)OK, cor...   Feb 16 2006, 07:33 AM
- - Steelix   Yeah, but there are some very stupid people out th...   Feb 16 2006, 04:52 AM
- - hag   hi, thanks for all the information. is it possibe...   Feb 16 2006, 05:11 AM
- - palmeira   If the trojan adds an "apphook" file int...   Feb 16 2006, 06:22 AM
|- - andrew   QUOTE(palmeira @ Feb 16 2006, 05:22 AM)If the...   Feb 16 2006, 06:42 AM
|- - JKT   QUOTE(andrew @ Feb 16 2006, 05:42 AM)That wou...   Feb 16 2006, 07:12 AM
- - WeeBull   Presumably there would be a simple spotlight searc...   Feb 16 2006, 07:12 AM
|- - tsfall   Just a thought, but if you change the permissions ...   Feb 16 2006, 07:22 AM
- - Captaintripps   We got dugg Davey...we got dugg.   Feb 16 2006, 07:50 AM
- - ToLazyToMakeAnAccount   Here's a stupid idea: What if you were to cre...   Feb 16 2006, 07:58 AM
|- - lbutler   QUOTE(ToLazyToMakeAnAccount @ Feb 16 2006, 04...   Feb 16 2006, 08:17 AM
- - ToLazyToMakeAnAccount   I know, I thought of that too. But, for this par...   Feb 16 2006, 08:33 AM
|- - ericl   So to clarify if you are logged in as an admin use...   Feb 16 2006, 09:05 AM
|- - _tycho61uk_   QUOTE(ericl @ Feb 16 2006, 02:05 PM)...then t...   Feb 16 2006, 09:18 AM
|- - ericl   QUOTE(_tycho61uk_ @ Feb 16 2006, 09:18 AM)Jus...   Feb 16 2006, 12:30 PM
- - marcus   It's interesting that the input manager as a v...   Feb 16 2006, 09:03 AM
- - JKT   Well, this is the first mainstream media report I...   Feb 16 2006, 09:19 AM
|- - andrew   QUOTE(JKT @ Feb 16 2006, 08:19 AM)Well, this ...   Feb 16 2006, 09:24 AM
|- - Anklosaur   QUOTE(andrew @ Feb 16 2006, 08:24 AM)Yeah, I ...   Feb 16 2006, 02:50 PM
- - andrew   Looks like Slashdot has picked it up: http://it....   Feb 16 2006, 09:52 AM
- - Xaositek   You might also try this command: /usr/bin/find ...   Feb 16 2006, 09:54 AM
- - Captaintripps   Oomp-A should have totally been the name.   Feb 16 2006, 10:44 AM
- - JoeBob   Werd.   Feb 16 2006, 11:00 AM
- - EVula   Thanks for the update. I've been running my ac...   Feb 16 2006, 11:10 AM
- - breakneckridge   I hope you're ready for the Digg effect, cause...   Feb 16 2006, 11:31 AM
|- - Captaintripps   We weathered a much larger Digg effect a couple of...   Feb 16 2006, 11:59 AM
- - MagnusApollo   This was found by our digital crayonboy Marcus (wh...   Feb 16 2006, 11:43 AM
- - Anaxagoras   ASW got linked to in a Slashdot article about this...   Feb 16 2006, 12:01 PM
- - prophile   I noticed a poll off a link from there where the q...   Feb 16 2006, 12:03 PM
- - Ragashingo   Yay! Moki and the real name of the virus get m...   Feb 16 2006, 12:17 PM
- - grand admiral thrawn   Uh oh... we are on the front page of MacRumors. My...   Feb 16 2006, 12:17 PM
- - breakneckridge   Digg + Slashdot + MacRumors = The perfect bandwidt...   Feb 16 2006, 12:33 PM
|- - grand admiral thrawn   QUOTE(breakneckridge @ Feb 16 2006, 12:33 PM)...   Feb 16 2006, 12:39 PM
|- - breakneckridge   QUOTE(grand admiral thrawn @ Feb 16 2006, 11:...   Feb 16 2006, 01:08 PM
- - Aranor   Can you guys PLEASE stop calling this thing a viru...   Feb 16 2006, 01:14 PM
|- - Captaintripps   Where was anyone really doing that in this thread?...   Feb 16 2006, 01:21 PM
||- - Aranor   QUOTE(Captaintripps @ Feb 16 2006, 01:21 PM)W...   Feb 16 2006, 01:25 PM
|- - mdavey   QUOTE(Aranor @ Feb 16 2006, 05:14 PM)Can you ...   Feb 16 2006, 01:32 PM
- - CBWolf   This is really very fascinating. I am very curious...   Feb 16 2006, 01:32 PM
|- - Captaintripps   I'd also be curious to know what it does with ...   Feb 16 2006, 01:35 PM
||- - CBWolf   QUOTE(Captaintripps @ Feb 16 2006, 12:35 PM)I...   Feb 16 2006, 01:50 PM
||- - Captaintripps   Yes and, though I don't use it, I believe you ...   Feb 16 2006, 01:52 PM
|- - danamania   QUOTE(CBWolf @ Feb 17 2006, 04:32 AM)Another ...   Feb 17 2006, 02:00 PM
- - Captaintripps   If we can all agree to go by the definitions as fo...   Feb 16 2006, 01:39 PM
|- - no_use_for_a_name   QUOTE(Captaintripps @ Feb 16 2006, 05:39 PM)N...   Feb 16 2006, 01:53 PM
- - _tycho61uk_   Jeez...talk about a storm in a teacup Window...   Feb 16 2006, 02:07 PM
- - dre   QUOTE(andrew @ Feb 15 2006, 09:12 PM)A file c...   Feb 16 2006, 02:15 PM
- - The Apple Cøre   Would do more damage to the average user if it stu...   Feb 16 2006, 02:19 PM
- - securitymonkey   QUOTE(andrew @ Feb 15 2006, 09:12 PM)A file c...   Feb 16 2006, 02:20 PM
- - udahlen   Just a comment: as far as I know, Admin Account do...   Feb 16 2006, 02:57 PM
- - Trah   As harmless as this is, I'm sure my PC-using f...   Feb 16 2006, 04:17 PM
|- - breakneckridge   QUOTE(Trah @ Feb 16 2006, 03:17 PM)As harmles...   Feb 16 2006, 04:39 PM
- - fchsjv4   Very interesting, considering its characteristics....   Feb 16 2006, 05:09 PM
- - EVula   QUOTE(breakneckridge @ Feb 16 2006, 03:39 PM)...   Feb 16 2006, 05:15 PM
|- - breakneckridge   QUOTE(EVula @ Feb 16 2006, 04:15 PM)Yes, beca...   Feb 16 2006, 05:26 PM
|- - EVula   QUOTE(breakneckridge @ Feb 16 2006, 04:26 PM)...   Feb 16 2006, 06:08 PM
- - Ragashingo   You know what annoys me? All this arguing over wha...   Feb 16 2006, 05:21 PM
- - Zitchas   Thanks for the straight-forward information and ex...   Feb 16 2006, 05:24 PM
- - Destroyer E   527 Guests? Whoa. Welcome new users and one-time ...   Feb 16 2006, 05:45 PM
|- - breakneckridge   QUOTE(Destroyer E @ Feb 16 2006, 04:45 PM)527...   Feb 16 2006, 05:57 PM
- - KedFiller   QUOTE(mdavey @ Feb 16 2006, 12:32 PM)...A tro...   Feb 16 2006, 06:22 PM
- - ToLazyToMakeAnAccount   QUOTE(udahlen @ Feb 16 2006, 01:57 PM)Just a ...   Feb 16 2006, 07:03 PM
- - rdorman   First, i arrived with the Digg wave... thanks for ...   Feb 16 2006, 07:12 PM
- - ChildOL   I am very disappointed that Apple allowed this, gi...   Feb 16 2006, 08:57 PM
|- - ElectricSheep   QUOTE(ChildOL @ Feb 16 2006, 07:57 PM)I am ve...   Feb 17 2006, 09:47 AM
- - halfacat   so here goes: 1)you need to be enough of a dork to...   Feb 16 2006, 09:18 PM
- - Admiral Benden   I found a link to this stuff on /. at work, so I w...   Feb 16 2006, 11:03 PM
- - Galen   Now, I'm going to tread lightly here, because ...   Feb 16 2006, 11:27 PM
|- - adream   QUOTEif anyone knows of a good OSX equivalent for ...   Feb 17 2006, 12:06 AM
|- - Destroyer E   QUOTE(Galen @ Feb 16 2006, 10:27 PM)I depend ...   Feb 17 2006, 10:51 AM
- - elfprince13   I use OS X, Classic, Windows, and *nix. Just comm...   Feb 17 2006, 12:25 AM
|- - M.M   QUOTE(elfprince13 @ Feb 16 2006, 11:25 PM)any...   Feb 17 2006, 01:23 AM
|- - lbutler   QUOTE(M.M @ Feb 16 2006, 10:23 PM)If someone ...   Feb 17 2006, 01:57 PM
- - Digitol   Wonderful, Anti-Virus, FREEWARE called Clamavx you...   Feb 17 2006, 04:52 AM
- - ElGuapo7   Would Adium also propagate this software, or just ...   Feb 17 2006, 07:02 AM
- - ToLazyToMakeAnAccount   So far, 4 of my friends have sent me "latestp...   Feb 17 2006, 07:30 AM
- - _tycho61uk_   QUOTE(elfprince13 @ Feb 17 2006, 05:25 AM)Jus...   Feb 17 2006, 08:00 AM
- - Mazca   I'm genuinely surprised that this is the first...   Feb 17 2006, 08:15 AM
|- - nemo   QUOTE(Mazca @ Feb 17 2006, 04:15 AM)I'm g...   Feb 17 2006, 10:31 AM
- - ToLazyToMakeAnAccount   I find it amusing how many users have posted their...   Feb 17 2006, 09:08 AM
- - ArtemisG3   Apple should realize that the malware doesn't ...   Feb 17 2006, 09:30 AM
- - Borislab   I think this form has saved a lot of mac users tha...   Feb 17 2006, 10:01 AM
- - EVula   QUOTE(nemo @ Feb 17 2006, 09:31 AM)It actuall...   Feb 17 2006, 01:52 PM
- - ChildOL   Security in a connect world is something we should...   Feb 17 2006, 02:17 PM
- - Albert II   So if you unpack the latestpics.tgz you get a file...   Feb 17 2006, 03:13 PM
|- - JKT   There was no picture. From the macrumors thread w...   Feb 17 2006, 05:04 PM
- - MagnusApollo   well, I use Adium, and I had 2 seperate friends tr...   Feb 17 2006, 05:28 PM
2 Pages V   1 2 >


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

- Lo-Fi Version Time is now: 2nd September 2010 - 10:16 AM