// FALTA DETECTAR QUE EL TEXTO QUE ENVIEN NO SEA DEMASIADO GRANDE.
// FALTA DETECTAR POR IP QUE NO ENVIE UN TEXTO VARIAS VECES Y ME JODAN EL SERVIDOR.
include_once("../public/ZTDCounter/functions.inc.php");
include_once("../public/ZTDCounter/config.inc.php");
include_once("../enviar_mensaje/ip2country.inc.php");
$filename = "/public/ZTDCounter/logs/mensajes.htm";
// --- open list
$ForReading=1;
$Create=false;
$DetectedFlag=0;
$dBanFileName=$DOCUMENT_ROOT.$MainDirPath.$fileIPbanned;
// INICIO COMPROBACION CAPTCHA
$captchaOK=0;
$numero_magico2 = htmlspecialchars($numerito);
$captchaUsuario2 = htmlspecialchars($numerico);
switch ($numero_magico2) {
case "cheyr739s":
if ($captchaUsuario2=="e189d") {
$captchaOK=1;
}
break;
case "c3hduei89":
if ($captchaUsuario2=="f243e") {
$captchaOK=1;
}
break;
case "cldkifhje":
if ($captchaUsuario2=="w348w") {
$captchaOK=1;
}
break;
case "cjskieodj":
if ($captchaUsuario2=="t11e5") {
$captchaOK=1;
}
break;
case "cwiosjdke":
if ($captchaUsuario2=="x19w2") {
$captchaOK=1;
}
break;
case "c8d9jkelr":
if ($captchaUsuario2=="4wykx") {
$captchaOK=1;
}
break;
case "ceousbxn8":
if ($captchaUsuario2=="5xhm3") {
$captchaOK=1;
}
break;
case "c9djkeuri":
if ($captchaUsuario2=="rxan7") {
$captchaOK=1;
}
break;
case "c3uie78ry":
if ($captchaUsuario2=="z5z5k") {
$captchaOK=1;
}
break;
}
//echo "
captchaUsuario: ".captchaUsuario;
//echo "
numero_magico: ".$numero_magico;
//echo "
captchaOK: ".$captchaOK;
// FINAL COMPROBACION CAPTCHA
function TearDropIPDetector($fvIP, $fvIPproxy) {
// --- Check if exist the file with the Teardrops-IP (by default: guarding.www)
extract($GLOBALS);
if (file_exists($dBanFileName)) {
$dOTF=fopen($dBanFileName,"r");
// --- loop for read the list, line to line
if (!feof($dOTF)) {
//print("IF");
while(!feof($dOTF)) {
//print("WHILE");
$dStrLine=fgets($dOTF);
// --- Put chains in arrays.
$textLine=explode(":",trim($dStrLine));
$range=explode("-",trim($textLine[1]));
$test1=inRange($fvIP,$range[0],$range[1]);
$test2=inRange($fvIPproxy,$range[0],$range[1]);
// print("
inrange: ".inRange($fvIP,$range[0],$range[1])."--=(".$fvIPproxy."---".$range[0]."---".$range[1].")=--");
// print(inRange($fvIPproxy,$range[0],$range[1]));
/*
// Show debug message, if is active.
if ($debugmsg) {
print "Detected: ".$textLine[0]." (Range: ".$range[0]." - ".$range[1].")
";
print "
vIP: ".$fvIP."
vIPproxy: ".$fvIPproxy."
textLine: ".$textLine[0]."
saveCountActive: ".$saveCountActive."
vUserAgent: ".$vUserAgent.$vOperSystem."
vLang: ".$vLang."
vOrigen:".$vOrigen."
";
}
*/
// --- Compare vIP and vIPproxy, with IP range from the list.
if (($test1==1) OR ($test2==1)) {
if ($test1==1) {
// print ("test1");
return ($fvIP.":".$textLine[0]);
} else {
// print ("test2");
return ($fvIPproxy.":".$textLine[0]);
}
// --- TeardropIP detected!
// Save it in log, if is active
// if ($saveLogActive) $tempif=writeLog($vIP, $vIPproxy, $textLine[0], $saveCountActive, $vUserAgent.$vOperSystem, $vLang, $vOrigen);
// ...and redirect, if is active.
// if (($alterpage!="") && (!$antiRedirect)) header("Location: ".$alterpage);
}
}
// Show debug message, if is active.
// if ($debugmsg) print "
Your IP: ".$fvIP."
Your IPproxy: ".$fvIPproxy."
";
}
// close file
fclose($dOTF);
} else {
if ($debugmsg) print "
".$C_THE_FILE." guarding.p2p ".$C_DONT_EXIST."!!
";
}
// return ("hello");
}
// $vIP="63.208.194.89"; 202.2.137.14
$vIP=${"REMOTE_ADDR"};
$vIPproxy=GetRealVisitorProxyIP();
$vUserAgent=str_replace(":","|",${"HTTP_USER_AGENT"});
$vOperSystem=str_replace(":","|",${"HTTP_UA_OS"});
$vOrigen=strtolower(str_replace(":","|",${"HTTP_REFERER"}));
$vLang=getLang();
//if $referenc!="" {
$referenc = htmlspecialchars($referen);
//} else {
// $referenc = $_SERVER['HTTP_REFERER'];
//}
//print("HOLAAAAAAAAA: ".$referenc)
$name = htmlspecialchars($nick);
//ereg_replace("<","<",$nick);
// $name = ereg_replace(">",">",$name);
$email = htmlspecialchars($mail);
//ereg_replace("<","<",$mail);
//$email = ereg_replace(">",">",$email);
$msg = htmlspecialchars(stripslashes($mes));
// $msg= $referenc."
Viene de la página:
".$msg;
$msg = ereg_replace("\r\n","
",$msg);
$msg = ereg_replace("\r","
",$msg);
$msg = ereg_replace("\n","
",$msg);
// print("
".$name);
// print("
".$msg."
");
if ((($name!="") OR ($msg!="")) AND $captchaOK==1) {
$IPpositive=$name;
$descr=$msg;
$strFileName=$DOCUMENT_ROOT."/".$filename;
//print("EEEEEEEEEEEE".$strFileName);
if (file_exists($strFileName)) {
$objFile=fopen($strFileName,"r");
// Set value to contents of the file
$arrayFromFile=(fgets($objFile,65535));
fclose($objFile);
}
else {
// If no file exists or its empty start with void string
$arrayFromFile="";
}
// Close the file and destroy the object
$objFile=null;
// Overwrite existing file and get a text stream to new one
$objFile=fopen($strFileName, "a+");
$datanow="".strftime("%m/%d/%Y %H:%M:%S");
$scriptN=${"SCRIPT_NAME"};
$hreferer=str_replace(":","|",$refer);
//$IPDetected="200.124.160.1";
$IPInfo=IP2Country($vIP);
$IPInfo=explode(":" , trim($IPInfo));
$IPproxyInfo=IP2Country($vIPproxy);
$IPproxyInfo=explode(":" , trim($IPproxyInfo));
// print "
IP Origen: ".$vIP." (".$IPInfo[0].")";
// print "
IP rango: ".$IPInfo[1];
// print "
IPproxy Origen: ".$IPproxyInfo[0];
// print "
IPproxy rango: ".$IPproxyInfo[1];
fputs($objFile,"
Message delivered successfully . [Página principal] |
} else { ?>
|