CeWL: A Comprehensive Guide to Creating Password Lists in Kali Linux
Cybersecurity professionals often need to test the strength of passwords during penetration tests. Creating a custom password list tailored to a target organization or individual can increase the success rate of brute-force or dictionary attacks. One tool designed for this purpose is CeWL (Custom Word List generator), a powerful Ruby application pre-installed in Kali Linux.
What is CeWL?
CeWL is a Ruby-based tool that scans a target website for keywords, extracting them to form a custom wordlist. This wordlist can be tailored based on the depth of scanning, word length, and file type to focus on context-specific passwords.
Key Features of CeWL
- Customizable Wordlist Creation: Extracts words based on length, depth, and relevance.
- Metadata Extraction: Fetches metadata from documents like PDFs, Word files, and others hosted on the website.
- Support for User-Agent Spoofing: Mimics different browsers during scans.
- Proxy Support: Operates behind a proxy for anonymity.
- Integration with Other Tools: Works seamlessly with hash-cracking tools.
Installing CeWL
CeWL comes pre-installed in Kali Linux. To verify its presence or install it, use the following command:
sudo apt update && apt install cewl
Syntax
The basic syntax of CeWL is:
cewl [options] [URL]
CeWL Commands and Options
1. Basic Command: Generate a Wordlist
The simplest usage of CeWL is to generate a wordlist from a target URL.
cewl http://example.com
Output:
example
products
services
about
contact
2. Specify Word Length (-m)
cewl -m 6 http://example.com
Output:
example
services
contact
3. Depth of Crawling (-d)
cewl -d 2 http://example.com
Output:
example
products
team
partners
news
blog
4. Save the Wordlist to a File (-o)
cewl -o wordlist.txt http://example.com
Explanation: This saves the extracted words into a file named wordlist.txt
.
5. Include Metadata Extraction (--meta)
cewl --meta http://example.com
Metadata Example Output:
Author: John Doe
Title: Company Report 2024
Keywords: finance, growth, strategy
6. Specify User-Agent (-u)
cewl -u "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" http://example.com
7. Verbose Mode (-v)
cewl -v http://example.com
Verbose Output Example:
Verbose Mode On
Fetching URL: http://example.com
Crawling depth: 1
Words extracted: 50
8. Proxy Support (-p)
cewl -p http://127.0.0.1:8080 http://example.com
9. Authenticate with a Website (--auth_user and --auth_pass)
cewl --auth_user admin --auth_pass password http://example.com
Practical Example: Comprehensive Use Case
Scenario: A penetration tester wants to create a wordlist from a company’s website, including linked pages, metadata, and words with a minimum length of 7 characters.
cewl -d 3 -m 7 --meta -o company_wordlist.txt http://company.com
Limitations of CeWL
- Dynamic Content: CeWL struggles with dynamically generated content from JavaScript.
- Blocked Requests: Target websites may block requests if they detect scraping attempts.
- Limited Scope: CeWL is best suited for creating small, targeted wordlists rather than exhaustive ones.
Conclusion
CeWL is a versatile and user-friendly tool for generating custom wordlists tailored to specific targets. Its features, such as crawl depth, metadata extraction, and User-Agent spoofing, make it invaluable for penetration testers and security researchers. By understanding its commands and options, you can effectively leverage CeWL in various scenarios to improve the efficiency of password-cracking attempts.
Note: Ensure you use CeWL responsibly and only on authorized systems or websites. Unauthorized usage is illegal and unethical.