Identificando o escopo na rede.
Vamos supor que o escopo do pentest seja o seguinte:
Apenas hosts do domĆnio LOCAL ORIONSCORP2;
Rede: 172.16.1.0/24
Como nosso alvo Ć© comprometer um domĆnio local, podemos fazer uma varredura por portas 445 abertas.
$ sudo nmap --open -v -sS -p 445 -Pn 172.16.1.0/24 -oG smb.txt
$ cat smb.txt | grep "Up" | cut -d " " -f 2 > targetsPodemos usar o crackmapexec para fazer a enumeração no arquivo targets para fazer a enumeração desses hosts.
$ crackmapexec smb targets
SMB 172.16.1.5 445 SERVER5 [*] Unix (name:SERVER5) (domain:SERVER5) (signing:False) (SMBv1:True)
SMB 172.16.1.60 445 SRVINT [*] Windows Server 2008 R2 Enterprise 7600 x64 (name:SRVINT) (domain:GBUSINESS) (signing:True) (SMBv1:True)
SMB 172.16.1.233 445 SRVSPIDER [*] Windows Server 2012 R2 Datacenter 9600 x64 (name:SRVSPIDER) (domain:DHCE) (signing:True) (SMBv1:True)
SMB 172.16.1.107 445 SMB [*] Windows 6.1 (name:SMB) (domain:SMB) (signing:False) (SMBv1:True)
SMB 172.16.1.245 445 CORPPC01 [*] Windows 10.0 Build 18362 x64 (name:CORPPC01) (domain:ORIONSCORP2) (signing:False) (SMBv1:False)
SMB 172.16.1.243 445 SERVAD02 [*] Windows 10.0 Build 17763 x64 (name:SERVAD02) (domain:ORIONSCORP2) (signing:True) (SMBv1:False)
SMB 172.16.1.253 445 CORPPC02 [*] Windows 10.0 Build 18362 x64 (name:CORPPC02) (domain:ORIONSCORP2) (signing:False) (SMBv1:False)
SMB 172.16.1.249 445 SMB12 [*] b'W\x00i\x00n\x00d\x00o\x00w\x00s\x00 \x00S\x00e\x00r\x00v\x00e\x00r\x00 \x002\x000\x000\x003\x00 \x003\x007\x009\x000\x00 \x00S\x00e\x00r\x00v\x00i\x00c\x00e\x00 \x00P\x00a\x00c\x00k\x00 \x002\x00' (name:SMB12) (domain:NOMATCH) (signing:False) (SMBv1:True)
SMB 172.16.1.4 445 WKS01 [*] Windows 5.1 (name:WKS01) (domain:GBUSINESS) (signing:False) (SMBv1:True)
Podemos assim verificar quais sĆ£o os hosts que pertencem ao domĆnio ORIONSCORP2. Para verificarmos, se de fato o host 1.243 Ć© um servidor AD, podemos fazer um scan para ver suas portas.
Podemos confirmar que é de fato pelas suas portas. Também podemos fazer algumas pesquisas DNS jÔ que esse host faz resolução DNS para comprovar o nome das mÔquinas.
Last updated
Was this helpful?