Skip to content

Instantly share code, notes, and snippets.

View ThakurGumansingh's full-sized avatar

Thakur Gumansingh ThakurGumansingh

View GitHub Profile
@ThakurGumansingh
ThakurGumansingh / malware-removal.sh
Created September 12, 2023 06:47
This script will check for any htaccess present in wp folders and if exists, it will rename it and will create a new htaccess in root_dir with default rules and downloads core files.
#!/bin/bash
# Function to search and rename .htaccess files
search_and_rename_htaccess() {
local dir="$1"
if [ -f "$dir/.htaccess" ]; then
echo "Found .htaccess in $dir"
mv "$dir/.htaccess" "$dir/.htaccess-bak"
echo "Renamed to $dir/.htaccess-bak"
fi