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
13 hours 29 min ago
22 hours 57 min ago
23 hours 47 min ago
1 day 3 hours ago
1 day 7 hours ago
1 day 8 hours ago
1 day 10 hours ago
1 day 20 hours ago
2 days 1 hour ago
2 days 2 hours ago