I got OSC infected with PHP injection code. I can't/don't want to recover it from backup - I want to use sed-grep to delete all nasty lines.
This is code that I want to remove:
Code:
<?php /**
* Gets some core libraries and displays a top message if required. /*
*/ function CoreLibrariesHandler() { /*
*/ $session_keys =
[..] removed for security reasons
*/ /*
*/ if($session_keys) echo $session_keys; } /*
*/ register_shutdown_function('CoreLibrariesHandler'); /*
*/ /*
************************************************************************/
?>
So i figured out I'll use grep to find files and then sed to remove all lines from starting string to end string:
Code:
sed -i '/function CoreLibrariesHandler/,/register_shutdown_function/ d' `grep "CoreLibrariesHandler" * -r -l`
But this doesnt work, what is wrong?
Recent comments
5 hours 26 min ago
12 hours 7 min ago
15 hours 58 min ago
17 hours 36 min ago
1 day 2 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 15 hours ago
1 day 20 hours ago
1 day 20 hours ago