Advertisement
Guest User

BLOCKING BAD IPS

a guest
Dec 4th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.34 KB | None | 0 0
  1. <?
  2. $ip = $_SERVER["REMOTE_ADDR"];
  3. $packedIp = @inet_pton($ip);
  4.  
  5. if ($packedIp === false) {
  6.     $text = "\nDeny from $ip";
  7. $filename = ".htaccess";
  8. $fh = fopen($filename, "a");
  9. fwrite($fh, $text);
  10. fclose($fh);
  11.     exit("Invaild connection");
  12. } else if (isset($packedIp[4])) {
  13.  
  14. } else {
  15.     // IPv4
  16. }
  17. if (!isset($_COOKIE["Verified"])) {  
  18. $cookie_name = "Verified";
  19. $cookie_value = "Set Complete";
  20.  
  21. setcookie($cookie_name, $cookie_value, time() + (300 * 1), "/"); // 86400 = 1 day
  22.     $isp = $_SERVER["REMOTE_ADDR"];
  23.     $ua = $_SERVER['HTTP_USER_AGENT'];
  24.     $sw = $_SERVER['SERVER_SOFTWARE'];
  25.     $method = $_SERVER['REQUEST_METHOD'];
  26.     $timestamp = $_SERVER['REQUEST_TIME'];
  27.     $header =  $_SERVER['HTTP_ACCEPT'];
  28.     $returnheader = $_SERVER['HTTP_HOST'];
  29.     $xforwardfor = $_SERVER['HTTP_X_FORWARDED_FOR'];
  30.     //cloudflare stuff
  31.     $cfip = $_SERVER["HTTP_CF_CONNECTING_IP"];
  32.     $country = $_SERVER["HTTP_CF_IPCOUNTRY"];
  33.     $cfray = $_SERVER["HTTP_CF_RAY"];
  34.     $visitor = $_SERVER["HTTP_CF_VISITOR"];
  35.    
  36.    
  37.  
  38. $fp2 = @file_get_contents("http://APIHIDEEN.getipintel.net/check.php?ip=$isp&contact=admin@gatheringofmagic.com&flags=f");
  39. $geo = @file_get_contents("http://api.ipstack.com/$isp?access_key=1ac1ded530c14299a0f56be680677d12&format=1");
  40. if ($fp2 < 0) {
  41. $to = 'admin@gatheringofmagic.com';
  42. $subject = "".$isp." score failed! (Error)";
  43. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Their connection has been identified Error! Don't verifiy!\r\n\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  44. $from = "From: admin@littlesapplication.com";
  45. mail($to,$subject,$message,$from);
  46.  
  47. $to = '19lensguy88@gmail.com';
  48. $subject = "".$isp." score failed! (Error)";
  49. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Their connection has been identified Error! Don't verifiy!\r\n\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  50. $from = "From: admin@littlesapplication.com";
  51. mail($to,$subject,$message,$from);
  52.  
  53. $to = 'rebel.one528@gmail.com';
  54. $subject = "".$isp." score failed! (Error)";
  55. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Their connection has been identified Error! Don't verifiy!\r\n\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  56. $from = "From: admin@littlesapplication.com";
  57. mail($to,$subject,$message,$from);
  58.  
  59. $to = 'marshaljmalone@gmail.com';
  60. $subject = "".$isp." score failed! (Error)";
  61. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Their connection has been identified Error! Don't verifiy!\r\n\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  62. $from = "From: admin@littlesapplication.com";
  63. mail($to,$subject,$message,$from);
  64.  
  65. $to = 'maddieionediscord@gmail.com';
  66. $subject = "".$isp." score failed! (Error)";
  67. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Their connection has been identified Error! Don't verifiy!\r\n\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  68. $from = "From: admin@littlesapplication.com";
  69. mail($to,$subject,$message,$from);
  70.  
  71. $text = "\nDeny from $isp";
  72. $filename = ".htaccess";
  73. $fh = fopen($filename, "a");
  74. fwrite($fh, $text);
  75. fclose($fh);
  76. }
  77.  
  78. if ($fp2 >= 0.56 && $fp2 <= .99) {
  79. $to = 'admin@gatheringofmagic.com';
  80. $subject = "".$isp." score failed! (Bad User!)";
  81. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  82. $from = "From: admin@littlesapplication.com";
  83. mail($to,$subject,$message,$from);
  84.  
  85. $to = '19lensguy88@gmail.com';
  86. $subject = "".$isp." score failed! (Bad User!)";
  87. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  88. $from = "From: admin@littlesapplication.com";
  89. mail($to,$subject,$message,$from);
  90.  
  91. $to = 'rebel.one528@gmail.com';
  92. $subject = "".$isp." score failed! (Bad User!)";
  93. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  94. $from = "From: admin@littlesapplication.com";
  95. mail($to,$subject,$message,$from);
  96.  
  97. $to = 'marshaljmalone@gmail.com';
  98. $subject = "".$isp." score failed! (Bad User!)";
  99. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  100. $from = "From: admin@littlesapplication.com";
  101. mail($to,$subject,$message,$from);
  102.  
  103. $to = 'maddieionediscord@gmail.com';
  104. $subject = "".$isp." score failed! (Bad User!)";
  105. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2."\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  106. $from = "From: admin@littlesapplication.com";
  107. mail($to,$subject,$message,$from);
  108.  
  109. $text = "\nDeny from $isp";
  110. $filename = ".htaccess";
  111. $fh = fopen($filename, "a");
  112. fwrite($fh, $text);
  113. fclose($fh);
  114. }
  115. if ($fp2 >= 1) {
  116. $to = 'admin@gatheringofmagic.com';
  117. $subject = "".$isp." score failed! (VPN)";
  118. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2." and has been identified as a Proxy, VPN or TOR, Do not verifiy!\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  119. $from = "From: admin@littlesapplication.com";
  120. mail($to,$subject,$message,$from);
  121.  
  122. $to = '19lensguy88@gmail.com';
  123. $subject = "".$isp." score failed! (VPN)";
  124. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2." and has been identified as a Proxy, VPN or TOR, Do not verifiy!\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  125. $from = "From: admin@littlesapplication.com";
  126. mail($to,$subject,$message,$from);
  127.  
  128. $to = 'rebel.one528@gmail.com';
  129. $subject = "".$isp." score failed! (VPN)";
  130. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2." and has been identified as a Proxy, VPN or TOR, Do not verifiy!\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  131. $from = "From: admin@littlesapplication.com";
  132. mail($to,$subject,$message,$from);
  133.  
  134. $to = 'marshaljmalone@gmail.com';
  135. $subject = "".$isp." score failed! (VPN)";
  136. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2." and has been identified as a Proxy, VPN or TOR, Do not verifiy!\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  137. $from = "From: admin@littlesapplication.com";
  138. mail($to,$subject,$message,$from);
  139.  
  140. $to = 'maddieionediscord@gmail.com';
  141. $subject = "".$isp." score failed! (VPN)";
  142. $message = "User: ".$isp." Failed the IP check with a score of ".$fp2." and has been identified as a Proxy, VPN or TOR, Do not verifiy!\r\n\r\n\r\n Cloudflare Connection IP: ".$cfip." \r\n Connecting Country: ".$country." \r\n Cloudflare-Ray-Server: ".$cfray." \r\n Visit Information: ".$visitor." \r\n Internet Address: ".$isp." \r\n X-Forward-for: ".$xforwardfor." \r\n\r\n Connecting Method: ".$method." \r\n Time: ".$timestamp." \r\n\r\n HTTP-Header\r\n\r\n ".$header." \r\n ".$returnheader." \r\n\r\n User Agent:\r\n ".$ua." \r\n\r\n Internet Connection Information:\r\n".$geo." \r\n Server Software: ".$sw."";
  143. $from = "From: admin@littlesapplication.com";
  144. mail($to,$subject,$message,$from);
  145.  
  146. $text = "\nDeny from $isp";
  147. $filename = ".htaccess";
  148. $fh = fopen($filename, "a");
  149. fwrite($fh, $text);
  150. fclose($fh);
  151. }
  152. ?>
  153. <p align="center"><iframe src="https://www.123formbuilder.com/form-4372150/i-d-check" height="1200" width="800" align="center" frameBorder="0"></iframe></p>
  154. <!-- Start: Copyright 2018 TraceMyIP.org Service Code (081228-11072018)- DO NOT MODIFY //-->
  155. <div style="line-height:16px;text-align:center;"><script type="text/javascript" src="//s3.tracemyip.org/tracker/lgUrl.php?stlVar2=1302&amp;rgtype=4684NR-IPIB&amp;pidnVar2=47119&amp;prtVar2=1&amp;scvVar2=12"></script><noscript><a href="https://www.tracemyip.org/website-analytics.htm"><img src="//s3.tracemyip.org/tracker/1302/4684NR-IPIB/47119/1/12/ans/" alt="Forum analysis" style="border:0px;"></a></noscript></div> <!-- End: TraceMyIP.org Service Code //-->
  156.  
  157. <?
  158. echo "<meta http-equiv='refresh' content='0;url=http://www.littlesapplication.com'>";
  159.  
  160. }
  161.  
  162. ?>
  163. <p align="center"><iframe src="https://www.123formbuilder.com/form-4372150/i-d-check" height="1200" width="800" align="center" frameBorder="0"></iframe></p>
  164.  
  165. <!-- Start: Copyright 2018 TraceMyIP.org Service Code (081228-11072018)- DO NOT MODIFY //-->
  166. <div style="line-height:16px;text-align:center;"><script type="text/javascript" src="//s3.tracemyip.org/tracker/lgUrl.php?stlVar2=1302&amp;rgtype=4684NR-IPIB&amp;pidnVar2=47119&amp;prtVar2=1&amp;scvVar2=12"></script><noscript><a href="https://www.tracemyip.org/website-analytics.htm"><img src="//s3.tracemyip.org/tracker/1302/4684NR-IPIB/47119/1/12/ans/" alt="Forum analysis" style="border:0px;"></a></noscript></div> <!-- End: TraceMyIP.org Service Code //-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement