v 友帮忙分析下这次 https 劫持

2023-06-02 11:48:27 +08:00
 quxuanxuan

这是在 k8s 的某个 pod 里面执行的 curl 命令,然后被劫持到了 http://144.dragonparking.com

而且是偶发的,有段时间会劫持有段时间就正常

宿主机上执行 curl 没出现过劫持

这个是怎么实现的

以下是劫持返回的 html

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>tencentcloudapi.com</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script type='text/javascript' language='JavaScript'> var domain = 'tencentcloudapi.com'; var uniqueTrackingID = 'MTY4NTU3OTcwNi4xODgzOmZlODk3NWU3ODcyMjg1MDg2YWNlZGU1NTM5YWZlMTBmNDFmMWQyYzIzZTQ5MGY0OTA2MDE1ZTViN2I3ZDEwYTU6NjQ3N2U3YmEyZGZiOA=='; var clickTracking = false; var themedata = ''; var xkw = ''; var xsearch = ''; var xpcat = ''; var bucket = ''; var clientID = ''; var clientIDs = ''; var num_ads = 0; var adtest = 'off'; var scriptPath = ''; </script> <script src='//d38psrni17bvxu.cloudfront.net/scripts/js3.js' type='text/javascript' language='JavaScript'></script>
    </head>
    <body>
    <script type="text/javascript">var ls = function(xhr, path, token) {
xhr.onreadystatechange = function () {
    if (xhr.readyState === XMLHttpRequest.DONE) {
        if (xhr.status >= 200 && xhr.status <= 400) {
            if (xhr.responseText.trim() === '') {
                return;
            }

            console.log(JSON.parse(xhr.responseText))
        } else {
            console.log('There was a problem with the request.');
        }
    }
}

xhr.open('GET', path + '/ls.p' + 'hp?t=6477e7ba&token=' + encodeURI(token), true);
xhr.send();

}; ls(new XMLHttpRequest(), scriptPath, '098d33e1ee92577488c3f7c512742c23d15f6952');</script> <script type='text/javascript' language='JavaScript'> window.onload = function() { if(clickTracking && typeof track_onclick == 'function') track_onclick("8738cf3b6b543a07139579dbbd0fc3fa531854b6"); top.location.href = "http://144.dragonparking.com/?site=tencentcloudapi.com&t=1685579706&s=26356433e9449717b0e51e87ffb4349a&fs=http%3A%2F%2Fc.parkingcrew.net%2F%3Fdomain_name%3Dtencentcloudapi.com"; }; </script> </body>

</html>
908 次点击
所在节点    问与答
2 条回复
ysc3839
2023-06-02 13:10:26 +08:00
建议宿主机抓包看看
quxuanxuan
2023-06-02 16:20:20 +08:00
@ysc3839 找到原因了,是 dns 解析的问题,搜索域底下可以解析这个域名

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/945190

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX