Thursday, March 7, 2013

Tracking a Stolen Device with Prey Project

Prey Project (http://preyproject.com/) is an open source application that allows you to track your device (phone, laptop or tablet) in case it gets stolen. It works on multiple platforms and it's pretty easy to setup.

Here's an intro video to get you familiar:


The project provides both free and paid accounts depending on your needs... The free account is packed with features and should be more than enough for most users, however it has a limit of 3x devices.

I have set my laptop with the following settings:



And here's what my report looks like. The location was about 16Km off... but as I don't have a built-in GPS on my laptop, that is expected.





1- Installing Prey

You can install prey from the Ubuntu's official repo:

sudo apt-get install prey

Or download the deb file from their site (https://preyproject.com/download):

sudo dpkg -i prey_0.5.9-ubuntu2_all.deb


2- Getting API and Device key

a. Create an account - https://panel.preyproject.com/signup

b. Wait for the email and logon

c. Get your API Key - https://panel.preyproject.com/profile

d. Get a device key by adding a new device (here you can also set what will be monitored) - https://panel.preyproject.com/devices/new


3- Configuring the Device

a. Open the configuration file (/etc/prey/config or /usr/share/prey/config)

b. Complete the following fields
Note: use the command 'echo -n "password" | openssl enc -base64' to hash your email password

api_key='[API KEY]'
device_key='[Device KEY]'


# mailbox to send the report

mail_to='[email address to receive report]'


smtp_username='[email address to send reports]'

smtp_password='[your email password hashed]'

c. Save the file

d. Run the command below to test your configuration

sudo /usr/share/prey/prey.sh --check
sudo: unable to resolve host laptop123

 -- CHECK MODE ON.

 ## PREY 0.5.9 spreads its wings!
 ## Linux laptop123 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
 ## Thu Mar  7 16:45:11 EST 2013

 -- Looking for connection...
 -- Got network connection!

 == Verifying Prey installation...

 -- Checking if cron daemon is running...
 -- Cron daemon found.
 -- Checking for crontab entry...
 -- Found!

 == Verifying API and Device keys...

 ** API key is valid. Your user account is correctly set up.
 ** Device key is valid. Good. Current status is missing.

e- If everything went ok, run the following command to start prey

sudo /usr/share/prey/prey.sh

You should now be able to logon to your account and see the device updated. You might want to set the device to missing in order to check the settings (just be careful with the actions part of the device configuration).

No comments: