内网安全: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插件
.............................
等待更新吧
............................

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