Slashdot Mirror


Free Software Tracking a Stolen Computer?

JeffTL asks: "By necessity, I carry around an Apple iBook running OS X Panther. In the event of its theft, I would like to have the thing send me its IP address, not only for the benefit of law enforcement but also so I could SSH in and trash my personal data with srm, while doing an SFTP backup of anything I forgot to back up. I am not really wanting a subscription, so I am looking for a free-as-in-beer (and if anything beyond a shell script is involved, free-as-in-speech would be much preferred to make sure that no one else is getting anything). Currently, I have a bash script that can create a report, and I am thinking about sending it using either e-mail or FTP. I am considering setting it up to where it only starts barraging me if a specific code is posted to an HTML document of my choice. Is there already something like this in existence somewhere for free? If not, does anyone have any pointers on how this can be done?"

35 of 137 comments (clear)

  1. www.no-ip.com by itsme1234 · · Score: 3, Interesting

    ... is just what you're looking for. I strongly recommend encryption and backups though.

  2. A few suggestions... by eyeball · · Score: 5, Insightful

    If you are going to roll your own, I would suggest setting up a script on the laptop so that if it detects it has been stolen (i.e.: by checking if a website has a special message from you), and if so, connect to a secure ssh server as a client (using public key authentication so it can connect without a password), making sure you use the options to set a TCP tunnel going back to your laptop (to port 22, or perhaps VNC port, or multiple ones). In other words, have the laptop automatically ssh to a stationary server, and establish a tunnel back the other way that you can then use to get in. This way if someone runs it behind a nat device, or even installs a firewall, you can still get in.

    Another thing you might want to look at is using an IM protocol with the language of your choice, and allowing remote command execution (with certain precautions such as command signing with a private key). For example, grab the Perl AIM module, create a server, add some way to sign commands (i.e.: if ( md5($msg . 'someprivate') eq $msg_key ) { shell($msg); } or something like that -- that's just off the top of my head so it may not be perfect).

    --

    _______
    2B1ASK1
    1. Re:A few suggestions... by rufus0815 · · Score: 2, Informative

      Nice idea! And if OSX has ifup/ifdown scripts for the network interfaces (like in e.g. Debian) it's easy to get you laptop to automatically set up a tunnel whenever the network interface is brought up :-)

    2. Re:A few suggestions... by teridon · · Score: 2, Insightful
      connect to a secure ssh server as a client (using public key authentication so it can connect without a password)

      Keep in my mind that this will give free access to the "secure ssh server" to the laptop's new "owner". (i.e. if he discovers your tunnel he then has access to the shell on your ssh server as well as your laptop).

      --
      I hold it, that a little rebellion, now and then, is a good thing. -- Thomas Jefferson
    3. Re:A few suggestions... by Chilltowner · · Score: 2, Insightful

      Admittedly, this is slightly (only slightly) off topic, but how does one do that with the ssh tunnel, so you can go back in from outside the computer that started the ssh session? I've been trying to do something similiar to what the original poster is attempting, but I haven't had any luck. What are the ssh command options for it?

    4. Re:A few suggestions... by WayneConrad · · Score: 4, Informative

      Admittedly, this is slightly (only slightly) off topic, but how does one do that with the ssh tunnel, so you can go back in from outside the computer that started the ssh session?

      Here's one way. I'll ssh from mercury to ceres so that ceres can ssh back to mercury.

      First ssh from mercury to ceres:

      wconrad@mercury:~$ ssh -R 5555:127.0.0.1:22 ceres
      Linux ceres 2.4.20-1-k6 #1 Sat Mar 22 14:38:19 EST 2003 i586 GNU/Linux

      Last login: Sat May 8 08:11:00 2004 from mercury.galaxy
      wconrad@ceres:~$

      The "-R 5555:127.0.0.1:22" switch means, "on the remote end (ceres), please make port 5555 connect to 127.0.0.1 (mercury), port 22 (ssh)."

      Now, on ceres:

      wconrad@ceres:~$ ssh -p 5555 127.0.0.1
      Password:
      Linux mercury 2.4.23-1-k7 #1 Mon Dec 1 00:05:09 EST 2003 i686 GNU/Linux

      Last login: Sat May 8 08:11:47 2004 from localhost
      wconrad@mercury:~$

      This says to ssh to port 5555 on ceres, which is really the ssh tunnel established by the ssh we did into ceres from mercury.

      SSH tunneling is a many-splendered thing.

    5. Re:A few suggestions... by MCron · · Score: 2, Informative

      About using an IM protocol... A friend of mine recently installed a computer in his car for the purpose of playing his MP3's off of it. I wrote up a small program that reports whenever it is connected to the internet with a new (external) IP. To do this, it logs into AIM using some custom code (though Perl:AIM will work just fine). The one downside to using AIM is the reliance on this friend being signed on at the time, so I have the message, containing the external and internal IPs routed through DoorManBot (Check the site out or the SN DoorManBot3 if you haven't used it) to ensure that they are notified. The program stays connected to AIM, creating a tunnel through any possible firewalls that may be in the way, and will execute commands coming from any of a set of Screen Names (keyed to his ScreenNames, as opposed to signing each message going out, so he can execute commands as if he were at the command prompt). I hope this shows how AIM can be useful for creating a backup back-door

      --
      Send offline messages on AIM with DoorManBot
  3. dyndns.org by OmniVector · · Score: 4, Interesting

    the client is nice, and works great in os x. one thing you have to consider though is if your laptop gets stolen, there's a very high chance the hard drive will be wiped before the thief even gets a chance to boot your old machine. besides, if you password protect your login (which you should) then they won't get anywhere and will need to format in the first place.

    --
    - tristan
    1. Re:dyndns.org by Johnny+Mnemonic · · Score: 2, Insightful


      Disable single user mode. You can also disable the ability to boot from CDs and Firewire disk mode; it's called "Firmware password."

      --

      --
      $tar -xvf .sig.tar
  4. Just wait for Apple DirectProtect by Anonymous Coward · · Score: 5, Funny

    It will cost $199, but will have very cool design and play beautiful music on your cell phone when the laptop gets stolen.

  5. Very simple possibility by cybermace5 · · Score: 5, Insightful

    The odds are maybe 50/50 that a person stealing your laptop would have a clue to avoid something like this. If they do consider this, they'll wipe your disk clean at the earliest possibility, in the absence of a network connection. Get rid of the evidence.

    If this is a kid who plans to pawn it or sell it on eBay, or possibly just use it, they might plug it in to make sure the Internet works. What's the first thing they'll run? The web browser. It's just a web browser, that couldn't hurt right?

    All you have to do is set the browser's home page to a page on your own site, not linked from anywhere else. If your laptop gets stolen, you could activate some PHP in that page to send you an email or SMS. The IP address will be logged, so you can (maybe) SSH in and do your dirty work. If the user has a firewall, that would be a problem.

    But anyway, this is a pretty easy way to do it. You could even just start up the web browser on boot, and if they are on the Internet, they're nailed.

    --
    ...
    1. Re:Very simple possibility by Goo.cc · · Score: 2, Funny

      If you don't want to have the computer slicked immediately, install a bunch of porn on it. That will keep them too busy to reinstall the OS!

  6. Isn't a custom BIOS needed? by ChaseTec · · Score: 4, Interesting

    Like most people are pointing out there is a good chance the the drive is erased before even being booted. So wouldn't a custom bios be needed with all the reporting tools, dhcp clients, etc? Besides LinuxBIOS anyone have any data about adding custom programs to a BIOS?

    A quick search turned up this which seems like a good idea. Also this site discusses varies ideas to make theft and reselling more difficult.

    --
    My Hello World is 512 bytes. But it's also a valid Fat12 boot sector, Fat12 file reader, and Pmode routine.
    1. Re:Isn't a custom BIOS needed? by Per+Wigren · · Score: 2, Informative

      No need to mess with the BIOS, your bootloader could do the work.

      Not if the disk is whiped clean before boot. :P

      --
      My other account has a 3-digit UID.
  7. Use a web page? by NanoGator · · Score: 3, Interesting

    You could always set up a web page that tracks the IP of whoever hits it. Set up the laptop to automatically go to that page when it boots. (Maybe give it a magic forwarder that sends it to Google News or something after it's visited?) Then you at least get the IP. If you wanted to be snazzier, you could also have it read the HTML that comes down and look for a self destruct message. I'm not sure how you'd do this with the Mac, but I imagine it's not too hard. In the Windows world, I'd just write a little VB app to do that, wouldn't take very long.

    --
    "Derp de derp."
  8. Re:Easy way out by Sancho · · Score: 5, Funny

    Good idea!
    ifconfig | mail -s YOUR LAPTOP WAS STOLEN email@isp.com

    mutt
    eth0 Link encap:Ethernet HWaddr DE:AD:BE:AF:00:00
    inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:14883222 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6501247 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:3309542786 (3.0 GiB) TX bytes:385138942 (367.2 MiB)
    Base address:0xbc00 Memory:fc9e0000-fca00000

    Whoo, now I can get my laptop back!

    (of course, you could trace the email, but that's too easy :P)

  9. dyndns? by jkakar · · Score: 2, Insightful

    You may consider using something like ddclient and dyndns.org. You can setup ddclient to check the state of the machine's IP address at any interval you want. When the IP address changes ddclient notifies dyndns.org to update DNS records. It runs as a daemon so it shouldn't be too hard to make it start up everytime your machine boots. When running you can monitor the machine's IP address from the dyndns.org website.

    Of course, this doesn't do anything to help you get into the machine if it's behind a NAT or other barrier. It could help with spotting the IP, though.

  10. Why not... by burns210 · · Score: 4, Interesting

    Here is a novel idea... set your laptop to not show user icons(and thus give the person your screenname) and not auto login... THEN, set your home directory to be encrypted using a strong(STRONG!) password using... YUP, the builtin File Vault technology. Make a good backup before you encrypt, then setup regular off-laptop backups while it is encrypted.

    If that isn't good enough for you, and i don't see why it wouldn't be, have your web browser's home page(or an applescript that runs every time it verifies a network connection) to post to a 'secret' webpage you have on your site... have it post its information(ip, blah blah) and timestamp it... this way, you have a clear record every time the laptop has a connection, and you can just take note whenever it has an entry while NOT in your posession.

  11. Pack it with thermite! by zcat_NZ · · Score: 5, Funny

    If you really want to be secure pack the free space in your laptop with sealed plastic bags of thermite. Wire a detonation circuit to recognise a special code from spare pins on the inside of the parallel port (basically, an electronic hardware interlock so it can't possibly go off accidentally) and have it read from a special URL every time the network comes up. If the correct code is present your laptop becomes worthless to the thief in very short order. With a bit of luck, he's got it on his lap at the time and won't be stealing any more laptops for a while.

    Or you could just use a crypto filesystem to protect your data, and claim the stolen laptop on your household insurance..

    --
    455fe10422ca29c4933f95052b792ab2
    1. Re:Pack it with thermite! by Anonymous Coward · · Score: 2, Funny

      Just as effective - put some builder's putty in the few spare gaps in your laptop - don't forget to add some wires attached to some old LED's or transistors stuck in the putty. Any thief is going to have the time of their life going through an airport.

  12. Do it like this, for example by arcade · · Score: 4, Informative

    Create a cronjob for root:

    crontab -e
    0 * * * * /usr/local/bin/checkWeb.sh

    The file /usr/local/bin/checkWeb.sh could contain:
    #!/usr/bin/bash

    wget http://your.host.name/stolenweb.html

    if grep "It is stolen" stolenweb.html ; then
    [generatereports and send it off]
    fi

    rm stolenweb.html

    It's a really rather simple setup that checks the webpage once each hour. If the webpage contains "It is stolen", then you do the reports-generating and whatever.

    --
    "Rune Kristian Viken" - http://www.nwo.no - arca
  13. Give me a break by dedazo · · Score: 5, Insightful
    Use a physical lock. Take care of your laptop (what, are you assuming that it will be stolen?). Use an encrypted filesystem. Do some sort of dead man's switch where the wrong logon will wipe your data.

    Expecting that whomever steals it will merrily go home and plug it into an ethernet jack is a bit too much, I think.

    --
    Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
  14. Re:*nix it by yuri+benjamin · · Score: 2, Informative

    cron a bash script. /sbin/ifconfig | mail you@where.com

    If they're behind a NAT, you'll get an email that says the IP address is something like 192.168.x.x or 10.x.x.x
    That won't be very useful.

    How about
    /sbin/traceroute www.slashdot.org | mail you@where.com
    perhaps?

    --
    You make the mistake of thinking you can educate the fundamental stupidity out of people. You can't.
  15. Re:*nix it by DrSkwid · · Score: 3, Informative

    time to take SMTP mail 101

    If behind a NAT the heders will reveal the external IP of the originating network, *not* the internal IP of the client machine.

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  16. Re:why bother, make it a paper weight. by DrSkwid · · Score: 4, Interesting


    lol, if you think some lame BIOS password you could well have a stiff surprise waiting the day they take the HD out!

    Without encryption
    Physical access == data access

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  17. Re:My useless reply by HeghmoH · · Score: 3, Informative

    He used Timbuktu to get onto the machine. Using that keyword helps get results back from Google. It was actually a story on slashdot, here. The link in the story is slightly broken, but it's just moved a bit: the story.

    --
    Mod down posts with a "Free Mac Mini/iPod" sig, they're spam!
  18. cronjob for dynamic IP address reporting by dimss · · Score: 2, Interesting

    One of my servers at very remote location is connected to ADSL with dynamic IP address. Simple cronjob reports its IP-address every ten minutes. It is wget requesting special CGI-script which writes remote IP-address to text file.

    This scheme should work fine for stolen computer unless they disable this cronjob (or whatever in other OSes) or reinstall software completely.

  19. You can do a bunch of things. by abulafia · · Score: 2, Insightful
    The most straightforward for this sort of thing might be

    ssh user@somewhere.com "ssh `gethostip -d [machine name]`"

    Set up your keys correctly, of course.
    Of course, this can cause problems if the thief is clueful and bothers to poke around.

    Netcat could also be very helpful here.

    --
    I forget what 8 was for.
  20. Good ideas above, but review... by rusty0101 · · Score: 5, Informative

    System: Apple iBook running OS X Panther.

    Start by checking the apple.com website and see what options you should begin with. One observation above is to use File Vault to secure your personal data. This is all well and good, but it makes it tough to take one of the later steps.

    In the event of its theft, I would like to have the thing send me its IP address

    As has been noted this is not difficult. Set up a cron job, or even a boot job to find out the laptop's IP address (ifconfig |grep inet |mail me@myisp.com -s 'iBook's IP") and you get the ip on the lan in the body of the e-mail, and the external IP in the headers. Presuming smtp is not blocked. If you install the perl libraries for Jabber, you could even send a jabber message via a similar process.

    ... also so I could SSH in and trash my personal data with srm, while doing an SFTP backup of anything I forgot to back up.

    Note that if you have been rsync on a regular basis to backup your personal data, which can be done across an ssh session, you may not need to do any sftp backups, and you could have a cron job take care of this so you are covered.

    Several of the posters above have noted that you could use wget to pull down a "hidden" page on your personal web server with instructions. For that matter you could build a script that would be posted to that page, perhaps with a marker character before each line, (such ah $) that you grep out of the downloaded page, cut the first character out of the line, then save it with a random name, chmod the file to executable, then execute it. At that point the script could be doing anything you ask of such a script. Including downloading executables, and even running 'dd -if=/dev/null -of=/dev/disk0' to wipe the hd yourself.

    Elsewhere others have noted that if the thief wipes your hard drive before they re-boot it, none of this works. That's as good of a reason as any to schedule backups of your personal data. It won't help you recover the laptop, or tell the police where the laptop is, but at least you have your personal data.

    This also won't help if your laptop is not connected to a network of some sort. If they pull your HD and toss it into a second computer as a secondary drive, then you will want to have all of your data in a 'file vault' to restrict access. Sure with enough time they can break the encryption, and ultimately start performing identity theft on you, but the time involved is unlikely to be worth it to such a person. It's far more likely that they will wipe the drive, pawn the laptop, and hunt for another laptop that is not going to take so much effort to access the user information on.

    Then again, these are just my opinions. I have been known to be wrong, so I do wish you good luck.

    -Rusty

    --
    You never know...
  21. Assume you'll never get it back by invisik · · Score: 3, Insightful

    I don't think it's realistic to assume you will get your machine back.

    1. Perform regular backups. You'll have all your data, so you don't care about getting that back.

    2. Use filsystem encryption software. Built-in, aftermarket, whatever. Ensures they can't put your hard drive in another machine. If you're that worried about it, use VNC or remote desktop to control a system at your office/house and never store any information on your local machine.

    3. Have insurance on it. Homeowners, business, whatever, just so you don't have to pay to buy another one.

    Otherwise, I say they can keep it and I'll just get another one. I wouldn't mind having a faster laptop anyway. :)

    One question for everyone out there, do you know the serial number of your laptop? I can't imagine anyone has that written down somewhere safe. How can the police prove the laptop is yours if you only know it's your because it has a SuSE sticker on the lid?

    It doesn't hurt to have BIOS and power-on passwords either. The casual theif will not be able to get past them and will probably dump the unit somewhere or possibly try to return it saying "they found it" somewhere. Never use auto-login and use good passwords on your account.

    IBM has some good laptop security features out there now. I believe part of it is some sort of hardware encryption for your hard drive. Not sure what Apple has, but IBM has definately stepped up to the plate.

    Good luck.

    -m

    --
    http://www.invisik.com
  22. Re:Easy way out by asteinberg · · Score: 2, Interesting

    Hmm, I've actually been thinking about setting up something similar. The catch is that I have a Sony Picturebook with a built in camera. I'm thinking about setting it to automatically take a picture any time someone opens/boots it and emailing me the picture. Maybe also if they type a bad password? (How do I set a script to run on bad password entry??) Possibly helping the situation is that I just leave a wireless card plugged in and here on campus anywhere I take the laptop is likely to have wireless.

    I could imagine a scenario where I accidentally leave it somewhere for a minute, someone walks up to it, sees it, opens it up, likes what he sees, and runs away with it. As long as they don't pull the wireless card before opening it and open it while still in an area with wireless coverage, I think I should be golden. Also, if they ever try to use the wireless card anywhere on campus again I could easily find out where the MAC address is being used from through the DHCP server's logs. Anyone see any holes in my plan?

    --
    The first ever Ultimate Frisbee video game: here (now
  23. Re:why bother, make it a paper weight. by elemental23 · · Score: 2, Informative

    lol, if the thief thinks taking the hard drive out will give them data access they'll have a stiff surprise waiting the day they try it.

    At home and away, keep your valuable documents safe with powerful AES-128 encryption. FileVault automatically encrypts and decrypts the contents of your home directory on the fly.

    --
    I like my women like my coffee... pale and bitter.
  24. Serial Number by TheBard758 · · Score: 4, Informative

    In addition to one of these "mailer" ideas, might I suggest having some "hard" evidence that it is, indeed, your computer (besides it having gone to the page that you asked it to or whatever).

    Make it send you the serial number :) My iBook is insured with the rental company where I got it (I'm poor, but I still gotta have a mac!). The first thing they ask for on a claim is "serial number", so this may be perfect, really.

    Check out this link on macosxhints: http://www.macosxhints.com/article.php?story=20040 330144040245#comments

    It describes how to write a bash script to get your machine serial number! Very, very cool.

    BOL

    Bard

  25. I used to do that! by MarcQuadra · · Score: 4, Interesting

    I never stole anything in my life, but for a while a few years ago I was helping some 'questionable' friends wipe out machines of 'questionable' origin. At the time it was a way to feed myseld and get deals on hardware, I'm not into that sort of thing anymore.

    You can be SURE that if a laptop gets stolen, the kids that wiped it are going to take it straight to their local geek who will boot the machine off a CD and wipe the drive. Usually stolen goods go right into local low-level organized-crime units for 'laundering' and appraisal.

    My advice is to not allow your iBook to get stolen in the first place. I tote my PBG4 AL with me everywhere I go, it's never out-of-sight, not even when I hit the bathroom at my local coffee joint. Do backups and get homeowners/renters insurance on it and encrypt your home folder.

    --
    "Sometimes, I think Trent just needs a cup of hot chocolate and a blankie." -Tori Amos on Nine Inch Nails
  26. Just like an alarm sticker on a car by TEMMiNK · · Score: 2, Funny

    Just get a big vinyl sticker that says "Protected With GPS Tracking by GPSecure" even though this company doesnt exist, anyone scoping your laptop would think twice about it. They would only steal it if they wanted your data for some special purpose.

    --
    "The stupider people think you are, the more surprised they will be when you kill them..."