看某东手机客户端被插入广告

某一天,准备某东白条还款的时候,突然看见界面底部有个广告条。

广告的内容看着怪怪得感觉。
如图:
图片描述
图片描述

点开其中一个广告条的内容
图片描述
图片描述

他们自己本身就是电商平台,而且自己有金融分期的能力,怎么会有这样的广告条接入第三方的分期功能呢。

想想可能是被植入广告了吧。蛮好奇这个是怎么进去的。

正好路由器有个抓包的功能,试试看。

打开抓包功能,然后打开APP,然后逛了一下相关的页面,点了一下弹出来的广告。

粗暴的抓了两段。然后拿下来用Wireshark看了一下。

clipboard.png

打开内容,都快吓到了。

白条内容页面这样涉及到钱、款、隐私等等信息的页面,居然还走的http协议!!!(买不起CA数字证书可以去你们友商QCloud那里申请免费的呀,虽然只有DV证书)

clipboard.png

大概过滤了一下内容,很容易就找到了

clipboard.png

顺道带走了好多的信息。
clipboard.png

然后,应该就是这个请求被修改了吧。(而且在请求参数里带上经纬度信息现在看来倒是蛮危险的事情!!!)

clipboard.png

具体的内容,有个 iframe 在里面。不确定后面那一小段的乱码是啥。

感觉这段代码不像是jd自己的。

因为页面里面引入了libs.baidu.com/jquery/1.7.0/jquery.min.js
而jd自己引入的是static.360buyimg.com/finance/mobile/base/1.0.0/js/lib/??zepto-1.1.4.js,fastclick.js

clipboard.png

拿出来的html内容。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script type="text/javascript" src="http://libs.baidu.com/jquery/1.7.0/jquery.min.js"></script>
</head>

<body style="margin: 0px;">
  <iframe src="http://btm.jd.com/?lng=121.329011&lat=31.134046&un_area=2_2834_51987_0&sid=a114317f9499807570ea1d4fbdf62dfw&_t=1477486222983" style="width: 100%; height: 100%" frameborder="no" scrolling="auto"></iframe>
  <script type="text/javascript">
    $("iframe").height($(document).height());

    function change() {
      if (document.domain.indexOf(".") != -1) {
        try {
          document.domain = document.domain.substring(document.domain.indexOf(".") + 1)
        } catch (a) {}
      }
    }

    function init() {
      try {
        if (window.frames[0].location.href != "about:blank") {
          var b = window.frames[0].document;
          if (b) {
            $(b).ready(function() {
              var e, c = $(b).find("meta[name='viewport'][content]");
              if (c.size()) {
                $(document).find("meta[name='viewport']").attr("content", c.attr("content"));
                var d = c.attr("content").match(/initial\-scale=(["']?)([\d\.]+)\1?/);
                d && (e = parseInt(1 / parseFloat(d[2])))
              }
              document.title = b.title;
              $(b).find("body").width($(window).width());
              $(window.frames[0]).bind("unload", _close_callback);
              $(window.frames[0].document).find("a, form").attr("target", "_top");
              _show_callback(e)
            });
            return
          } else {
            change()
          }
        }
      } catch (a) {
        if (a.code == DOMException.SECURITY_ERR) {
          change()
        }
      }
      window.setTimeout(init, 500)
    }

    function _show_callback(b) {
      b = b || 1;
      var a = "http://118.178.108.0/js/banner/index.html";
      a += ((a.indexOf("?") != -1 ? "&" : "?") + "_us=" + encodeURIComponent("MEsrYjl0WDZwaVBQeGRleUxJR2gzUT09"));
      $("body").append('<div style="position: fixed; z-index: 9999; width: 100%; height: ' + (b * 60) +
        'px; left:0px; right:0px; bottom: 0px; overflow: hidden;background: rgba(255,255,255,0.8);"><span onclick="_close_callback()" style="position: absolute; right: 0px; width: ' + (b * 20) + "px; height: " + (b * 20) +
        "px; cursor: pointer; z-index: 999999; background-color: rgba(0,0,0,0.3); color: white; font-weight: bolder; line-height: " + (b * 20) + "px; text-align: center; font-size: " + (b * 20) + 'px;">..</span><iframe src="' + a +
        '" frameborder="no" scrolling="no" style="width: 100%; height: 100%"></iframe></div>')
    }

    function _close_callback() {
      $("body > div").remove()
    }
    $(document).ready(init)
  </script>
</body>

</html>

今天刷微博的时候看到了这样一条内容。
图片描述

虽然 HTTPS 也有可能被插入广告,但是全站 HTTPS 依然还是很有必要的!

虽然 HTTPS 也有可能被插入广告,但是全站 HTTPS 依然还是很有必要的!

虽然 HTTPS 也有可能被插入广告,但是全站 HTTPS 依然还是很有必要的!

要是谁动点歪脑筋,篡改的是其他的请求里的内容,故事估计就多了。

本文转载于:猿2048➸https://www.mk2048.com/blog/blog.php?id=hhjbjikb2ib

猜你喜欢

转载自www.cnblogs.com/homehtml/p/12590808.html