State of the art
We only have a login form in front of us:
My first move was trying an SQL injection… It was useless, in fact it’s an LDAP injection
:
Our little asterisk *
is matching with all the accounts in the LDAP base, it’s now time to script :D
Blind LDAP Injection
Because I already did an LDAP injection on a famous french challenge platform (it starts by root
and ends by -me.org
), I know that the payload will have the following aspect
)(cn=))\x00
The cn
part will change, it’s a common field in an LDAP base, it means Common Name
. The null byte at the end is used to remove the password field.
Find LDAP fields
I built a little dictionary with all the common LDAP fields:
|
|
And then a little python script to bruteforce them:
|
|
looking for the admin email
Okay, now I will dig into the mail
field trying to find the email address of the administrator (I know my script is very, very ugly, I bruteforced manually each first letter…):
|
|
You can notice the little s
in front of my partial variable! I tried to find all a
, b
etc… And here is why s
:
s
+arah.connor.admin@yoloswag.com
looks to be the administrator. To find the username of the account, just change mail
field into cn
, it gives us: s.connor
. And now, how can we find the password? By guessing for sure! Let’s try ‘yoloswag’ as a password: