LDAP (Lightweight Directory Access Protocol) injection is a type of security exploit that is used to compromise the authentication process used by some websites. Websites that construct LDAP statements from user data are vulnerable to this type of attack.
LDAP directories store objects, which include information about these users and the organization's assets. For example, an LDAP directory may contain lists of the different usernames, passwords and email addresses of the users in the organization. If an LDAP directory is used for website authentication, an attacker can enter malicious code into a user input field, gain unauthorized access to the directory, and view or change usernames and passwords.
Ví dụ về truy vấn LDAP lấy 2 giá trị truyền vào là username và pass:
Vì cách viết nối chuỗi và không lọc kí tự đầu vào. Truy vấn có thể như sau:
Bài PhoneBook HackTheBox là ví dụ điển hình cho bài viết trên.