Authentication Mechanisms
Explore the authentication components of FreeIPA and techniques to test their security.
Kerberos Overview
FreeIPA uses Kerberos for authentication, which is a network authentication protocol designed to provide strong authentication for client/server applications by using secret-key cryptography. Understanding how Kerberos works in FreeIPA is essential for effective penetration testing.
Kerberos Authentication Flow in FreeIPA
Important Note
Credential Cache (CCache)
The Credential Cache (CCache) is a file used to store Kerberos tickets, usually located in the /tmp directory. These tickets can be extracted and used for authentication.
Penetration Testing Tip:
During a penetration test, look for CCache files in the /tmp directory that might contain valid Kerberos tickets. These can be used to authenticate as the user who created them.
Unix Keyring
Administrators can store Kerberos tickets inside the Unix keyring for added security. However, these tickets can still be extracted using specialized tools.
Tool Reference
Keytab Files
A keytab file consists of pairs of Kerberos principals and encrypted keys that are derived from the Kerberos password associated with the principal. These files are used for automated authentication without requiring a password.
Tool Reference
Important Files
Several important files are used in the FreeIPA authentication process. Understanding these files and their locations is crucial for effective penetration testing.
/etc/krb5.conf
Contains Kerberos information needed to get enrolled, such as the location of KDCs.
/etc/ipa/default.conf
Default configuration file that sets system-wide defaults for FreeIPA.
/etc/krb5.keytab
Required on all hosts inside the domain for the authentication process.
KRB5CCNAME
Location of the Credential Cache (CCACHE).
KRB5_KTNAME
Location of the keytab file.
KRB5_CONFIG
Location of the Kerberos configuration file.
KRB5_KDC_PROFILE
Location of the Kerberos configuration file with additional KDC information.
KRB5RCACHETYPE
Default type of replay cache.
KRB5RCACHEDIR
Directory for replay caches.
KRB5_TRACE
Location of logs.
KRB5_CLIENT_KTNAME
Default client keytab filename.
ipa
Standard binary for managing the domain.
kdestroy
Destroys any current Kerberos tickets in the user's session.
kinit
Establishes or renews Kerberos tickets.
klist
Lists any current Kerberos tickets in use.
kpasswd
Changes a Kerberos principal's password.
ksu
Alternative for the su binary.
kswitch
Switches the current credential cache in use.
kvno
Acquires a service ticket for the specified Kerberos principals and prints out the key version numbers of each.