
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
GbDetector is an advanced text analysis module designed to identify gambling-related content through sophisticated pattern matching and text processing techniques.
GbDetector is an advanced text analysis module designed to identify gambling-related content through pattern matching and sophisticated text processing. It is encapsulated in an Immediately Invoked Function Expression (IIFE) to prevent global namespace pollution, offering a clean API for text analysis.
This module assists in detecting potential gambling-related content in text, making it useful for content moderation, compliance monitoring, and filtering systems. It leverages various detection mechanisms to identify both overt and obfuscated gambling-related text.
[INPUT TEXT] → [INITIAL PREPROCESSING]
↓
[GARBAGE/REPETITION CHECK] → [URL PATTERN CHECK]
↓
[TEXT NORMALIZATION] → [WORD RECONSTRUCTION]
↓
[NUMBER MERGING] → [BLOCKLIST CHECK]
↓
[PATTERN MATCHING] → [LEET-SPEAK CONVERSION]
↓
[KEYWORD MATCHING] → [CONFIDENCE SCORING]
↓
[OUTPUT RESULT]
Preprocessing:
Initial Checks:
Evasion Technique Analysis:
Contextual Indicator Detection:
Contact Info Extraction:
Text Normalization:
Language Pattern Detection:
Domain Matching:
Multi-pass Pattern Matching:
Supporting Keyword Analysis:
Content Length & Complexity Analysis:
Final Evaluation:
detect(text = "", options = {})Main function for detecting gambling patterns in text.
Parameters:
text (string): The text to be analyzed
options (object): Configuration options
keywords: Pattern terms to detect (e.g., site names)supportKeywords: Supporting keyword listdomains: List of domains to detectallowlist: Whitelisted termssensitivityLevel: Detection sensitivity (1–5, default 3)includeAnalysis: Include detailed analysis in resultsdetectRepetition, detectUrlPatterns, detectEvasionTechniques, detectContextualIndicators: Boolean toggles for specific detection typesextractContactInfo: Whether to extract contact infolanguage: Language selection ('en', 'id', 'all')debug: Show debug infoReturns: An object with detection results:
isGambling (boolean): Whether gambling content is detectedconfidence (string): "none", "low", "medium", or "high"checkpoint (number): Numerical detection scoredetails (string): Human-readable explanationcomment (string): Original analyzed textanalysis (object, optional): Detailed analysis infocleanText(text) – Normalize and clean textcleanWeirdPatterns(text) – Remove odd spacing and punctuationreconstructSeparatedWords(text) – Reconstruct deliberately split wordsmergeTextWithTrailingNumbers(text) – Merge numbers trailing wordsisMostlyAsciiGarbage(text, threshold = 0.45) – Detect non-alphanumeric spamhasAbnormalRepetition(text) – Detect character/pattern repetitionhasSuspiciousUrlPatterns(text) – Detect obfuscated URLshasSuspiciousCodeSequences(text) – Detect suspicious symbols/emojiconvertCommentFixed(comment, ignoreLastDigits = 0) – Convert symbols to charactersfuzzySearch(keywords, text) – Perform fuzzy keyword matchanalyzeEvasionTechniques(text)detectContextualGamblingIndicators(text)extractContactInfos(text)detectLanguageSpecificPatterns(text, language)createPatternRegex(terms, loose = false) – Create RegExp patternTinyPatternRegex(terms) – Create focused RegExp patternsensitivityFactor = Math.max(1, Math.min(5, sensitivityLevel)) / 3
confidenceThresholds = {
low: Math.max(0.45, 0.5 * sensitivityFactor),
medium: Math.max(0.9, 0.8 * sensitivityFactor),
high: Math.max(1.2, 2.5 * sensitivityFactor)
}
keywordBonus = Math.min(1.5, 0.03 * (keywordMatchCount/2) + 0.7)
garbageRatio = numberOfGarbageCharacters / totalTextLength
isGarbage = garbageRatio >= threshold (default 0.45)
const examples = [
"sl0t88 maxwin guaranteed win!",
"J4ckp0t Zeus99 trusted - sign up now!",
"c a s i n o online with credit & e-wallet deposit",
"best online gambling site slot gacor maxwin today",
"Get rich quick with winning bets at my-gambling-site.com",
"This is a normal sentence with no gambling content.",
"Z.e.u.s g.a.c.o.r m.a.x.w.i.n",
"j*u*d*i o*n*l*i*n*e biggest site"
];
const customConfig = {
keywords: ["win", "maxwin", "deposit", "withdraw", "gacor"],
supportKeywords: ["jp", "jackpot", "slot", "judi", "casino"],
domains: ["scamsite.com", "badword"],
allowlist: ["normal", "common"],
sensitivityLevel: 3,
includeAnalysis: true,
detectRepetition: true,
detectUrlPatterns: true,
detectEvasionTechniques: true,
detectContextualIndicators: true,
extractContactInfo: true,
language: 'all',
debug: true
};
console.log("=== TESTING EXAMPLES ===");
examples.forEach((example, index) => {
console.log(`\nExample ${index + 1}: "${example}"`);
// run detection logic here
});
GbDetector comes with a comprehensive set of default keywords for various gambling-related terms in both English and Indonesian:
🔑 Primary Keywords:
[
"slot", "casino", "jack", "zeus", "scatter", "toto", "judol", "jodol",
"poker", "roulette", "betting", "gamble", "joker"
]
🛠️ Supporting Keywords:
wdp, wd, win, happy, joyful, rich, trustworthy, lucky, trust, etc.menang, senang, gacor, gembira, kaya, pasti dapat, bangga, panen, etc.MIT License © 2025 Ramsyan-Tungga
The GbDetector module offers a powerful solution for identifying gambling-related content in text, even when obfuscated. By combining various detection techniques and offering extensive configuration options, the module achieves high accuracy while minimizing false positives. Its modular design ensures easy integration into different systems requiring content moderation or filtering capabilities.
FAQs
GbDetector is an advanced text analysis module designed to identify gambling-related content through sophisticated pattern matching and text processing techniques.
We found that gbdetector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.