移除 javascript 恶意软件的正则表达式问题 [英] regex question for removal of javascript malware

查看:29
本文介绍了移除 javascript 恶意软件的正则表达式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站上遇到了一些讨厌的 javascript 恶意软件.我知道每个有问题的代码块都以以下内容开头:

Been hit with some nasty javascript malware on my site. I know that each offending code block starts with the following:

<script language=javascript><!-- 
(function()

并以

</script>

我想使用某种免费软件正则表达式替换工具,通过 Windows 上的正则表达式删除讨厌的部分.这里有什么建议吗?非常感谢.

I'd like to remove the nasty bits via regex on windows, using some sort of freeware regex replacement tool. Any suggestions here? Thank You much.

推荐答案

我认为你应该使用 configure Privoxy (http://privoxy.org).它使用 PCRE 库,可用于 Windows.为了过滤,您应该执行以下操作:

I think you should use configure Privoxy (http://privoxy.org). It uses the PCRE library and is available for Windows. In order to filter you should do the following:

  1. 在Privoxy配置目录中添加

  1. In the Privoxy configuration directory add

FILTER: my-js-purger
s@<script\s+language=javascript><!--\s+(function().*?</script>@@s

user.filter文件,

添加

{ +filter{my-js-purger} }
/

user.action 文件(将 / 替换为要应用过滤器的站点的名称,或者如果要将其应用于所有站点,则保持原样网站).

to user.action file (replace / with the names of sites you want to apply filter to, or leave it as is if you want to apply it to all sites).

确保有未注释的行

listen-address 127.0.0.1:8118
actionsfile user.action
filterfile user.filter

config 文件中(我相信将它们添加到 config 文件的末尾是安全的,无论它们是否已经存在).

in config file (I believe it is safe to just add them at the end of config file regardless whether they already exist).

开始隐私.

将您的浏览器配置为使用 127.0.0.1:8118 作为 http/https 代理服务器.

Configure your browser to use 127.0.0.1:8118 as a http/https proxy server.

这篇关于移除 javascript 恶意软件的正则表达式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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