Skip to content

Instantly share code, notes, and snippets.

@githubfoam
Last active March 12, 2024 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save githubfoam/a7ec65e7a78c9e8e3026433ccd0ba84f to your computer and use it in GitHub Desktop.
Save githubfoam/a7ec65e7a78c9e8e3026433ccd0ba84f to your computer and use it in GitHub Desktop.
password crack cheat sheet
#=====================================================================
#Gemini
let's calculate the estimated cracking time for an 8-character password with only lowercase alphabetical characters.
Number of possible characters:
We have lowercase alphabets (a-z), which is 26 characters.
Password Length:
The password length is 8 characters.
Total possible combinations:
Each character slot can have 26 options (lowercase letters).
Therefore, the total number of possible passwords is: 26 (characters) ^ 8 (length)
This equals 26 * 26 * 26 * 26 * 26 * 26 * 26 * 26 = 208,827,064,576 (approximately 208 billion).
Scenario 1: Slow Attack (100 guesses per second):
Cracking time = Total combinations / Guessing Speed
Cracking time = 208,827,064,576 guesses / 100 guesses/second
Cracking time = 2,088,270,645.76 seconds
Converting to days: Cracking time = 2,088,270,645.76 seconds / (60 seconds/minute * 60 minutes/hour * 24 hours/day)
Cracking time ≈ 24.17 years
Scenario 2: Moderate Attack (10,000 guesses per second):
Cracking time ≈ 241.7 days
Scenario 3: Fast Attack (1,000,000 guesses per second):
Cracking time ≈ 2.42 days
Remember:
These are estimations. Attackers can leverage powerful machines and techniques to improve their guess rate significantly.
Using a password with more character types (uppercase letters, numbers, symbols) and a longer length dramatically increases the cracking time.
Here are some additional points to consider:
Rainbow tables: Pre-computed tables can be used to crack passwords faster, although this approach is less common for complex passwords.
Hashing algorithms: Modern systems store passwords as one-way hashes, making it difficult to retrieve the original password even if cracked.
#=====================================================================
#Gemini
Password spraying is a cyberattack technique that leverages readily available information to gain unauthorized access to multiple accounts. Here's a breakdown of the explanation with examples:
Password Spraying: How it Works
Imagine a hacker has a list of email addresses collected from various sources. Password spraying involves using this list in conjunction with a set of commonly used passwords (e.g., "password123", "qwerty", etc.) to attempt logins on a particular system.
Why Email Addresses as Usernames are Risky?
Half the Login Information Exposed: By using email addresses as usernames, half of the login credentials are already revealed to anyone with access to that email list. This makes it easier for attackers to focus their efforts on guessing the password.
Credential Stuffing Variation: Password spraying can be seen as a variant of a credential stuffing attack. In credential stuffing, attackers use stolen username and password combinations from one data breach to try logging into another system. Password spraying leverages publicly available email addresses and common passwords.
Example:
Let's say a hacker obtains a list of email addresses used for a social media platform. They then try logging into those accounts using a list of the most common passwords. If some users have reused passwords across different platforms, the attacker might gain access to those accounts.
Why Secure Systems Avoid Email Addresses as Usernames?
Stronger First Layer of Defense: By requiring a separate username for login, the system adds an extra layer of security. Attackers can't simply rely on publicly available email addresses to guess half of the credentials.
Encourages Unique Usernames: Forcing users to create unique usernames discourages them from reusing the same username across different platforms, making password spraying less effective.
Additional Security Measures:
Enforce Strong Passwords: Systems should enforce password complexity rules, requiring a minimum length, a combination of uppercase and lowercase letters, numbers, and symbols. This significantly increases the difficulty of guessing passwords.
Implement MFA (Multi-Factor Authentication): MFA requires an additional factor beyond username and password, such as a verification code sent to the user's phone or a fingerprint scan. This adds another hurdle for attackers even if they guess the password correctly.
Regular Security Updates: Systems should be kept up-to-date with the latest security patches to address vulnerabilities that attackers might exploit.
By avoiding email addresses as usernames and implementing these additional security measures, systems can significantly reduce the risk of successful password spraying attacks.
#=====================================================================
#ChatGPT
Password Spraying:
Password spraying is a cyberattack technique where hackers attempt to gain unauthorized access to a system by systematically trying a few commonly used passwords across a large number of user accounts. Unlike traditional brute-force attacks that try many passwords for a single user, password spraying involves trying a limited set of passwords against many user accounts. This method aims to avoid detection mechanisms that lock accounts after a certain number of failed login attempts.
Example:
Let's say a hacker obtains a list of legitimate email addresses from a data breach or public information. Instead of trying a large number of passwords for a single user account, the attacker selects a handful of commonly used passwords (like "password," "123456," etc.) and tries them against all the email addresses on the list. This method increases the chances of success because people often reuse passwords across different accounts.
Security Implications:
The statement "Secure systems should never allow the use of email addresses for usernames" is based on the understanding that using email addresses as usernames creates a vulnerability. If an attacker obtains a list of email addresses (which can be relatively easy to acquire) and combines it with commonly used passwords, they already have half of the credentials needed to access an account. This significantly reduces the effort required for a successful attack.
Mitigation Strategies:
Unique Usernames: Encourage or enforce the use of unique usernames that are not easily guessable or obtainable.
Account Lockout Policies: Implement account lockout policies to temporarily lock an account after a certain number of failed login attempts, preventing brute-force and password spraying attacks.
Strong Password Policies: Enforce strong password policies that require users to create complex passwords, reducing the likelihood of successful password spraying.
Multi-Factor Authentication (MFA): Implement MFA to add an additional layer of security, even if passwords are compromised.
User Education: Educate users about the importance of using unique and strong passwords and avoiding password reuse across different accounts.
By adopting these mitigation strategies, organizations can strengthen their security posture and minimize the risk of unauthorized access through password spraying attacks.
#=====================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment