LDAP Pass-back Attacks
Last updated
Last updated
LDAP Pass-back attacks are a method of gaining unauthorized access to a device's configuration, particularly when LDAP (Lightweight Directory Access Protocol) parameters are defined. Such parameters are often found in the configuration settings of devices like network printers, typically accessible through web interfaces.
In an LDAP Pass-back attack, an attacker manipulates the LDAP configuration, which may include the IP address or hostname of the LDAP server. The attacker replaces this information with their own IP address and subsequently triggers the LDAP configuration test. This action compels the device to initiate LDAP authentication attempts with the attacker's rogue device. The attacker can then intercept these authentication attempts, ultimately gaining access to LDAP credentials.
Note: The default port for LDAP communication is 389.
While interacting with a web interface (like the one in the picture) of a device, such as a printer, responses can be observed.
However, to effectively carry out this attack, a rogue LDAP server needs to be established and configured in an insecure manner to ensure that credentials are transmitted in plaintext.
To set up a rogue LDAP server, you can follow these steps:
Update the package list and install OpenLDAP tools:
When prompted, choose "No" to skip server configuration.
Provide the DNS domain name and use the same name for the Organization name.
Set an Administrator password.
Select "MDB" as the LDAP database to use.
For the last two options, ensure the database is not removed when purged and that old database files are moved before new ones are created.
Before using the rogue LDAP server, it must be made vulnerable by limiting the supported authentication mechanisms. This involves creating an LDIF (LDAP Data Interchange Format) file named "olcSaslSecProps.ldif" with the following content:
This file sets properties related to SASL (Simple Authentication and Security Layer) security, such as disabling mechanisms that support anonymous login and specifying that no protection is required.
Apply the LDIF file to the LDAP server and restart the service with the following commands:
You can verify that the configuration has been applied to your rogue LDAP server by using the following command:
The output should display supported SASL mechanisms as "PLAIN" and "LOGIN."
To capture network traffic related to this attack, you can use the following command with tcpdump:
This command will capture traffic, including passwords in plain text, on port 389, which is commonly used for LDAP communication.