> For the complete documentation index, see [llms.txt](https://jtz.gitbook.io/web-security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jtz.gitbook.io/web-security/gong-ju/duan-kou-fu-wu/139-and-445-smb/rpcclient.md).

# rpcclient

> 允许我们手动与 SMB 交互并发送特定信息请求的工具
>
> [rpcclient 使用手册](https://www.samba.org/samba/docs/current/man-html/rpcclient.1.html)

```shell
# RPC 客户端
rpcclient -U "" 10.129.14.128
# 一些特殊命令，获取相关信息
srvinfo  # 服务器信息
enumdomains  # 枚举部署在网络中的所有域
querydominfo  # 提供已部署域的域、服务器和用户信息
netshareenumall  # 	枚举所有可用的共享
netsharegetinfo <share>  # 提供有关特定共享的信息
enumdomusers  # 枚举所有域用户
queryuser <RID>  # 提供有关特定用户的信息
querygroup <RID>  # 提供有关特定组的信息
```

> 但是，也可能发生并非所有命令都对我们可用，并且我们对用户有一定的限制。但是，queryuser 大多数情况下允许基于 RID 进行查询。所以我们可以使用 rpcclient 暴力破解 RID 来获取信息。因为我们可能不知道谁被分配了哪个 RID，所以我们知道只要查询一个分配的 RID，我们就会得到有关它的信息。
>
> 我们可以使用 Impacket 的 [samrdump.py](https://github.com/SecureAuthCorp/impacket/blob/master/examples/samrdump.py) 的脚本文件进行暴力破解
>
> ```shell
> samrdump.py 10.129.14.128
> ```
