Script runs on OSX
You will need a copy of the whole directory structure of clean site source. (clean-folder)
You will need a copy of the whole directory structure of hacked site source. (infected-folder)
brew install coreutils colordiff
-
Run this command to get the files-to-copy.txt file:
./getmodifiedfiles clean-folder-path infected-folder-path
-
In .tmp/files-to-copy.txt remove the unnecessary folder path prefix before every file
-
Copy the files-to-copy.txt file into the clean folder
-
In the clean folder, run:
zip restore.zip $(cat files-to-copy.txt) -r
-
Overwrite the infected files with the zipped ones.
-
Run this command to get the newfiles.txt file:
./getnewfiles clean-folder-path infected-folder-path
-
In .tmp/newfiles.txt remove the unnecessary folder path prefix before every file
-
On your server delete the files which are inside newfiles.txt