Phonebook - Hack the box Write up -- Web LDAP injection

 0x00 Problem 

0x01 Check the vulnerability

When we see the login form on the website, it might be command injection, SQL injection, LDAP injection. 

We can see that this need us to login with workstation username, it might be LDAP injection.


0x02 LDAP injection payload

Here is the basic LDAP injection payload. We can check the vulnerability.

user=*)(&
password=*)(&
--> (&(user=*)(&)(password=*)(&)) 


After we type it, we found the response shows successful, and return a page has search box.




Then we type a character in the search box, and it returns some user phonebook information. I tried 'flag', 'HTB', it doesn't find any results.




Then we try to find user 'Reese', but the information doesn't look like flag.


 


0x03 Locate the flag 

Then we change our payload to check if the password is the flag.

user=Reese
password=HTB*)(&
--> (&(user=Reese)(password=HTB*)(& 



It can also return to the search page which means it we log into the web with the payload successfully!

The password is the flag!


0x04 Brute force

We have to brute force to get the flag. The flag may contain all the lower and upper alphabets, numbers and '_', '}'. 


After a while, we get the flag!



Popular posts from this blog

wafwaf -- Hack The Box -- Web SQL injection

Cheat sheet for security+