Website hacked, how to remove malicious code with SED / GREP

前端 未结 3 880
夕颜
夕颜 2020-12-11 21:55

a website of mine is hacked. In every php file a line of code is added. I wont post the complete code here, but it starts with:



        
3条回答
  •  抹茶落季
    2020-12-11 22:20

    This should work.

    find . -name "*.php" -print0 | xargs -0 sed -ri '1s/^<\?php if\(!isset\(\$GLOBALS\[.*-1; \?>//' *.php
    

提交回复
热议问题