Module 06: System Hacking Flashcards
What are the three phases of the hacking cycle that system hacking cover?
Phases 3-5:
- Gaining access
- Maintaining access
- Covering tracks
What are the two basic ways to gain access to a system?
- Crack user passwords
- Exploit system vulnerabilities
Where are passwords stored on Windows and Linux systems?
To confirm a typed password is correct, the correct password to verify the match against has to be stored somewhere on the box.
- The password storage locations on Windows systems for non domain controllers is the SAM database found in the system 32 config directory. SAM file is located at c:\windows\system32\config\SAM
In Windows, SAM stands for Security Account Manager. The SAM database is a file that stores user account information, including usernames and encrypted passwords, and is used for local authentication on the system.
There is also the ntds.dit file which is the storage location on an AD domain controller
- In Linux systems there is typically a file called shadow with the hashes and password file with users.
- Kerberos is a more secure form of authentication but it can fall back to NTLM (which is outdated and insecure) if Kerberos isn’t supported.
Why do hackers not go after the password storage? They do , so we make passwords on the system difficult to achieve and they are hashed.
You have to crack the hash which cannot be reversed but must be re-created, where resultant output matches a hash. This can be incredibly time consuming. Need to guess correct pw until we find correct resultant hash output.
SAM Database
Windows stores user passwords in the SAM (Security Accounts Manager) Database, or in the Active Directory database in domains. Passwords are never stored in clear text and are hashed, and the results are stored in the SAM.
NTLM Authentication
The NTLM authentication protocol stores the users’ password in the SAM database using different hashing methods depending whether it’s the NTLM authentication protocol or LM authentication protocol.
___
NTLM (NT LAN Manager) is a Windows authentication protocol used to verify users and services within a network. It relies on a challenge-response mechanism, where hashed passwords are used for authentication without sending the actual password over the network. The Windows Domain controller has a stored copy of the user’s hashed password and decrypts the challenge response from the user using their stored password hash for the user.
Although it’s older and less secure compared to Kerberos (which Windows now favors), NTLM is still supported for backward compatibility and certain network scenarios.
Kerberos authentication
Microsoft’s new, upgraded default authentication protocol which provides stronger authentication for client server applications, and issues TGTs from the KDC, then relevant service tickets.
Kerberos is more secure because everything is encrypted. When you log into Kerberos KDC (aka domain controller), when you log in first time that day you need a TGT (ticket granting ticket) that Kerberos sends back with a key encrypted with your password, which is held in memory and never leave the machine, unknown to an eavesdropper. The TGT is decrypted with password in memory, then it’s replayed against a ticket granting server to request access to other services. Each subsequent session ticket has a unique symmetric key encrypted with the client’s password. We have an unknown encrypted with an unknown key.
Active vs Passive online attacks
Active Online Attacks: dictionary, brute force, rule-based attacks, hash injection, spyware, password spraying, internal monologue, cracking Kerberos
Passive online attacks: wire sniffing, MITM, replay attack
Offline attacks
taking the password file and cracking passwords on your own system in a different location - length and complexity of pw determine its resiliency to brute force attacks.
Need to figure out what password will = the hash of the captured password when running the hashing algorithm used by the system
Dictionary attack
takes a word list and takes each word one at a time. Uses trial and error until you achieve right hash. Finding a collision will authenticate you to the system even if the password is wrong, as the system only knows the hash, not the password itself. If password is not in word list you are ok. You can also add number variations to dictionary root word lists using hybrids but that takes longer.
Dictionary attack is always the shortest way but doesn’t always work.
Brute force
tries every possible combination of letters/numbers in a methodical way (a, aa, aaa). Exhaustive but guaranteed to be successful eventually (could be thousands of years from now).
Rule-based configuration comes in where you know something about the password environments and program the cracker to follow specific rules. EX: 8 characters = 10 years, depending on the processing power
Rainbow tables
you generate your hash tables ahead of time, which can save you time after. You can instantly generate hashes to decrypt. They take long to generate and take up lots of space, but can be neutralized with salting or peppering.
There is more math involved with a challenge handshake vs. non-challenge shake.
Password spraying
attack multiple user accounts simultaneously and crack the small list of commonly used passwords. Attempts to avoid account lockout in live environment.
Tool: CrackMapExec
Credential stuffing
captured username and PW from one site, blast credential pairs against random websites hoping to get a match
Default passwords
you can find websites dedicated to cataloging default passwords by vendor and by product - default configurations are definitely a vulnerability.
Pass the hash
Here you don’t have to crack the hash, you only have to replay it using tools like mimecast, whosethere, iam
- You can rewrite your authentication token after you’ve logged into a Windows machine. You can look at your authentication token and clone the UN and PW hash of another account, then use that to present yourself to other resources to move through a network
You can also compromise a hash and append it to a challenge in NTLM authentication.