piterskiy

check white list bots

Dec 28th, 2017
25,313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. set_time_limit(0);
  3. ignore_user_abort(true);
  4. header('Content-Type: text/html; charset=UTF-8');
  5.  
  6. $dbs = glob("whitebot/*.txt", GLOB_NOSORT);
  7.  
  8. foreach ($dbs as $db) {
  9. $ip = basename(trim($db), ".txt");
  10. $hostname = gethostbyaddr($ip);
  11. $ip2 = gethostbyname($hostname);
  12. if ($ip != $ip2) {
  13. echo '<span style="color:red;">'.$ip.' '.$ip2.' '.$hostname.'</span><br>';
  14. } else {
  15. echo '<span style="color:green;">'.$ip.' '.$ip2.' '.$hostname.'</span><br>';
  16. }
  17. }
  18.  
  19. echo 'ok';
Add Comment
Please, Sign In to add comment