LDAP Pass-back Attack

Requirements

  1. Access to a host that can connect to the LDAP server (e.g., a printer).

  2. The ability to modify the LDAP IP and trigger an LDAP connection session from the target (e.g., through the printer's web interface).

  3. The ability to set up a malicious LDAP server with a weak authentication mechanism (e.g., using nc, Docker, or Responder).


Setting Up a Rogue LDAP Server

1. Real LDAP Server

Install and configure the LDAP server:

Set up a weak authentication mechanism:

Create a file olcSaslSecProps.ldif with the following content:

Apply the configuration and restart the service:

Verify supported SASL mechanisms:


2. Docker Setup

Use a pre-built Docker image for the rogue LDAP server:


3. Responder

Use Responder to capture LDAP requests:


4. Netcat

Set up a listener on port 389 using Netcat:


Gathering Credentials

You can use network analysis tools to extract credentials sent to the rogue LDAP server.

Using tcpdump:

Capture raw LDAP traffic on port 389:

Using tshark:

Filter for LDAP credentials in captured traffic:


References

Last updated