Quick Installation
- Purchase the module and download
haikhavan_antifraud_security_shield-ioncube-8.2-1.0.0-install.zipfrom your VPSrv Client Area Downloads. - Upload and extract the ZIP into your WHMCS root directory so files land in
modules/addons/haikhavan_antifraud_security_shield/. - Verify PHP 8.2–8.4 with ionCube PHP Loader 14+ / 15.5+ is enabled on your server.
- Go to System Settings → Addon Modules in WHMCS Admin, click Activate next to Haikhavan Anti-Fraud, Unban Center & Security Vault, and assign administrator role access.
Version: 1.0.0 | Module Slug: haikhavan_antifraud_security_shield | WHMCS Compatibility: 9.1.x (8.10+ compatible) | PHP: 8.2 / 8.3 / 8.4
A unified WHMCS 9.x security suite combining 0–100 multi-signal Order & Signup Fraud Risk Scoring, Mandatory Signed Email Verification, a 6-Engine Self-Service Unban Center (CSF/LFD, Imunify360, Fail2Ban, cPHulk, DirectAdmin BFM, Cloudflare IP Rules), an AES-256-CBC+HMAC Encrypted Password Vault, and Burn-After-Reading One-Time Support Ticket Secrets.
Haikhavan Anti-Fraud, Unban Center & Security Vault — Technical Documentation
Module Slug: haikhavan_antifraud_security_shield | Namespace: Haikhavan\SecurityShield\ | Version: 1.0.0 | Target: WHMCS 9.1.2 (PHP 8.3+, MySQL 8.4)
1. Architecture & File Inventory
modules/addons/haikhavan_antifraud_security_shield/
├── haikhavan_antifraud_security_shield.php # WHMCS lifecycle callbacks & PSR-4 autoloader
├── hooks.php # 8 hooks (Checkout, FraudCheck, ClientAdd, Navbar, Ticket, Widget, Cron)
├── whmcs.json # WHMCS Marketplace manifest (schema 1.0)
├── lib/
│ ├── Database.php # 8-table schema installer, starter blocklists/nodes, AES-256-CBC+HMAC crypto, audit logger
│ ├── FraudEngine.php # 0-100 multi-signal risk engine (45+ disposable domains, geo mismatch, VPN/ASN, velocity, AbuseIPDB/Sandbox)
│ ├── UnbanService.php # 6-engine firewall IP ban checker & rate-limited unbanner
│ ├── VaultService.php # AES-256 Password Vault, Burn-After-Reading Support Secrets, Signed Email Verification Gate
│ ├── AnalyticsService.php # 30d SOC KPIs, 7-day decision series, top triggered signals & sandbox seeder
│ ├── AdminController.php # 7-tab Admin SOC dispatcher & CSRF-protected AJAX JSON API
│ └── ClientController.php # Client Security Hub dispatcher & ownership-scoped AJAX handlers
├── templates/
│ ├── admin/dashboard.php # 7-tab Admin SOC dashboard + zero-CDN Canvas charts
│ └── client/portal.tpl # Smarty Client Security Hub (Unban, Email Verify, Vault, 1-Time Secrets)
└── assets/
├── css/haikhavan_security_shield.css # Scoped SOC design system (.hk-sec-*)
└── js/haikhavan_security_shield.js # Vanilla JS AJAX + HDPI HTML5 Canvas charts
2. Database Schema (mod_hk_sec_*)
mod_hk_sec_fraud_checks: Order & signup risk scoring ledger (userid,order_id,email,ip_address,billing_country,ip_country,risk_score,decision,signals_json,external_source,override_by_admin,override_decision,is_sandbox).mod_hk_sec_rules_lists: Allowlist & Blocklist (UNIQUE(list_type, entry_type, entry_value),reason,hits,expires_at,created_by_admin).mod_hk_sec_email_verifications: Signed email verification gate (useridUNIQUE,email,token_hash,verified,verified_at,resend_count,last_sent_at,expires_at).mod_hk_sec_firewall_nodes: 6-engine Unban Center node registry (name,engine,hostname,port,config_encrypted,enabled,unban_count,last_check_at).mod_hk_sec_unban_logs: Self-service & admin unban audit history & 24h velocity tracker (userid,node_id,engine,ip_address,ban_reason,action_status,initiated_by).mod_hk_sec_vault_entries: Encrypted password vault (userid,owner_scope,title,category,username,secret_encrypted,host_url,notes_encrypted,strength_score,access_count,last_rotated_at).mod_hk_sec_secure_secrets: One-time burn-after-reading ticket secrets (token_idUNIQUE,userid,ticket_id,label,secret_encrypted,burn_after_read,max_views,view_count,expires_at,burned,burned_at,last_viewed_ip).mod_hk_sec_audit_log: Security audit log (userid,adminid,action,severity,summary,details_json,ip_address,created_at).
3. Security Model
- Authenticated Encryption (Encrypt-then-MAC):
Database::encryptSecret()usesAES-256-CBCwith random 16-byte IV +HMAC-SHA256verified viahash_equals(), using distinct encryption & MAC subkeys derived from WHMCS$cc_encryption_hash. - Cryptographic Wipe on Burn: Once a burn-after-reading secret reaches
max_views(default1) or passesexpires_at,secret_encryptedis immediately overwritten withNULL(burned = 1) — making recovery impossible even with database access. - Strict Client Ownership & Rate Limits: Client Vault decrypt/delete and One-Time Secret reveal enforce
userid = (int) $_SESSION['uid']. Self-service IP unbans enforce permanent admin blocklist guards and configurable 24-hour rate limits. - CSRF Protection: Independent session tokens (
hk_sec_admin_csrf,hk_sec_client_csrf) verified viahash_equals()on every POST/AJAX endpoint (HTTP403on failure).
4. WHMCS Hooks (hooks.php)
ShoppingCartValidateCheckout— Real-time 0–100 risk evaluation + optional mandatory email verification gate.FraudCheckAwaitingUserInput— Logs manual fraud review transitions.ClientAdd— Issues signed email verification token and evaluates new signup risk score.ClientAreaPrimaryNavbar,ClientAreaPageViewTicket,AdminAreaViewTicketPage,AdminHomeWidgets.DailyCronJob— Cryptographically wipes expired one-time secrets and prunes expired temporary list rules.
5. AJAX API Reference
- Admin (
addonmodules.php?module=haikhavan_antifraud_security_shield&ajax=1):simulate_fraud,override_fraud,add_list_entry,delete_list_entry,check_ip_ban,admin_unban_ip,create_secret,reveal_secret,create_vault_entry,reveal_vault_entry,force_verify_email,seed_sandbox,clear_sandbox,save_settings. - Client (
index.php?m=haikhavan_antifraud_security_shield&ajax=1):send_email_verify,confirm_email_verify,check_my_ip,unban_my_ip,create_vault_entry,reveal_vault_entry,delete_vault_entry,create_one_time_secret,reveal_one_time_secret.