Guest User

instance-config

a guest
Dec 21st, 2025
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.70 KB | None | 0 0
  1. <?php
  2. // 1. LOAD SECRETS FIRST
  3. @include('inc/secrets.php');
  4.  
  5. /*
  6. * Instance Configuration (LIVE)
  7. * ----------------------
  8. */
  9.  
  10. // ----------------------------------------------------------------
  11. // SPAM DEFENSE SYSTEM (LAYERS 1-9)
  12. // Updated: Dec 21, 2025 - 10:45 AM (Maximum Security)
  13. // ----------------------------------------------------------------
  14.  
  15. // 1. DNS Blocklists
  16. $config['dnsbl'][] = 'rbl.efnetrbl.org';
  17. $config['dnsbl'][] = 'dnsbl-1.uceprotect.net';
  18. $config['dnsbl'][] = 'dnsbl.dronebl.org';
  19. $config['dnsbl'][] = 'torexit.dan.me.uk';
  20.  
  21. // 2. LAYER 1: Block known Link Shorteners & Tools (Surface Check)
  22. // ADDED: us1.in
  23. $config['filters'][] = array(
  24. 'condition' => array(
  25. 'body' => '/(bit\.ly|tinyurl\.com|goo\.gl|t\.co|is\.gd|cli\.gs|yfrog\.com|migre\.me|ff\.im|tiny\.cc|url4\.eu|twit\.ac|su\.pr|twurl\.nl|snipurl\.com|short\.to|budurl\.com|ping\.fm|post\.ly|just\.as|bkite\.com|snipr\.com|fic\.kr|loopt\.us|doiop\.com|short\.ie|kl\.am|wp\.me|rubyurl\.com|om\.ly|to\.ly|bit\.do|t\.cn|lnkd\.in|db\.tt|qr\.ae|adf\.ly|goo\.gl|bitly\.com|curlm\.in|curlmin|ity\.im|q\.gs|po\.st|bc\.vc|twitthis\.com|u\.to|j\.mp|buzurl\.com|cutt\.us|u\.bb|yourls\.org|x\.co|prettylinkpro\.com|scrnch\.me|filoops\.info|vzturl\.com|qr\.net|1url\.com|tweez\.me|v\.gd|tr\.im|link\.zip\.net|shrturl|shorturl|nimje|t\.ly|goo\.su|rebrand\.ly|qrco\.de|ow\.ly|6url\.ru|x\.gd|cutt\.ly|shorturl\.at|us1\.in)/i',
  26. ),
  27. 'action' => 'reject',
  28. 'message' => 'Suspicious post.',
  29. 'reason' => 'Spam filter L1 (Shortener)'
  30. );
  31.  
  32. // 3. LAYER 2: Unshortener (Deep Check)
  33. // Follows redirects.
  34. // ADDED: site, online, website, space, fun, pro, biz, info, cam, stream
  35. $config['filters'][] = array(
  36. 'condition' => array(
  37. 'unshorten' => '/\.(ru|cn|top|xyz|onion|gq|ml|ga|cf|tk|kp|ir|ws|pw|cc|icu|club|work|support|shop|zip|mov|live|buzz|click|in|site|online|website|space|fun|pro|biz|info|cam|stream)\b/i',
  38. ),
  39. 'action' => 'reject',
  40. 'message' => 'Suspicious post.',
  41. 'reason' => 'Spam filter L2 (Redirect)'
  42. );
  43.  
  44. // 4. LAYER 3: Body Text Scan (Direct Link Check)
  45. // ADDED: site, online, website, space, fun, pro, biz, info, cam, stream
  46. $config['filters'][] = array(
  47. 'condition' => array(
  48. 'body' => '/\.(ru|cn|top|xyz|onion|gq|ml|ga|cf|tk|kp|ir|ws|pw|cc|icu|club|work|support|shop|zip|mov|live|buzz|click|in|site|online|website|space|fun|pro|biz|info|cam|stream)\b/i',
  49. ),
  50. 'action' => 'reject',
  51. 'message' => 'Suspicious post.',
  52. 'reason' => 'Spam filter L3 (TLD)'
  53. );
  54.  
  55. // 5. LAYER 4: Suspicious Subdomain Prefixes
  56. $config['filters'][] = array(
  57. 'condition' => array(
  58. 'body' => '/(https?:\/\/|www\.)(t|s|u|v|go|l|click|link)\.[a-z0-9-]+\.[a-z]+/i',
  59. ),
  60. 'action' => 'reject',
  61. 'message' => 'Suspicious post.',
  62. 'reason' => 'Spam filter L4 (Prefix)'
  63. );
  64.  
  65. // 6. LAYER 5: Block Abused Free Hosting
  66. $config['filters'][] = array(
  67. 'condition' => array(
  68. 'body' => '/(herokuapp\.com|netlify\.app|vercel\.app|pages\.dev|glitch\.me|firebaseapp\.com|onrender\.com|fly\.dev|surge\.sh|github\.io|gitlab\.io|stackblitz\.io|codesandbox\.io|render\.com|cyclic\.app|railway\.app|deno\.dev)/i',
  69. ),
  70. 'action' => 'reject',
  71. 'message' => 'Suspicious post.',
  72. 'reason' => 'Spam filter L5 (FreeHost)'
  73. );
  74.  
  75. // 7. LAYER 6: Anti-Obfuscation
  76. $config['filters'][] = array(
  77. 'condition' => array(
  78. 'body' => '/(h\s+t\s+t\s+p|w\s+w\s+w|\bdot\s+(ru|cn|top|xyz)|\[\.\]\s*(ru|cn|top|xyz)|\(\.\)\s*(ru|cn|top|xyz)|\s\.\s(ru|cn|top|xyz))/i',
  79. ),
  80. 'action' => 'reject',
  81. 'message' => 'Suspicious post formatting.',
  82. 'reason' => 'Spam filter L6 (Obfuscation)'
  83. );
  84.  
  85. // 8. LAYER 7: Sneaky Fields Scan (Subject, Name, Email)
  86. $spam_regex = '/(bit\.ly|tinyurl|curlmin|nimje|shrturl|goo\.su|t\.ly|\.ru|\.cn|\.top|\.xyz|\.onion|\.ws|\.pw|\.cc|\.icu|\.zip|\.in|\.site|\.online|\.website|\.space)/i';
  87.  
  88. $config['filters'][] = array(
  89. 'condition' => array('subject' => $spam_regex),
  90. 'action' => 'reject', 'message' => 'Suspicious content.', 'reason' => 'Spam filter L7 (Subject)'
  91. );
  92. $config['filters'][] = array(
  93. 'condition' => array('name' => $spam_regex),
  94. 'action' => 'reject', 'message' => 'Suspicious content.', 'reason' => 'Spam filter L7 (Name)'
  95. );
  96. $config['filters'][] = array(
  97. 'condition' => array('email' => $spam_regex),
  98. 'action' => 'reject', 'message' => 'Suspicious content.', 'reason' => 'Spam filter L7 (Email)'
  99. );
  100.  
  101. // 9. LAYER 8: Content/Keyword Blocking
  102. $config['filters'][] = array(
  103. 'condition' => array(
  104. 'body' => '/(megapack|secret\ssite|<<[a-z]>>)/i',
  105. ),
  106. 'action' => 'reject',
  107. 'message' => 'Suspicious keywords detected.',
  108. 'reason' => 'Spam filter L8 (Keywords)'
  109. );
  110.  
  111. // 10. LAYER 9: Cloud Storage & Messaging (NEW)
  112. // Blocks the specific hosts usually used to store or share the content.
  113. $config['filters'][] = array(
  114. 'condition' => array(
  115. 'body' => '/(mega\.nz|mega\.io|mediafire\.com|dropbox\.com|t\.me|telegram\.me|discord\.gg|discordapp\.com)/i',
  116. ),
  117. 'action' => 'reject',
  118. 'message' => 'File hosts and chat invites are not allowed.',
  119. 'reason' => 'Spam filter L9 (Cloud/Chat)'
  120. );
  121.  
  122. // ----------------------------------------------------------------
  123. // END DEFENSE SYSTEM
  124. // ----------------------------------------------------------------
Add Comment
Please, Sign In to add comment