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:
You can try this : https://github.com/daniyalahmadk/RMCI
Just need to put that code in box and hit submit, it will search code from files and remove them all once.
You need to add s/
at the start.
sed 's/<?php if(\!isset.*gzagexgpdc-1; ?>//g' *.php
OR
sed -r 's/<\?php if\(!isset.*gzagexgpdc-1; \?>//g' *.php
Add -i
parameter to save the changes made.
This should work.
find . -name "*.php" -print0 | xargs -0 sed -ri '1s/^<\?php if\(!isset\(\$GLOBALS\[.*-1; \?>//' *.php