-1

I want to check that people who registrates in my site and check in country box , for example, Argentina is really living in Argentina. How can I make sure that people is really living in that country and not access to my site via proxy or VPN?

mesiesta
  • 101
  • 4
  • Here is a relevent question on SO: http://stackoverflow.com/questions/1000924/detecting-whether-a-user-is-behind-a-proxy – WalterJ89 Mar 05 '12 at 06:06
  • http://www.sans.org/reading_room/whitepapers/detection/detecting-preventing-anonymous-proxy-usage_32943 – WalterJ89 Mar 05 '12 at 06:09
  • I don't think you can based on the IP address. For example there is the Tor project (https://www.torproject.org/). Although you can't control which IP address is used, each user can prevent you from detecting their geographical location when they go through the Tor network. – Manfred Mar 05 '12 at 06:50
  • 2
    Why do you need to ask them where they live, if you can detect it anyway? –  Mar 05 '12 at 07:17
  • @John: I think the point is he wants to make sure people *aren't* using Tor or a proxy or something. Although, if you're using a Proxy/VPN what's to stop you just putting the country your proxy is in? – Dean Harding Mar 05 '12 at 08:30

1 Answers1

10

There's no way to guarantee where a person is based on their IP address. You can get a reasonable guess from GeoIP info. But you cannot ever really be sure. You can mess around with headers trying to guess if a proxy is being used, but headers might not always be there.

So, unless you have some legal reason to do this (for example, hosting content you're only licensed to make available in certain countries), or just want to annoy potential users who might be surfing via their company's VPN or remote desktop that happens to be hosted outside the country, I wouldnt even waste my time with it.

GrandmasterB
  • 37,990
  • 7
  • 78
  • 131