ly4k / Certipy

Tool for Active Directory Certificate Services enumeration and abuse
MIT License
2.22k stars 302 forks source link

Changing LDAP/LDAPS port in find #197

Open BrunoTeixeira1996 opened 4 months ago

BrunoTeixeira1996 commented 4 months ago

Hi guys, Thanks for the amazing python package first of all! Second, I am trying to use certipy in LDAPS however LDPAS is not running on default port and after checking the code looks like both LDAP and LDAPS ports are hardcoded. Is there a way to create a flag to specify the port?

BrunoTeixeira1996 commented 4 months ago

https://github.com/ly4k/Certipy/blob/2780d5361121dd4ec79da3f64cfb1984c4f779c6/certipy/lib/ldap.py#L50-L57

fgeek commented 4 months ago

In what scenario is the port changed from the standard ports?

BrunoTeixeira1996 commented 4 months ago

In what scenario is the port changed from the standard ports?

My use case is a hack the box machine. I've noticed that the ports being used are 3268 and 3269 . That could be a flag like what certipy already does in auth with -ldap-port

fgeek commented 4 months ago

In what scenario is the port changed from the standard ports?

My use case is a hack the box machine. I've noticed that the ports being used are 3268 and 3269 . That could be a flag like what certipy already does in auth with -ldap-port

Alright. I just wanted to ask as I have never seen different ports in the field (not saying that this won't happen).

BrunoTeixeira1996 commented 4 months ago

In what scenario is the port changed from the standard ports?

My use case is a hack the box machine. I've noticed that the ports being used are 3268 and 3269 . That could be a flag like what certipy already does in auth with -ldap-port

Alright. I just wanted to ask as I have never seen different ports in the field (not saying that this won't happen).

Yes thats totaly fine and your question makes total sense 😁 So you think this should be something to consider?

BrunoTeixeira1996 commented 4 months ago

@fgeek I've created https://github.com/ly4k/Certipy/pull/198 and tested here and it worked. Maybe double check if has everything you want :)

noraj commented 2 months ago

In what scenario is the port changed from the standard ports?

image

Real DC on real client infra.

BrunoTeixeira1996 commented 2 months ago

@noraj yep that happened to me as well. I am not sure why this simple fix is taking too long to be reviewed however you could use my fork instead in the mean time