Capturing info and getting it outside pfSense
-
We're currently using pfSense for our "Public" LAN. pfSense was installed by someone else and is on FreeBSD.
I'd like to put some code in the Captive Portal page that gets various info (name via user input, hostname, MAC address, etc).
Once I've captured this info to variables any thoughts on sending it to or making accessible from another LAN?
I've tried dumping to a .txt file, but don't seem to have rights to a web served directory.
I also tried emailing the info via 'php email'. My code worked in a test environment, but not on pfSense/FreeBSD.
I'd appreciate any input. Thanks! - Sgrud
$remoteIp = $_SERVER['REMOTE_ADDR']; $myArp = `arp $remoteIp`; $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); $message = "Hostname:\t$hostname\nAddress Info:\t$myArp"; # to file attempt (file isn't web accessible) $myFile = "CPMaster.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); fwrite($fh, $message); fclose($fh); #email attempt $from = "sysadmin@domain.com"; $headers = "From: $from"; $to = "sysadmin@domain.com"; $subject = "Captive Portal"; ini_set('SMTP',"exchange.domain.com"); mail($to,$subject,$message,$headers);
-
How about using curl to squirt the data over to another box and storing it in a db?