Post-Exploitation Techniques
Methods to maintain access, escalate privileges, and move laterally within a compromised FreeIPA environment.
Ethical Use Only
Persistence
After gaining initial access to a FreeIPA environment, establishing persistence mechanisms ensures continued access even if the initial entry point is discovered and closed.
User Creation
Creating backdoor user accounts is a common persistence technique. In FreeIPA, this can be done using the IPA CLI or LDAP modifications.
Security Consideration:
Creating admin users might trigger alerts. Consider using a less privileged account with specific privileges instead, or creating a user with a name that blends in with existing naming conventions.
SSH Key Backdoor
Adding SSH public keys to existing user accounts provides a stealthy way to maintain access without changing passwords.
Example LDIF file for adding SSH keys:
Kerberos Golden Ticket
Creating a Kerberos golden ticket provides persistent access to the FreeIPA environment by forging a Ticket Granting Ticket (TGT).
Diagram showing the process of creating and using a Kerberos golden ticket
Lateral Movement
Lateral movement involves using compromised credentials or systems to access other systems within the FreeIPA environment.
Pass-the-Ticket
The pass-the-ticket technique involves using captured Kerberos tickets to authenticate to other services without knowing the account password.
SSH Access via Host Keytabs
Host keytabs can be used to authenticate as the host principal, potentially leading to further access within the environment.
Lateral Movement Tip:
When moving laterally, look for hosts with trust relationships or shared service accounts. These can provide paths to access additional systems within the environment.
Data Exfiltration
Extracting valuable data from the FreeIPA environment can provide insights into the organization's structure, user accounts, and security posture.
LDAP Dumping
Extracting information from the LDAP directory can provide valuable data about users, groups, and access controls.
Data Sensitivity Note:
LDAP dumps can contain sensitive information including user details, group memberships, and access control rules. Handle this data with care and in accordance with the rules of engagement for your penetration test.
Certificate Extraction
Extracting certificates and certificate authority information can provide insights into the organization's PKI and potentially be used for further attacks.
Password Policy Information
Extracting password policy information can reveal weaknesses in the organization's security posture.
Covering Tracks
After completing the penetration test, it's important to clean up any artifacts and ensure that the environment is returned to its original state.
Log Cleanup
FreeIPA logs various activities, including authentication attempts and administrative actions. Cleaning up these logs can help cover tracks.
Ethical Consideration
Removing Backdoors
Any persistence mechanisms or backdoors created during the penetration test should be removed to return the environment to its original state.
Cleanup Checklist
Use this checklist to ensure that all artifacts from the penetration test are properly cleaned up.
Penetration Test Cleanup Checklist:
- Remove any created user accounts
- Remove any added SSH keys
- Remove any modified group memberships
- Delete any extracted data files
- Remove any created certificates
- Clear Kerberos tickets (kdestroy)
- Document all cleanup actions in the penetration test report
Diagram showing the process of cleaning up after a penetration test