Skip to content

Instantly share code, notes, and snippets.

@andriyun
Last active April 30, 2018 11:47
Show Gist options
  • Save andriyun/933e2b0f85d2eb1c2a0882254ff1a71c to your computer and use it in GitHub Desktop.
Save andriyun/933e2b0f85d2eb1c2a0882254ff1a71c to your computer and use it in GitHub Desktop.
This script can be heplfull if your drupal 7 site have been hacked with "eval(String.fromCharCode" javascript code.
#!/bin/sh
# Run the script and put path as first parameter.
grep -rl 'eval(String.fromCharCode(' $1 | while read -r line ; do
if [ -f "$line" ]
then
echo "Fixing file $line \n"
sed -i 's/<script language=javascript>\([a-zA-Z0-9();.,\ ]*\)<\/script>//g' $line
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment