內網安全:02.基礎命令

0x0 環境:

DomainDNSName(域的名):corp.pentest.lab
DC (域控): windows 2008 R2 [密碼是“GKNcofi&yi=”]
EmployeeA (域成員): windows 2012
EmployeeB (沒加入域):Ubuntu 18.04
內網安全:02.基礎命令

0x1 windows建立IPC$連接到DC

連接dc可以用兩種身份進行連接:
①以域賬號的administrator身份進行連接:

net use \\172.31.41.21\ipc$ "dc的password" /user:corp.pentest.lab\administrator

內網安全:02.基礎命令
②使用本地的administrator身份進行連接:

net use \\172.31.41.21\ipc$  "dc的password" /user:administrator

內網安全:02.基礎命令

連接後進行清除使用:

net use * /del  /y

0x2 linux建立IPC$連接到DC

sudo apt install smbclient      #先安裝smbclient

下面的二選一:
①smbclient -L 172.31.41.21 -U corp.pentest.lab/administrator       #以域賬號的administrator身份進行連接
②smbclient -L 172.31.41.21 -U administrator      #使用本地的administrator身份進行連接

內網安全:02.基礎命令

然後進行連接:
smbclient \\\\172.31.41.21\\C$ -U administrator    #稍後驗證密碼即可登錄

內網安全:02.基礎命令

0x3 linux系統上偵察ad

先在terminal輸入rpcclient命令進行連接:

rpcclient -U corp.pentest.lab/administrator 172.31.41.21     #連接dc[需要驗證dc密碼]

內網安全:02.基礎命令
在rpcclient中進行偵察:

rpcclient > enumdomusers    查dc上有幾個組
rpcclient > queryuser 0x1f4   通過指定rid列用戶信息
rpcclient > getdompwinfo   查domain的密碼策略

內網安全:02.基礎命令

內網安全:02.基礎命令
具體用法請參考:
https://bitvijays.github.io/LFF-IPS-P3-Exploitation.html#active-directory-reconnaissance

0x4 OS X系統上偵察ad

使用OS X操作系統自帶的命令dsconfigad:

dsconfigad -show | awk '/Active Directory Domain/{print $NF}'    #查看dc的domain是什麼
[查到:corp.pentest.lab]
host -av _ldap._tcp.corp.pentest.lab    #查dc內網幾個

一鍵導出當前域的所有用戶信息:

ldapsearch -h 172.31.0.201 -p 389 -x -b "cn=users,dc=corp,dc=pentest,dc=lab" -W -D administrator   #查corp.pentest.lab域的所有用戶信息,並導出
[注意:內網大就會顯示有很多dc,這個能查公鑰]

0x5 windows系統上偵察ad

①使用nltest命令:

nltest /dclist:corp.pentest.lab     #查當前樹下有多少dc

(nltest 用法具體請看官方手冊)
參考:http://blog.sina.com.cn/s/blog_7344759d0100opqf.html

②使用插件、開源工具
例如:lfide插件
.............................
等待更新吧
............................

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章