miércoles, 10 de mayo de 2017

simple log remote host dynip's

puship.php



//  simple log remote host dynip's
//  http://server/puship/puship.php?host=xx33ss
//  http://server/puship/puship.php?host=xx33ss&ip=6.6.6.6

$validhosts=array("xx33ss","mt55kdc","d55c");

$host=$_GET['host'];
$ip=$_GET['ip'];

file_put_contents("1.txt",'_'."$host.txt");

if (in_array($host,$validhosts)) {
    file_put_contents("$host.txt",$_SERVER['REMOTE_ADDR']. ' '.$_GET['ip']  .date(" Y-m-d H:i:s"));
}




in server with dinamic ip

/etc/cron.hourly
push_ip.sh

lynx  -dump http://7.7.7.7/puship/puship.php?host=xx33ss

or /etc/crontab
19 *<-->* * *  root  /usr/bin/lynx  -dump http://181.15.95.123/puship/puship.php?host=xx33ss >/dev/null


the script  create this file:
http://7.7.7.7/puship/xx33ss.txt



No hay comentarios: