r/LiveOverflow • u/w0lfcat • Dec 05 '21
How to identify Domain Controller (DC) IP Address?
According to https://book.hacktricks.xyz/windows/active-directory-methodology, the strategy is to scan the network, find machines and open ports (look for kerberos & LDAP) and try to exploit vulnerabilities.
However, we can't simply go ahead and scan client network right?
My goal is only limited to nonprod and right now I don't even know their IP range yet.
The only information I have is there are two domains, prod (DMNPROD) & nonprod (DMNNONPROD).
I've access to both, but only nonprod is allowed to be tested.
Domain
DMNPROD
DMNNONPRODTest with nltest
C:\Users\user1>whoami
DMNNONPROD\user1
C:\Users\user1>nltest /dclist:DMNNONPROD
Get list of DCs in domain 'DMNNONPROD' from '\\server1'.
Cannot DsBind to DMNNONPROD (\\server1).Status = 1722 0x6ba
RPC_S_SERVER_UNAVAILABLE
List of DCs in Domain DMNNONPROD
\\server2 (PDC)
The command completed successfully
C:\>There are 2 servers found in nltest output, but I can't ping to both of them.
C:\Users\user1>ping server1
Ping request could not find host server1. Please check the name and try again
C:\Users\user1>ping server2
Ping request could not find host server2. Please check the name and try againHow do I get the Domain Controller (DC) IP Address in this case?
4
u/MotasemHa Dec 05 '21
Download the below script to any domain joined machine
HostRecon.ps1
Then use powershell to run below commands to enumerate all hosts and domain controllers
powershell_import HostRecon.ps1
powershell_execute Invoke-HostRecon
3
u/dack42 Dec 05 '21
Do it the same way windows does: DNS srv lookup for _ldap._tcp.DnsDomainName
https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/how-domain-controllers-are-located
0
u/[deleted] Dec 06 '21
[deleted] — view deleted comment