Share the Knowledge!


If you’re worried about your computer being stolen, you can easily use Dropbox to perform silent reconnaissance in the even it is stolen. You’ll then have a greater chance of retrieving your stolen computer.

To do this you’ll need to install a keylogger and/or screenshot applications and set the applications to log the data they collect to your Dropbox directory. If your computer is stolen then you’ll be able to monitor every key they push and even collect screenshots of whatever they might be doing. This would greatly increase the chances of recovering your computer.

You could alternately setup a security application that would use the computer’s web camera to intermittently capture pictures, storing them in your Dropbox directory. You would then get a mugshot of your computer’s thief! (see next tip) Also you can obtain additional information with other apps via remote control using Hazel, Dropbox and a touch of AppleScript (Mac OSX).

Create a new Hazel directory to monitor and create a new Rule. Name this rule with something meaninful. I’ve set Hazel to recognize a specific file name, run an AppleScript, then delete the file once complete. The next time I can simply drop a file with a specific name to accomplish whatever I’ve created for each action. Here you’ll find some examples:

Collect System Profile Information

The following AppleScript will collect your system’s full profile information, including IP address and other internet/network settings. A text file with the information will be created, named with the current date and time. If your computer is stolen and you have this setup with Hazel, you can collect valuable information that might help retrieve your computer.

You should replace “~/Dropbox/iMac\ Security/iMac_System_Profile_” with the directory you’d like the text file to be stored in and the first part of the name (in this case “iMac_System_Profile_”, the rest being a date stamp.

set curDate to (do shell script "date +%Y-%m-%d")
set curTime to (do shell script "date +%I.%M.%S.%p")
do shell script "/usr/sbin/system_profiler > ~/Dropbox/iMac\ Security/iMac_System_Profile_" & curDate & "_" & curTime & ".txt"

Get Current IP

If you need to collect the current IP of your home computer, you can use the following AppleScript to find it and save it to a text file.

You should replace “~/Dropbox/iMac\ Security/myip_” with the directory you’d like the text file to be stored in and the first part of the name (in this case “iMac_System_Profile_”, the rest being a date stamp.

set curDate to (do shell script "date +%Y-%m-%d")
set curTime to (do shell script "date +%I.%M.%S.%p")
do shell script "curl --silent http://checkip.dyndns.org > ~/Dropbox/iMac\ Security/myip_" & curDate & "_" & curTime & ".txt"

Open Any Application

Want to remotely launch an app on your home computer? The following script will pull the name of an app that you choose from a text file using the process mentioned above with Hazel. You can launch any app so long as you know its name.

For example, mine is setup such that when Hazel recognizes a new text file starting with “#Open_” within a specific Dropbox directory, it will take the second part of the text file name and launch the appropriate app. To launch Safari, I would use a text file named “#Open_Safari”.

set file_path to theFile as text
try
set text item delimiters to ":"
set file_name to last text item of file_path
set text item delimiters to ""
on error
set text item delimiters to ""
end try
set theApp to text ((offset of "_" in file_name) + 1) thru -1 of file_name
tell application theApp to activate

Quit Any Running Application

Forget to close an app on your home computer before leaving? The following script will pull the name of an app that you choose from a text file using the process mentioned above with Hazel. You can quit any app so long as you know its name.

For example, mine is setup such that when Hazel recognizes a new text file starting with “#Quit_” within a specific Dropbox directory, it will take the second part of the text file name and quit the appropriate app. To quit Safari, I would use a text file named “#Quit_Safari”.

set file_path to theFile as text
try
set text item delimiters to ":"
set file_name to last text item of file_path
set text item delimiters to ""
on error
set text item delimiters to ""
end try
set theApp to text ((offset of "_" in file_name) + 1) thru -1 of file_name
tell application theApp to quit

Take Screenshot

To take a single screenshot, use the following AppleScript.
You should replace “~/Desktop/Screen\ shot\ ” with the directory and name you’d like the image file to be stored in and the first part of the name (in this case “Screen\ shot\ “, the rest being a date stamp. This script works for dual screen screenshots.

set curDate to (do shell script "date +%Y-%m-%d")
set curTime to (do shell script "date +%I.%M.%S.%p")
set loc to "~/Desktop/Screen\ shot\ "
set f to ".png"
set ss1 to loc & curDate & "\ at\ " & curTime & f
set ss2 to loc & curDate & "\ at\ " & curTime & "_2" & f
do shell script "screencapture " & ss1 & " " & ss2

Take Timed Screenshots with 30 second Delay

Maybe someone stole your computer and you’d like to take screenshots every 30 seconds for a certain period of time? Use the following AppleScript to do so. You can change the delay time between repeat runs, as well as the number of times the script should re-run itself.

You should replace “~/Dropbox/iMac\ Security/Timed\ Screenshots/Screen\ shot\ ” with the directory and name you’d like the image file to be stored in and the first part of the name (in this case “Screen\ shot\ “, the rest being a date stamp. This script works for dual screen screenshots.

repeat 2 times
set curDate to (do shell script "date +%Y-%m-%d")
set curTime to (do shell script "date +%I.%M.%S.%p")
set loc to "~/Dropbox/iMac\ Security/Timed\ Screenshots/Screen\ shot\ "
set f to ".png"
set ss1 to loc & curDate & "\ at\ " & curTime & f
set ss2 to loc & curDate & "\ at\ " & curTime & "_2" & f
do shell script "screencapture " & ss1 & " " & ss2
delay (30) -- delay 30 seconds
end repeat

These are just some examples, searching the web for AppleScrips, you can find code to get the location (Lon and Lat)’ of your Mac if it has Wifi on (to even turn it on if doesn’t and enable location services).

Attribution: Jarel Remick @ http://web.appstorm.net/roundups/data-management-roundups/the-ultimate-dropbox-toolkit-guide/

Share the Knowledge!

Helpful(0) Unhelpful(0)