Macs are not immune to malware. Authors of malicious software often try to get a LaunchDaemon or LaunchAgent installed onto your computer [in any of several system folders]…
OS X has a lesser-known feature called Folder Actions. These allow you to run scripts when an item is added to a folder. You can set up a simple script that lets you know when an item is added to one of the folders above and then open it to see what was added. If it is not something you recognize or were expecting, delete it.
Full article here:
OS X: Roll-your-own Malware Detection (Jacob Salmela)
NOTE: The instructions in this article are slightly out of the correct sequence for OS X 10.9 Mavericks, but if you follow them as shown you will see the problem. The main thing is, after right-clicking the folder you wish to monitor, and then selecting Services and Folder Actions Setup, on the first screen that appears select add – new item alert.scpt as shown below:
Then on the next screen, just make sure all the boxes are checked, especially the first one “Enable Folder Actions” as shown below: