Bash 删除 </html> 之后的所有内容 [英] Bash remove everything after </html>

查看:46
本文介绍了Bash 删除 </html> 之后的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个客户的网站被黑了,每个文件中都有 iframe 注入.但是,iframe 注入总是在结束 </html> 标记之后.

One of my clients' sites has been hacked, and there is iframe injection in every file. However, the iframe injection is always after the closing </html> tag.

有没有一种简单的方法使用 Bash 删除 </html> 标签之后的所有内容,使用类似 sed 的东西?

Is there an easy way using Bash to remove everything after the </html> tag using something like sed?

例如:

</html>
p
<nofollow><iframe src="http://xxxxx.com/local.html" width="0" height="0" frameborder="0"></iframe></nofollow>
p
<nofollow><iframe src="http://xxxxx.com/local.html" width="0" height="0" frameborder="0"></iframe></nofollow>

推荐答案

打线就退出:

sed -i '/<\/html>/q' file

这篇关于Bash 删除 &lt;/html&gt; 之后的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆