Dit is een printer vriendelijke versie van de webpagina
http://www.ruwebit.net/article/197&print
1999-2008 Maurice de Bijl[Print deze pagina]



how-to's  usb stick
Let your U3 enabled USB stick call home when it's stolen
Vertaal: Tools:Printer vriendelijke versieDownload artikel als PDFBookmark:Geef dit artikel een eKudo
Door Maurice op 2007-02-08 populariteit:
U3 USB sticks are USB sticks that (amongst other functionality) have an auto-run feature. Default an U3 portable application menu has been included. To use other menu applications (like PStart or PortableApps), you can install Autolauncher 4U3

Autolauncher 4U3 can auto-run an application of your choice when the USB stick is inserted.

This opens up some more perspectives. Like for example, an USB stick that calls home when it has been stolen?!

Explain me

Wouldn't it be nice that you receive an E-mail when your USB stick has been used in a computer where it never was used before?

That can be done in this way:

A batchfile that collects information about the computer, opens a website URL and passes that information to the website
A PHP script that sends mail to you or your mobile phone with all the information you need (IP address, computername, username etc)

Requirements:

USB stick with U3 support
Autolauncher 4U3 installed on that stick (see above)
Webserver with PHP support

Example files

start.cmd batchfile
@echo off

rem
rem Check if file with name '%COMPUTERNAME%' already exists
rem If so, skip
rem If not, create it and call home
rem
if EXIST %COMPUTERNAME% goto end
echo. > %COMPUTERNAME%
start /min http://www.yoursite.com/callinghome.php?username:"%USERNAME%"__computername:"%COMPUTERNAME%"__domain:"%USERDOMAIN%"__dnsdomain:"%USERDNSDOMAIN%"__home:"%HOME%"

:end
rem
rem Start your portable application menu
rem eg. PStart or PortableApps
rem
start ProgramsPStart.exe

callinghome.php script
<?
$strTo = "youremail(at)address(dot)com";
$strSubject = "USB stick is calling home";
$strHeaders = "From: USB stick <youremail(at)address(dot)com>";
$strBodyText = "IP address: ".$_SERVER;
$strBodyText .= $_REQUEST;

mail($strTo, $strSubject, $strBodyText, $strHeaders);
?>

<!-- This last line redirects to another site, hoping the 'user' doesn't notice anything -->
<meta http-equiv="refresh" content="0; url=http://www.google.com/">

And now what

Change the E-mail address youremail(at)address(dot)com in the script into your own
Put the script on a webserver with PHP support
Change the batchfile by replacing http://www.yoursite.com/callinghome.php with the URL of your script
Now, configure Autolauncher 4U3 to auto-run the start.bat file.
Let someone steal your USB stick to test it
Site's contents and design are copyright © 1999-2008 Maurice de Bijl - 10005 page requests
gegeneerd op Tue, 06 Jan 2009 05:49:14 CET (GMT+0100) in 198.02 msec op host srv010106.webreus.nl
bron: http://www.ruwebit.net/article/197&print - rev# 1:23M - [Lage bandbreedte versie]