THM | Password Attacks
Red Teaming | Password Attacks | Summary:
This room is designed to teach about various strategies and techniques used in cracking or guessing passwords. It covers both offline and online methods, including dictionary and brute-force attacks, rule-based attacks, and custom rules.
The room emphasizes password profiling, teaching users how to create effective wordlists using default, weak, leaked, combined, and username sources.
Other topics include keyspace techniques, CUPP (Custom Password Profile), and online attacks targeting FTP, SMTP, SSH, and HTTP login pages. Additionally, it introduces the concept of password spraying attacks.
Please note that this write-up is NOT intended to replace the original room or its content, but rather serve as supplementary material for those who are stuck and need additional guidance. This walkthrough provides one (of the many) possible solution to the challenges, without revealing any flags or passwords directly.
Learning Objectives
- Password profiling
- Password attacks techniques
- Online password attacks
Task | 01 | Introduction
Passwords are used for authentication purposes, serving as a barrier between legitimate users and potential intruders. Weak passwords, often found in public data breaches, can be easily guessed by attackers due to their simplicity or commonality. Strong passwords should include diverse character types (uppercase letters, lowercase letters, numbers, and symbols) and adhere to a minimum length requirement to enhance security.
Password policies implemented by companies help prevent the use of weak passwords within an organization. However, if an attacker understands these guidelines, they can generate password lists that meet policy requirements, posing a threat to system security. Passwords are typically stored in file systems or databases and may be vulnerable if stored in plaintext, as demonstrated by incidents like the 2014 Sony breach. Alternatively, hashing functions or encryption algorithms can securely store passwords within systems, increasing their resistance to cracking attempts.
Question 1: Learn about password attacking techniques in the next task!
No answer needed
Task | 02 | Password Attacking Techniques
Here we focus on password attack techniques, specifically discussing dictionary, brute-force, rule-based, and guessing attacks. These methods are considered active online attacks where an attacker communicates with the target machine to obtain passwords for unauthorized access.
The difference between password cracking and guessing is highlighted:
- Password guessing targets online protocols and services, often leading to time-consuming attempts that generate logs and may trigger account lockouts in securely configured systems.
- Password cracking occurs locally or on attacker-controlled systems, aiming to escalate privileges and gain unauthorized access to computer systems or networks.
Password cracking tools such as Hashcat and John the Ripper, are used to convert encrypted or hashed passwords into plaintext data obtained from compromised computers or network transmissions. Password cracking is a traditional pen-testing technique with the ultimate goal of granting attackers higher privileges and system access. Both password guessing and cracking are employed by cybersecurity professionals, albeit for different purposes and with distinct implications.
Question 1: Which type of password attack is performed locally?
Password cracking
Task | 03 | Password Profiling | 1
- Default Passwords
- Weak Passwords
- Leaked Passwords
- Combinend Wordlists
- use cat to combine | sort and uniq to remove duplicates
- Customized Wordlists
- use cewl to generate the list using a web page as a source
- Username Wordlists
- use username_generator to generate the different permutations for a given full name
It is very important to have a good wordlist for successful password attacks. Here we cover various methods for generating username and password lists:
Default passwords
- Attackers should attempt default credentials (e.g.,
admin:admin
,admin:123456
) set by manufacturers on devices like switches, firewalls, routers, or specific products such as Tomcat servers.Default Passwords | Website List
Weak passwords
- Professionals create weak password lists based on their experience and observed patterns during penetration testing engagements
- Common weak password sources include SecLists, which provide extensive collections of well-known and leaked passwords.
Leaked passwords
- Attackers can utilize publicly disclosed or sold breaches (referred to as 'dumps') containing sensitive data like passwords or hashes
- these dumps may require password extraction or cracking to obtain plain-text passwords
- Common password lists with weak and leaked passwords
Combined wordlists
# combine different wordlists into one
cat file1.txt file2.txt file3.txt > combined_list.txt
# clean up duplicates
sort combined_list.txt | uniq -u > cleaned_combined_list.txt