Detecting VPN connection [closed]

拟墨画扇 提交于 2019-12-22 10:27:01

问题


Is it possible to check if a user is connected to a VPN and retrieve internal IP address through Javascript?


回答1:


You can't check for VPN usage nor get the IP address of a user with just JavaScript on the browser.

Your best bet would be to look for VPN IP blacklists to integrate with your server configuration, these will block most free VPNs and some paid ones but the paid ones will always keep expanding their IP address base.
One thing to add, these will cost you money, and you will restrict some users that only have access to your website via a VPN service for privacy reasons.


The webRTC leak doesn't work on all browsers and it already have extensions to prevent it, it's just a leak and the webRTC technology itself isn't implemented on IE yet!

Hope this helps.




回答2:


Maybe you can see this repo https://github.com/diafygi/webrtc-ips. it won't get block by browser plugins. But the user can disable webrtc

EDIT:

From: http://thehackernews.com/2015/02/webrtc-leaks-vpn-ip-address.html

HOW DOES THE WebRTC FLAW WORK
WebRTC allows requests to be made to STUN (Session Traversal Utilities for NAT) servers which return the "hidden" home IP-address as well as local network addresses for the system that is being used by the user.

The results of the requests can be accessed using JavaScript, but because they are made outside the normal XML/HTTP request procedure, they are not visible in the developer console. This means that the only requirement for this to work is WebRTC support in the browser and JavaScript.



来源:https://stackoverflow.com/questions/29474328/detecting-vpn-connection

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!