F-Secure's analysis offers a method for detecting the unpatched Java vulnerability exploit called Flashback by running the following three commands sequentially in the OS X Terminal utility:
defaults read ~/.MacOSX/environment DYLD_INSERT_LIBRARIES
defaults read /Applications/Safari.app/Contents/Info LSEnvironment
defaults read /Applications/Firefox.app/Contents/Info LSEnvironment
If your system is not infected then the output of these commands will state in part that the domain/default pair "does not exist"