Notebook Protection Anti-Theft Tracking System

I found a nice script from a /. user who commented on a article in which some guy found his wife's notebook with the help of Seti@Home. It posted the ip of the thief on the web and with some tracking done by police he found it back.

Nice, so I took the script on the page and modified it a bit for my needs. Remember to change it for your useraccount and your local places because I use a Macintosh to do my stuff

Here is a small documentation what I did:

  1. First, I created a new ssh-key on my local machine.
    bartek@hermes~$ ssh-keygen  -b 2048 -t dsa
    
    Press three times on your Return key. No keyboard, no comment and default save position.
  2. Then, we copy our public key to the nonlogic server via scp.
    bartek@hermes~$ scp ~/.ssh/id_dsa.pub debar@nonlogic.org:~/.ssh/authorized_keys
    
    Note that you have to type in your password to copy it. It will be the last time. :)
  3. Connect to nonlogic via ssh.
    bartek@hermes~$ ssh debar@nonlogic.org
    
    Now it should work without any password. If something failed ask me in the ##nonlogic irc channel.
    Log out from nonlogic.
  4. We have to write a small shell script which does some magic. First, it deletes the old IP and the IPs of the routing machines from the local file .locate-laptop. Then it pastes the current date, the logged in users and the complete dump of the network interfaces into this file. The most important stuff comes now: the script writes the first 15 routing servers from the potential thief to google.com, so even if his connection is pushed through a NAT he is still identifiable.
    Please change the last line of the script according to your username and server. And if you have a *BSD you have to adapt the syntax of the ifconfig.
    Save the file with your fave editor(hopefully VIM) in your local bin folder. Name it callhome.sh and chmod it to be excecutable(755).
    #!/bin/bash
    rm -f ~/.locate-laptop
    date > ~/.locate-laptop
    w >> ~/.locate-laptop
    /sbin/ifconfig -a 2>&1 >> ~/.locate-laptop
    /usr/sbin/traceroute -q 1 -nP ICMP google.com 2>&1 | head -15 >> ~/.locate-laptop
    scp -q ~/.locate-laptop debar@nonlogic.org:~
    
  5. Edit your local crontab. Please change my username and the position of the script according to your system.
    After 27 minutes my system posts the data to the nonlogic server so a thief can hopefully be located by his IP.
    bartek@hermes~$ sudo echo "27 * * * * bartek /Users/bartek/bin/callhome.sh" >> /etc/crontab
    

I know that the thief has to be somewhat unskilled in computers to let this script do it's job but nerds do not steal and after a successful theft he maybe wants to try out the computer and check his email. It is a small chance you can hope for.
Of course, it is the best to not let steal somebody your notebook.
Valid HTML 4.01 Strict