X

Mac OS X malware "OSX/Oomp-A" discovered -- effects seem innocuous

Mac OS X malware "OSX/Oomp-A" discovered -- effects seem innocuous

CNET staff
4 min read

Andrew Welch of Ambrosia Software has discovered and described a new piece of malware for Mac OS X dubbed the "Oompa-Loompa Trojan (OSX/Oomp-A)"

The malware was posted as "latestpics.tgz" to a Mac rumors web site, claiming to be pictures of "Mac OS X Leopard" (an upcoming version of Mac OS X.

Andrew writes:

"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:
"A few important points
  • This should probably be classified as a Trojan, not a virus, because it doesn't self-propagate externally
  • It does not exploit any security holes; rather it uses "social engineering" to get the user to launch it on their system
  • It requires the admin password if you're not running as an admin user
  • It doesn't actually do anything other than attempt to propagate itself via iChat
  • It has a bug in the code that prevents it from working as intended, and has the side-effect of preventing infected applications from launching
  • It's not particularly sophisticated
"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
  6. 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; 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, Mac OS 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)
  8. 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) (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) -- This lets it send itself to people on your buddy list via iChat; this appears to be the only way it self-propagates externally
  9. It then uses Spotlight to find the 4 most recently used applications on your machine that are not owned by root
  10. 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
  11. 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)
  12. It then copies the application executable to its own resource fork, and replaces the executable with itself -- It has thus effectively injected its code in the host application
  13. When an application is launched from then on, the trojan code is executed, and it tries to re-infect and re-propagate every time that application is launched
  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)
[...]

"In the end, it doesn't appear to actually do anything other than try to propagate itself via iChat, 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.

As noted by Andrew, this particular piece of malware requires user-initiated action to run, and also requires the user to enter an administrator password (if you are logged in as a non-admin user) -- something that should never be required for opening a .jpg file. Its effects also seem to be innocuous.

Feedback? Late-breakers@macfixit.com.

Resources

  • Ambrosia Software
  • Late-breakers@macfixit.com
  • More from Late-Breakers