Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2021-25741 — Exploit for CVE-2021-25741 Kubernetes vulnerability allowing host filesystem mount into pods via race condition, with deployment scripts and technical details. | Kitploit
Tools/GitHubGitHub/betep0k/cve-2021-25741
Vulnerability AnalysisExploitationPenetration TestingCloud SecurityContainer Escape
GitHubbetep0k/cve-2021-25741

CVE-2021-25741

Exploit for CVE-2021-25741 Kubernetes vulnerability allowing host filesystem mount into pods via race condition, with deployment scripts and technical details.

View Repository
3014454 years agoReviewed by Kitploit
Share

About

It's exploit for CVE-2021-25741 vulnerability. This vulnerability allows to mount Node filesystem inside of new POD with read-write privileges.

You can read more about the vulnerability here:

https://security.googleblog.com/2021/12/exploring-container-security-storage.html

I'm not author of this vulnerability and just made an exploit.

Thanks to @russtone and @maximusfox for the help with development of the exploit.

Conditions

  1. You have privileges to create new PODs
  2. Nodes have vulnerable kubelet

Vulnerable versions of the kubelet:

  • v1.22.0 - v1.22.1
  • v1.21.0 - v1.21.4
  • v1.20.0 - v1.20.10
  • <= v1.19.14

How to use

Just run run.sh and wait :) Exploiting will take some time (for me it was 10-20 minutes) because it's based on the race condition.

chmod +x run.sh; ./run.sh

When you get message "Success" you can attach to the POD and find Node filesystem in /mnt/data directory. For attaching you can use next command:

kubectl exec -i -t cve202125741 -c mount-container -- /bin/sh

Technical Details

Exploit has 2 parts:

  • pod.yaml

    YAML file with pod configuration that exploits vulnerability. Because of race conidition it doesn't work every time, so you should do it in a loop.

  • run.sh

    Scripts that deploys pod.yaml, checks result and re-deploy it if it's required.

As renameat2 binary with RENAME_EXCHANGE option I used this code: https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f

You can compile it by yourself and replace in pod.yaml if you want:

gcc renameat2.c -o renameat2
base64 renameat2

Troubleshooting

I don't have kubectl in a system

Solutions:

  1. Just download it from official website and push to your system
  2. If it's not possible then you need to rewrite run.sh and send HTTP requests directly to Kubernetes API without using of kubectl

I don't have privileges to run /bin/sh on the POD

Solutions:

  1. You can try to bind /bin/sh to TCP Port and connect to this port.
  2. You can edit pod.yaml and add required commands. It will be executed in the deploy process.
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    806
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    523
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    441
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    346
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    270
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    264

Explore all tools

Browse our collection of tools

View all tools →