Kubernetes exposes container execution through two connected paths. The first is the API server: kubectl exec -it <pod> -- /bin/sh sends a create request against the pod's exec subresource, the API server authorizes it against RBAC, then forwards the request to the kubelet on the node hosting that pod. The kubelet opens a streaming connection into the container runtime and attaches a shell, all without ever creating a new pod or pulling a new image. Docker outside Kubernetes works the same way at a smaller scale: docker exec -it <container> bash calls the daemon's /containers/{id}/exec/create and /exec/start endpoints, which the daemon services directly against the running container's namespace.
Because the container is already running, exec does not touch the deployment pipeline at all: no new pod spec, no image pull, no admission-controller review, none of the checks a cluster might apply at deploy time. Anyone holding a valid kubeconfig with create permission on pods/exec, or direct network access to an exposed kubelet API on port 10250, can run arbitrary commands inside that workload. The same is true of an operator with access to a container orchestration UI or an unauthenticated Docker socket, which is why attackers who compromise a build agent or a developer's laptop often go straight for exec rather than trying to redeploy anything.
Attackers use the technique two ways. Some, like Kinsing, bake the malicious command into the container's own entrypoint so it fires the moment the container starts, no live exec needed. Others reach into containers that are already running: Hildegard drove commands through the kubelet API's run endpoint, and Siloscape relayed kubectl commands through an IRC channel to reach Windows containers it had already compromised. Both routes land in the same place, a shell or a one-off command running inside a container the attacker does not own.