> 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/local-machine-enumeration.md).

# 本地机器枚举

面向本地机器枚举的 Active Directory 安全笔记，涵盖枚举、Kerberos、凭据、ACL 滥用、横向移动、利用流程和验证步骤。

### 基本用户和机器信息

显示当前用户名：

```powershell
$env:Username
```

显示用户域：

```powershell
$env:UserDomain
```

显示机器名：

```powershell
$env:ComputerName
```

这些命令可快速识别：

* 我们正在使用哪个用户；
* 我们所处的机器；
* 你连接在哪个域或工作组中。

### 本地组枚举

使用 PowerView：

```powershell
Get-NetLocalGroup
```

使用原生 PowerShell：

```powershell
Get-LocalGroup
```

这些命令会显示机器的本地组，例如：

* `Administrators`
* `Users`
* `远程桌面用户`
* `来宾`

### 查看 Administrators 组的成员

使用 PowerView：

```powershell
Get-NetLocalGroupMember -Groupname Administrators | Select-Object MemberName, IsGroup, IsDomain
```

使用原生 PowerShell：

```powershell
Get-LocalGroupMember -Group Administrators
```

这一步对于识别以下内容很重要：

* 本地管理员；
* 本地添加的域组；
* 在机器上拥有提升权限的用户。

### 查看用户所属的组

使用 PowerView：

```powershell
Get-NetGroup -UserName "user1" | select name
```

这可以让你知道某个特定用户属于哪些组。

值得关注的示例：

* 检查是否 `user1` 属于特权组；
* 识别诸如 `Administrators`, `RDPUsers`, `Executives`等有意思的组。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
