Regex to remove and preserve lines
pI'm looking to use the following regex line to remove malicious code from
my site;/p pcodefind -type f -name \*.php -exec sed -i
's/.*eval(base64_decode(\CmVycm.*/lt;?php/g' {} \;/code/p pThis will
preserve codelt;?php/code which I want but I noticed that many of the
injections are throughout php files on multiple lines, meaning not just
the very first codelt;?php/code So is it possible to do an if do otherwise
statement where if its on line 1 of a php file preserve the php tag
otherwise remove the entire line if its anywhere else?/p
No comments:
Post a Comment