SHARE
TWEET

Untitled

a guest Jul 17th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {echo('\nMSIE');}
  3.  elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== FALSE){echo('\nTrident');}
  4.  elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE){echo('\nFirefox');}
  5.  elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE){echo('Chrome\n');}
  6.  elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== FALSE){echo('\nOpera Mini');}
  7.  elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== FALSE){echo('\nOpera');}
  8.  elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== FALSE){echo('\nSafari');}
  9.  elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== FALSE){echo('\nMozilla');} // so our script or anything isn't viewable by google and all these browsers
  10. $protocol = $_SERVER['SERVER_PROTOCOL'];
  11. $ip = $_SERVER['REMOTE_ADDR'];
  12. $port = $_SERVER['REMOTE_PORT'];
  13. $agent = $_SERVER['HTTP_USER_AGENT'];
  14. $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
  15. $NewbLol = array("");
  16. $keys = array("SmellyPooPoo","Tgay");
  17. $ActualIp = $_GET["Ip"];
  18. $sub = $_GET["key"];
  19. $userId = $_GET["UserId"];
  20. $userName = $_GET["UserName"];
  21. // File paths (Make sure these paths are in your database)
  22. $WhitelistedIps = 'KeysAndIps/WhitelistedIps.txt';
  23. $BlacklistedIps = 'KeysAndIps/BlacklistedIps.txt';
  24. $BlacklistedKeys = 'KeysAndIps/BlacklistedKeys.txt';
  25. $Logger = 'KeysAndIps/Important/AllLogs.txt';
  26. // File Contents
  27. $Conts1 = file_get_contents($WhitelistedIps);
  28. $Conts2 = file_get_contents($BlacklistedIps);
  29. $Conts3 = file_get_contents($BlacklistedKeys);
  30.  
  31. // IN THE EVENT OF SOMEONE CRACKING YOUR SCRIPT, SET THIS TO TRUE
  32. $lol_nah = false;
  33. // You can remove the lines with file_put_contents but I would keep them because they log everything. They are important to keep track of what's happening and for security.
  34. if ($lol_nah === true) {
  35.     echo "lol nah";
  36.     file_put_contents($Logger, "\n".date('h:i:s A, m/d/y')." \n Player tried to login but whitelist disabled. \nKey; ".$sub." \nPlr Ip: ".$AcutalIp." \nUsername: ".$userName." \nUserid: ".$userId."\n---------------------------------------------------", FILE_APPEND | LOCK_EX);
  37.     exit();
  38. }
  39.  
  40. if (strpos($Conts2, $ActualIp) !== false) {
  41.     echo "Blacklisted";
  42.     file_put_contents($Logger, "\n".date('h:i:s A, m/d/y')." \nPlr Ip is blacklisted. \nKey: ".$sub." \nPlr Ip: ".$ActualIp. " \nUsername: ".$userName." \nUserid: ".$userId."\n---------------------------------------------------", FILE_APPEND | LOCK_EX);
  43.     exit();
  44. }
  45. if (strpos($Conts3, $sub) !== false) {
  46.     echo "Blacklisted";
  47.     file_put_contents($Logger, "\n".date('h:i:s A, m/d/y')." \nKey used is a blacklisted key. \nKey: ".$sub." \nPlr Ip: ".$ActualIp. " \nUsername: ".$userName." \nUserid: ".$userId."\n---------------------------------------------------", FILE_APPEND | LOCK_EX);
  48.     exit();
  49. }
  50. // Whitelist Check
  51. if (strpos($Conts1, $ActualIp) !== false) {
  52.     echo "Whitelisted";
  53.     file_put_contents($Logger, "\n".date('h:i:s A, m/d/y')." \nPlayer has logged in succesfully. \nKey: ".$sub." \nPlr Ip: ".$ActualIp. " \nUsername: ".$userName." \nUserid: ".$userId."\n---------------------------------------------------", FILE_APPEND | LOCK_EX);
  54.     exit();
  55. } else {
  56.     echo "Not Whitelisted";
  57.     file_put_contents($Logger, "\n".date('h:i:s A, m/d/y')." \nPlayer's ip isnt whitelisted. Redirected to whitelister. \nKey: ".$sub." \nPlr Ip: ".$ActualIp. " \nUsername: ".$userName." \nUserid: ".$userId."\n---------------------------------------------------", FILE_APPEND | LOCK_EX);
  58.     exit();
  59. }
  60. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top