📘
OSCP Exam Prep
OSCP Exam Prep
OSCP Exam Prep
  • Reference List
  • Guideline
  • Commons
    • Basic Scans
    • Service Enumeration
      • HTTP(S) (80 / 443)
      • SMB (139 / 445)
      • FTP (21)
      • DNS (53)
      • SSH (22)
      • LDAP (389/636/3268)
      • Kerberos (88)
      • SNMP (161)
      • SMTP (25)
      • RDP (3389)
      • Evil-WinRM (5985/5986)
      • MYSQL (3306)
      • MSSQL (1433)
    • Default/Common Credentials
    • Shells
      • TTY Shell
    • File Transfer
    • KeePass Database
    • Port Forwarding
    • File Metadata
  • Attacks
    • Run a command x times
    • Public Exploits
    • User Creation
    • Password Cracking
      • Using custom wordlists
    • LFI/RFI
    • SQLi
    • PwnKit
    • SAM and SYSTEM files
    • Phishing for Access (Requires MailSVR)
    • GitDumper
  • Enumeration
    • Linux
    • Windows
  • Privilege Escalation
    • Linux
    • Windows
  • Port Forwarding Extras
    • Linux
    • Windows
  • Active Directory
    • Enumeration
    • Lateral Movement
    • Privilege Escalation
Powered by GitBook
On this page
  • 1. Scanning
  • Basic
  • LDAPSearch
  • 2. Enumeration
  1. Commons
  2. Service Enumeration

LDAP (389/636/3268)

1. Scanning

Basic

Domain Name - nmap -n -sV --script "ldap* and not brute" <IP>
Banner Grabbing - nmap -p 389 --script ldap-search -Pn <IP>

LDAPSearch

Basic - ldapsearch -H ldap://<IP> -x
Get LDAP name context - ldapsearch -x -H ldap://<IP> -s base namingcontexts

Upon getting LDAP name context -
    ldapsearch -x -H ldap://<IP> -s sub -b 'dc=<>,dc=<>'
    ldapsearch -H ldap://<IP> -x -b "DC=<>,DC=<>" '(objectClass=Person)'
    ldapsearch -H ldap://<IP> -x -b "DC=<>,DC=<>" '(objectClass=*)'
    ldapsearch -H ldap://<IP> -x -b "DC=<>,DC=<>" '(objectClass=user)' | grep sAMAccountName: | awk '{print $2}' > users.txt

2. Enumeration

Hydra: hydra -l <Username> -P <Big_Passwordlist> <IP> ldap2 -V -f

LDAP Login: ldapdomaindump <IP> [-r <IP>] -u '<domain\user>' -p '<pass>' [--authtype SIMPLE] --no-json --no-grep [-o /path/dir]

PreviousSSH (22)NextKerberos (88)

Last updated 4 months ago