Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bic.class.php 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?
  2. /**
  3. * Browser Integrity Check
  4. */
  5. class BIC {
  6. /**
  7. * Browser Integrity Check challenge
  8. */
  9. public static function challenge() {
  10. if (FEATURE_BIC) {
  11. session_start();
  12. if (!isset($_SESSION['_authorized'])) {
  13. if (isset($_POST['_authorized'])) {
  14. if (hash("sha512", substr(time(), 0, 9) . $_SERVER['HTTP_USER_AGENT'] . BIC_KEY) != $_POST['_authorized']) {
  15. error(400);
  16. } else {
  17. $_SESSION['_authorized'] = '';
  18. }
  19. } else {
  20. header("Cache-Control: no-store, no-cache, must-revalidate");
  21. header("Expires: off"); ?><html>
  22. <head><title>Browser Integrity Check</title>
  23. <style type="text/css">
  24. html, body {
  25. width: 100%;
  26. height: 100%;
  27. margin: 0;
  28. padding: 0;
  29. }
  30. body {
  31. background-color: #ffffff;
  32. font-family: Helvetica, Arial, sans-serif;
  33. font-size: 100%;
  34. }
  35. </style>
  36. </head>
  37. <body>
  38. <table width="100%" height="100%" cellpadding="20">
  39. <tr>
  40. <td align="center" valign="middle">
  41. <img src="<?= STATIC_SERVER ?>common/bic_flag.gif?v=<?= filemtime(SERVER_ROOT . '/static/common/bic_flag.gif') ?>"/>
  42. <h1>Browser Integrity Check</h1>
  43. <p>Please wait 3 seconds, the page will auto refresh.</p>
  44. <noscript><p>JavaScript is disabled, cannot continue. Please make sure your browser is
  45. supporting Cookies, JavaScript and POST.</p></noscript>
  46. </td>
  47. </tr>
  48. </table>
  49. <form method="post">
  50. <button type="submit" name="_authorized" style="display: none" id="_authorized"
  51. value="<?= hash("sha512", substr(time(), 0, 9) . $_SERVER['HTTP_USER_AGENT'] . BIC_KEY) ?>"></button>
  52. </form>
  53. <script>setTimeout(function () {
  54. document.getElementById("_authorized").click()
  55. }, 3000)</script>
  56. </body>
  57. </html>
  58. <? die();
  59. }
  60. }
  61. }
  62. }
  63. }