Skip to content

Instantly share code, notes, and snippets.

@possan
Last active June 10, 2019 07:28
Show Gist options
  • Save possan/f9cdcaae0fe19da1e5fa9b1a47d132c0 to your computer and use it in GitHub Desktop.
Save possan/f9cdcaae0fe19da1e5fa9b1a47d132c0 to your computer and use it in GitHub Desktop.

Hitta trasiga filer

cd /var/www

find . \( -type f -name '*.php' -o -type f -name '*.js*' -o -type f -name '*.html' \) \
    -exec grep -q 'developmyredflag' {} \; \
    -print

find . \( -type f -name '*.php' -o -type f -name '*.js*' -o -type f -name '*.html' \) \
    -exec grep -q 'eval(String.fromCharCode(' {} \; \
    -print

find . -type f -name '*.php' -exec grep -q '](\$_COOKIE,' {} \; -print

find . -type f -name '*.php' -exec grep -q 'eval/' {} \; -print

Reparera trasiga filer

cd /var/www

find . \( -type f -name '*.php' -o -type f -name '*.js*' -o -type f -name '*.html' \) \
    -exec grep -q 'developmyredflag' {} \; \
    -exec sed -i'.bup' -e "s/^<script type='text\\/javascript' async src='https:\\/\\/css.developmy[^>]*><\\/script>//" {} \; \
    -print

find . \( -type f -name '*.php' -o -type f -name '*.js*' -o -type f -name '*.html' \) \
    -exec grep -q 'var sadads' {} \; \
    -exec sed -i'.bup' -e "s/var sadads[^)]*));//" {} \; \
    -print

find . \( -type f -name '*.php' -o -type f -name '*.js*' -o -type f -name '*.html' \) \
    -exec grep -q 'eval(String.fromCharCode(' {} \; \
    -exec sed -i'.bup' -e "s/eval(String.fromCharCode([^)]*));//" {} \; \
    -print

Ta bort alla .bup filer

cd /var/www

find . -name *.bup | xargs rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment