diff --git a/pkg/exploit/k8s_shadow_apiserver.go b/pkg/exploit/k8s_shadow_apiserver.go index 4c8ba27..aa641c5 100644 --- a/pkg/exploit/k8s_shadow_apiserver.go +++ b/pkg/exploit/k8s_shadow_apiserver.go @@ -61,7 +61,7 @@ func findApiServerPodInMasterNode(token string, serverAddr string) (string, erro log.Printf("request apiserver uri `%s` error: %v, response: %s", opts.Api, err, resp) return "", errors.New("faild to request api-server.") } - if !strings.Contains(resp, "selfLink") { + if !strings.Contains(resp, "selfLink") && !strings.Contains(resp, "kube-apiserver") { log.Println("api-server response:") fmt.Println(resp) return "", errors.New("invalid to list pods, possible caused by api-server forbidden this request.")