Tul xxx Tul
User / IP
:
216.73.217.33
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
aircan.me
/
public_html
/
posuribia
/
app
/
Models
/
Viewing: LicenseModel.php
<?php namespace App\Models; use CodeIgniter\Model; class LicenseModel extends Model { protected $table = 'licenses'; protected $primaryKey = 'id'; protected $returnType = 'array'; protected $allowedFields = [ 'license_key', 'client_name', 'client_email', 'client_phone', 'plan_name', 'activation_date', 'expiration_date', 'grace_period_days', 'status', 'master_pin_hash', 'integrity_hash', 'provider_name', 'provider_phone', 'provider_email', 'notes', ]; protected $useTimestamps = true; protected $createdField = 'created_at'; protected $updatedField = 'updated_at'; /** * Obtiene la licencia actual (siempre la más reciente activa o la última) */ public function getCurrentLicense(): ?array { return $this->orderBy('id', 'DESC')->first(); } /** * Verifica si la licencia ha expirado (incluyendo período de gracia) */ public function isFullyExpired(?array $license = null): bool { $license = $license ?? $this->getCurrentLicense(); if (!$license) return true; $expiration = strtotime($license['expiration_date']); $graceEnd = $expiration + ($license['grace_period_days'] * 86400); return time() > $graceEnd; } /** * Verifica si la licencia expiró pero está en período de gracia */ public function isInGracePeriod(?array $license = null): bool { $license = $license ?? $this->getCurrentLicense(); if (!$license) return false; $expiration = strtotime($license['expiration_date']); $graceEnd = $expiration + ($license['grace_period_days'] * 86400); $now = time(); return $now > $expiration && $now <= $graceEnd; } /** * Calcula los días restantes de licencia */ public function daysRemaining(?array $license = null): int { $license = $license ?? $this->getCurrentLicense(); if (!$license) return 0; $expiration = strtotime($license['expiration_date']); $diff = $expiration - time(); return max(0, (int) ceil($diff / 86400)); } /** * Genera un hash de integridad para evitar manipulación manual */ public function generateIntegrityHash(array $license): string { $secret = env('LICENSE_SECRET', 'POS-SYSTEM-2026-SECURE'); $payload = $license['license_key'] . $license['activation_date'] . $license['expiration_date'] . $license['status'] . $secret; return hash('sha256', $payload); } /** * Verifica la integridad de una licencia */ public function verifyIntegrity(?array $license = null): bool { $license = $license ?? $this->getCurrentLicense(); if (!$license) return false; $expected = $this->generateIntegrityHash($license); return hash_equals($expected, $license['integrity_hash'] ?? ''); } /** * Genera una clave de licencia única */ public function generateLicenseKey(): string { $segments = []; for ($i = 0; $i < 4; $i++) { $segments[] = strtoupper(substr(md5(random_bytes(16) . microtime()), 0, 5)); } return implode('-', $segments); } /** * Verifica el PIN maestro */ public function verifyMasterPin(string $pin, ?array $license = null): bool { $license = $license ?? $this->getCurrentLicense(); if (!$license) { // Si no hay licencia, verificar contra el PIN del .env $envHash = env('LICENSE_MASTER_PIN_HASH', ''); if (empty($envHash)) return false; return password_verify($pin, $envHash); } return password_verify($pin, $license['master_pin_hash']); } /** * Actualiza automáticamente el estado según las fechas */ public function syncStatus(?array $license = null): ?array { $license = $license ?? $this->getCurrentLicense(); if (!$license || $license['status'] === 'suspended') return $license; $newStatus = $license['status']; if ($this->isFullyExpired($license)) { $newStatus = 'expired'; } elseif ($this->isInGracePeriod($license)) { $newStatus = 'grace_period'; } elseif (strtotime($license['expiration_date']) > time()) { $newStatus = 'active'; } if ($newStatus !== $license['status']) { $license['status'] = $newStatus; $license['integrity_hash'] = $this->generateIntegrityHash($license); $this->update($license['id'], [ 'status' => $newStatus, 'integrity_hash' => $license['integrity_hash'], ]); } return $license; } }
Coded With 💗 by
0x6ick