Open ABILLEST opened 1 year ago
hello, 你的意思是指
if found == -1 {
fmt.Println("\tcannot find RunC process inside container, exit.")
这个逻辑应该放到for循环内,而且应该用 continue 而不是 return?
是的,我理解利用流程是攻击者在目标容器中用for循环等待host执行runc并匹配捕捉,代码可以参考您在注释中提到的poc。
hello, 你的意思是指
if found == -1 { fmt.Println("\tcannot find RunC process inside container, exit.")
这个逻辑应该放到for循环内,而且应该用 continue 而不是 return?
我觉得这个地方没必要改。 因为cve-2019-5736本来就是一个条件竞争的洞,需要在runc init进程位于容器内时,修改runc完成攻击。如果当前/proc内已经找不到runc,说明runc已经退出容器,没有必要重复循环。参见:https://unit42.paloaltonetworks.com/breaking-docker-via-runc-explaining-cve-2019-5736/ 如果还是考虑把上面的代码放到循环中,注意调用ioutil.ReadDir("/proc"),更新进程信息。 (p.s. :neargle师傅的my-re0-k8s-security写得好好!)
问题描述
执行runc-pwn模块,报出
cannot find RunC process inside container, exit.
之后,直接退出,没发生任何事就Finished。在87行的if判断中直接return退出了函数,导致宿主机还没来得及执行exec命令,目标容器就已经退出了pid的监听。一开始宿主机创建容器时runc执行完就退出了,无法获取runc的pid。
附加信息(Additional Information)
1、执行
cdk evaluate --full
的返回结果2、完整错误信息