[nSLUG] Nova Scotia internet services

Paul wes902 at gmail.com
Thu Aug 16 11:03:06 ADT 2007


 Did the same sort of idea for a device was traveling around. It only
ran out of rc.local so the traffic was pretty low. To call it just use
http://myhost.com/beacon.php?pass=notsecure

 It would be great to make it a little smarter (ie: check a sqlite db
of authorized hosts) before mailing.

<?php
// beacon.php
//
// Script to allow remote device to beacon home
// Mails the IP of the request along with any
// proxy foward info.

// Set the password to check for and address to alert
$password="notsecure";
$address="alert at yourdomain.com";

$pass=$_GET["pass"];

if ( $pass == $PASSWORD ) {

            // Set the IP's to report back and the date
            $ip=$_SERVER['REMOTE_ADDR'];
	    $forward=$_SERVER["HTTP_X_FORWARDED_FOR"];
 	    $time=date("F j, Y, g:i a");

            $message = "We have a beacon from\nIP: $ip (Forward IP -
$forward )\nTime of impact: $time\n";

            mail($address, 'ALERT - Beacon detected!', $message);
}
?>


On 8/15/07, Jonathan Anderson <jonathan.anderson at ieee.org> wrote:
> On August 15, 2007, Greg Estabrooks wrote:
> >  I run a cron on my machine that auto pulls a URL from a box I have at
> > work. [...] I do the same with my laptops so if one is ever stolen and gets
> > put online before being wiped I can find out where it is.
>
> That is a brilliant idea... I think I'll do that with my laptop.
>
> Do you use any server-side scripting, or do you just look through the Apache
> logs?
>
>
> #!/jon
> --
> Jonathan Anderson
>
> jonathan.anderson at ieee.org
>
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/cgi-bin/mailman/listinfo/nslug
>
>
>



More information about the nSLUG mailing list