Guest User

Untitled

a guest
Sep 28th, 2020
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace JetBackup\Core;
  15.  
  16. class License
  17. {
  18. const LICENSE_LOCK_FILE = JetBackup\Core\JetBackup::TMP_PATH . '/license.lock';
  19. const LICENSE_CHECK_URL = 'https://check.jetlicense.com';
  20. const LICENSE_LOCALKEY_DAYS = 259200;
  21. const LICENSE_LOCALKEY_CHECK_INTERVAL = 172800;
  22. const LICENSE_LOCALKEY_FAIL_INTERVAL = 3600;
  23. const LICENSE_NOTIFY_ERROR_INTERVAL = 86400;
  24. const LICENSE_PRODUCT_ID = '58ac64be19a4643cdf582727';
  25. const LICENSE_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----' . "\n" . 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2F105dMYw8kTC54ANpMt' . "\n" . 'WaVKEFEoRd+D0YDRDB/EGgFbEUdkDvub6FfHcDdgfmRgjUOWap0yX2MpOCy/QA/P' . "\n" . 'SrIuSYe4+jv5J+cW2O6WbnhVdlAQTLOiOgiUYMuFNt6+gx4DaitoxD/p39elThfa' . "\n" . 'KsAawrrxBR0mEdn0JeE1k0l/bbhekzUubR9LReOtveXdMoVygrAQ52mQ0saOSmuB' . "\n" . 'Un2oa4kaWeZfCA/fYW8jMEEjmrftcT3XVi7yA5Fk/xQQ3eNSLIAx2gZf8B2g0zqa' . "\n" . '/QSq9+6BDM/6OdG9o+cMvpSoOojx5ApcQxAwHfSiISfibJ/49kmnP7okCRI7pNvE' . "\n" . '3wIDAQAB' . "\n" . '-----END PUBLIC KEY-----';
  26.  
  27. private $_localKey;
  28.  
  29. public function __construct()
  30. {
  31. }
  32.  
  33. /**
  34. * @return string
  35. * @throws \Exception
  36. */
  37. private function _handshake()
  38. {
  39. if (file_exists('/sys/class/dmi/id/product_uuid')) {
  40. $code = Shell::exec('/bin/cat /sys/class/dmi/id/product_uuid', $response);
  41. if (!$code && isset($response[0])) {
  42. return md5($response[0]);
  43. }
  44. }
  45.  
  46. if (file_exists('/var/lib/dbus/machine-id')) {
  47. $code = Shell::exec('/bin/cat /var/lib/dbus/machine-id', $response);
  48. if (!$code && isset($response[0])) {
  49. return md5($response[0]);
  50. }
  51. }
  52.  
  53. $code = Shell::exec('/sbin/ifconfig -a | /bin/grep -i \'hwaddr\' | /bin/awk \' { print $5 } \' | /usr/bin/head -n1', $response);
  54. if (!$code && isset($response[0])) {
  55. return md5($response[0]);
  56. }
  57.  
  58. $code = Shell::exec('/sbin/ip addr | /bin/grep -i \'ether\' | /bin/awk \' { print $2 } \' | /usr/bin/head -n1', $response);
  59. if (!$code && isset($response[0])) {
  60. return md5($response[0]);
  61. }
  62.  
  63. $code = Shell::exec('/sbin/ifconfig -a | /bin/grep -i \'ether\' | /bin/awk \' { print $2 } \' | /usr/bin/head -n1', $response);
  64. if (!$code && isset($response[0])) {
  65. return md5($response[0]);
  66. }
  67.  
  68. if (file_exists('/etc/machine-id')) {
  69. $code = Shell::exec('/bin/cat /etc/machine-id', $response);
  70. if (!$code && isset($response[0])) {
  71. return md5($response[0]);
  72. }
  73. }
  74.  
  75. return '';
  76. }
  77.  
  78. /**
  79. * @param string $error
  80. * @param bool $force
  81. */
  82. static private function _checkFailed($error, $force = false)
  83. {
  84. $license = Factory::getConfigLicense();
  85. if (Factory::getConfigNotification()->getGlobal() && ($force || ($license->getNotifyDate() < (time() - 21600)))) {
  86. $license->setNotifyDate();
  87. $license->update();
  88. $hostname = Utils::getHostname();
  89. Factory::getConfigNotification()->sendMail('License check FAILED on ' . $hostname, 'There was a failed license check on the server ' . $hostname . '.<br />Error: ' . $error);
  90. }
  91. }
  92.  
  93. /**
  94. * @return array
  95. */
  96. private function _parseLocalKey()
  97. {
  98. $output = ['signed' => '', 'signed_status' => '', 'status' => '', 'description' => ''];
  99.  
  100. if (!$this->_localKey) {
  101. return $output;
  102. }
  103.  
  104. list($signed, $signed_status, $status, $description) = explode('|', $this->_localKey, 4);
  105.  
  106. if ($signed) {
  107. $output['signed'] = $signed;
  108. }
  109.  
  110. if ($signed_status) {
  111. $output['signed_status'] = $signed_status;
  112. ...........................................................................
  113. ..........................................
  114. .................
Add Comment
Please, Sign In to add comment