使用浏览器检测 MSISDN(手机号码)

发布于 2024-12-20 07:33:24 字数 117 浏览 2 评论 0原文

除了此 X 标头 x-up-calling-line-id 之外,是否还有其他 HTTP 标头可用于检测移动用户号码?

我想尽可能地从所有浏览器进行检测,以覆盖所有平台移动设备。

Are there any HTTP headers one can use to detect a mobile users number other than this X-header x-up-calling-line-id ?

I want to detect from all browsers as much as possible to cover all platform mobiles.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

笑叹一世浮沉 2024-12-27 07:33:24

我会给你与我对一个非常相似的问题给出的完全相同的答案,因为它应该提供一些关于你想要实现的目标的见解。

获取访问 WAP 站点的用户的 MSISDN 的能力取决于许多因素。

首先,用户必须使用移动数据。如果用户使用 WiFi,那么您将不会收到此信息。

其次,用户移动网络必须支持在HTTP标头中传递MSISDN。

一些移动网络发送所有请求的标头。其他人仅在通过特定 APN 时发送。有些只将此标头发送到特定的 IP 地址/块。我什至遇到过将 MSISDN 作为 $_GET 变量发送的网络。您需要检查您打算支持的每个网络。

例如,直到大约 6 个月前,南非的一个特定网络仍然在标头中发送 MSISDN,现在为了接收标头中的 MSISDN,您的服务器地址需要与它们一起列入白名单。

另请记住,标头很容易被欺骗,除非您能保证自己是 HTTP 请求的发起者,否则不应依赖标头,例如在 Android 应用程序内部使用 Web 视图的情况下 - 您需要自己采取足够的措施。

考虑到所有这些,您应该寻找以下内容:

在标题中查找以下任何内容。这根本不是 MSISDN 标头的完整列表,它们只是我在移动开发过程中遇到的一些标头。

  • X-MSISDN
  • X_MSISDN
  • HTTP_X_MSISDN
  • X-UP-CALLING-LINE-ID
  • X_UP_CALLING_LINE_ID
  • HTTP_X_UP_CALLING_LINE_ID
  • X_WAP_NETWORK_CLIENT_MSISDN

我所做的就是遍历标头以查找任何匹配项。如果找不到任何匹配项,我会使用特定于国家/地区的 MSISDN 正则表达式针对这些值再次运行标头,以查看标头中是否存在我不知道的键上的任何潜在 MSISDN。如果我找到潜在的匹配项,我会将密钥和数据添加到列表中,稍后我可以查看该列表,以便添加到我的已知 MSISDN 标头列表中。

我希望这已经让我们明白了一些。最重要的是要记住,这不是获取 MSISDN 的可靠方法。

I will give you the exact same answer I gave to a very similar question as it should provide some insight into what you are trying to achieve.

The ability to get the MSISDN of the user visiting the WAP site depends on a number of things.

Firstly, the user has to be on Mobile Data. If the user is on WiFi then you will not receive this information.

Secondly, the users mobile network has to support the passing of the MSISDN in the HTTP headers.

Some mobile networks send headers on all requests. Others only send if going through a specific APN. Some only send this header to specific IP addresses/blocks. I have even come across networks that send the MSISDN as a $_GET variable. You will need to check with each network that you intend to support.

For example, a particular network in South Africa used to send MSISDNs in headers until around 6 months ago, and in order to receive the MSISDN in the headers now your server address needs to be whitelisted with them.

Also remember that headers are very easy to spoof, and shouldn't be relied on unless you are guaranteed that you are the originator of the HTTP request, such as in instances where you are using Web Views inside of Android Applications - you would need to put sufficient measures in place yourself.

With all of that in mind, here is what you should be looking for:

Look through your headers for any of the following. This is not a comprehensive list of MSISDN headers at all, they are only the ones I have come across in my adventures in mobile development.

  • X-MSISDN
  • X_MSISDN
  • HTTP_X_MSISDN
  • X-UP-CALLING-LINE-ID
  • X_UP_CALLING_LINE_ID
  • HTTP_X_UP_CALLING_LINE_ID
  • X_WAP_NETWORK_CLIENT_MSISDN

What I do is run through the headers looking for any matches. If I don't find any matches I run through the headers again using a country-specific MSISDN regex against the values to see if there are any potential MSISDNs in the headers on keys that I do not know about. If I find a potential match I add the key and data to a list that I can go through later in order to add to my list of known MSISDN headers.

I hope this has bought some clarity. What is most important to remember is that this is not a reliable method for getting an MSISDN.

唔猫 2024-12-27 07:33:24

老实说,你不会想要这个功能的全部。假设您访问几个网站,它们从标题“x-up-calling-line-id”中捕获您的电话号码。这些网站将您的电话号码出售给电话推销员。你想陷入那样的境地吗?

技术原因不同。 电话号码永远不会存储在手机上(通常)。 SIM 卡通过 IMSI 号码和归属位置注册表(位于 MSC)进行识别包含将 IMSI 映射到电话号码的条目。所以回答你的问题,这是不可能的。

Honestly you wouldn't want this feature it all. Suppose you visit couple of web sites and they capture your phone number from the header "x-up-calling-line-id". And these web sites sell your phone number to telemarketers. Do you want to be in that situation?

Technical reason is different. Phone number is never stored on phone (usually). SIM card is identified by IMSI number and Home Location Registry (at MSC) contains an entry that maps IMSI to phone number. So to answer your question, this is not possible.

娇女薄笑 2024-12-27 07:33:24

在 PHP 中使用 apache_request_headers() 获取 MSISDN。但是,用户移动网络必须支持在 HTTP 标头中传递 MSISDN。

Use apache_request_headers() in PHP to get MSISDN. but, the users mobile network has to support the passing of the MSISDN in the HTTP headers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文