Cross country development, change IP address - geolocation

I am developing sites that will be used in various different countries. The code looks at the originating ip address to determine where they are coming from. I change currency etc based on this.
My problem is testing the functionality in the browser. I have had a look at the geolocator tools in firefox and chrome but these don't change the ip address to the country.
Are there any tools that I can use, preferably without installing something, whereby I can set the ip address to be coming from a different country? I have tried setting the proxy values in the internet options but this doesn't seem to work either.
Thanks

There are several proxy services that will allow you to accomplish your goal.
You can use the Tor Browser / Onion Router proxy for free. Here is a video that shows you how to choose your country. https://www.youtube.com/watch?v=5iLCgRHp_2k

Related

How to redirect traffic for my url to my own linux server?

I "own" a URL www.example.com which is currently hosted by One.com. I recently built my own server running a LAMP stack and it serves pages to the internet from /html as it should, but is only accessible via numeric IP address. In the past I've re-assigned the name servers for URL's but only using a hosting company's "dashboard" or GUI. I've read about changing the DNS settings in Ubuntu (my server is running 18.04) and also I've researched what I can into Google's public DNS and DynDNS services.
So I have two sets of questions. First, is it possible to "connect" or "bind" a URL to the static IP address of my own server without using a DNS service? Can it be done through any kind of public registry and if not, what are the least expensive but still reliable options?
Second, is basically "Why bother?" I do understand the value of a human-readable address but also, the address bar isn't realistically used anymore. Most of the security value of having human readable addresses depends on users actually looking at the address bar so that's becoming a moot argument. People only navigate the web now through links and Google searches, and the address bar is essentially a developer tool. It seems like I can pretty much replace the need for DNS with masked links and meta titles?
You need to set your domain's "A Record" in DNS to point to your server's IP address. While not neccessary, you can configure Apache to respond to the correct domain with virtualhosts [https://httpd.apache.org/docs/2.4/vhosts/name-based.html ], but you will need the DNS configured correctly first.
It is not possible to bind a domain to an IP address without DNS - DNS or Domain Name System is THE authoritative system for doing so. It's how the world wide web functions.
Here is some additional reading on what DNS does and why it's important: https://www.cloudflare.com/learning/dns/what-is-dns/

How can I use a client's IP Address for a request to another website?

I am trying to build an web app, where a client logs in and wants to send some data to another website (for example he wants to upload a csv file that the application will read and send the read data to the other website).
The website does not have an official API which I can use and they block an IP Address if it is making too many requests.
So, my idea was to use the user's IP Address to send the request in his name so that the website will not block my app from making requests.
It is possible to do this from asp .net core mvc / asp.net mvc?
If not, what can I do to make this possible?
Thanks in advance
No, this is not possible. I would encourage you to actually read up on the TCP/IP protocol (HTTP, too, while you're at it, though it doesn't directly relate to this issue). Just like you would need to understand how something like iOS works before you could write apps for it, you should not how the underlying protocols of the Internet work, if you intend to write web apps.
In particular here, all communication over TCP/IP is by IP address. It is necessarily unique because the client/server needs to be able to "address" its packets there. Based on this, even if you could impersonate the user's IP address, the result would be the server sending its response directly to the user, instead of your server.
FWIW, there is a concept of "shared" IP addresses. For example, unless you have a dedicated IP from your ISP, you along with a lot of its other customers will appear as if you all have the IP address. IP addresses are traditionally limited. IPv6 is virtually limitless, but most everything still uses IPv4, which only exposes a range of ~4 trillion addresses. That may sound like a lot, until you realize that every single client needs a unique address. Just one person likely has a home computer, a work computer, a laptop, a smartphone and perhaps even a second business smartphone. Additionally they could have a range of other devices like a tablet, smart TV, connected thermostat, etc. As a result, your ISP essentially proxies your request to the destination and it then receives the response and forwards it on to you. It uses its internal IP tables to route the response back to the internal IP that requested it. So, while it's technically possible for multiple clients/servers to share the same external IP, it is not the same as what you're talking about here.

How is the YouTube Android app accessible while the website is banned?

I'm currently living in a country in which YouTube website is banned and you'll need a VPN or a proxy to be able to access the YouTube website and videos using a web browser, but surprisingly, I've found that sometimes (most of the times actually) I can access YouTube and watch YT videos without using any VPN or proxies by using the YouTube Android application on my phone/tablet. This is related to my ISP as far as I know.
How does the YouTube Android application can connect to YouTube servers without the need of any proxies or VPN while at the same time I have to use a proxy program like "Freegate" to be able to watch YouTube on my computer? Is there a trick to do on my computer to be able to watch YT in web browsers without using any proxies?
I used an app called "Packet Capture" which captured the following IP addresses:
74.125.173.200:443
216.58.208.42:443
172.217.22.34:443
173.194.188.70:443
When I type them into a web browser, they redirect to google.com.
Android Oreo 8.1.0 and the latest version of Youtube.
My main goal is to be able to use youtube-dl without any proxies.
My question is similar to this.
Thank you.
The censors can block in a number of ways:
By modifying the ISP's DNS server to make youtube.com resolve to an IP address of their own (or just 0.0.0.0). Due to its minimal impact on the Internet infrastructure, this tends to be the preferred way in democratic countries. It can be easily evaded by using a DNS server not under the censor's control, e.g. 8.8.8.8 or 1.1.1.1.
By blocking ranges of IP addresses, for example 172.217.0.0/16. This is very likely to overblock, especially if the target is a smaller website which shares its IP range (or even IP address with others). Even in this case, outright blocking the whole /16 subnet would prevent access to google.com as well. This involves a lot of work on the censor's part, as IP addresses are routinely and automatically changed.
By reading traffic and blocking it if specific content is included. Since everything is encrypted these days, only DNS names and SNI are in the clear. There are already ongoing works to close these loopholes. The downside for the censor is that they have to read and parse every single packet, i.e. need large equipment, although if restricting to only DNS it is far more feasible. This is also likely to introduce problems for unrelated services which may occasionally be misdiagnosed.
(There are a couple of other ways and finer distinctions I'm listing in my PhD thesis on the topic of censorship, but they don't apply here).
No matter which ways the censors choose, they must feed a list of forbidden items into their equipment. In case 1&3, that's domain names, in case 2, that's IP address (ranges).
Modern services like YouTube are internally split into multiple smaller services. For instance, YouTube may internally consist of:
The web frontend, youtube.com / 172.217.22.46
The thumbnail service, ytimg.l.google.com / 172.217.21.206
The API googlevideo.com / 172.217.22.68
The video service, in multiple subdomains like r3---sn-i5onxoxu-q0n.googlevideo.com / 92.226.0.78
All domain names and addresses are examples; in practice, every service uses many IP addresses and different domain names (for instance there's www.youtube.co.uk .
If the censors in your country block only web frontend, the Android app will continue to work. The censors may also forget some domains - i.e. block youtube.com and youtube.pk and their subdomains, but not youtube.fr.
Alternatively, the censors may have tried to block the Android app by IP address, but the IP address may have been changed by YouTube, either as part of automatic internal reassignment or by explicit censorship avoidance.
The Android app contacts the internal google API, since it wants machine-readable information. So why does youtube-dl use the web interface and not the Android API?
I can't speak for all developers, but as the long-time lead developer of youtube-dl I know why I mostly focused on the web interface: It was simply a matter of convenience, as the tools to debug and observe web applications are far better than those for Android (or iOS apps). Therefore, when I added features, I would observe how the web JavaScript app realizes them, and reimplement that in youtube-dl.
So far, mainly using the web API was sufficient, but you are very welcome to add alternative code that uses the calls the Android app makes. Beware that this relief may be temporary though, as the censors may notice that the YouTube app is unblocked, and update their domain name and IP range lists to include that service as well.

Accessing a website on private network

I developed a NodeJS web application meant to be accessed on a private wifi network.
My goal is to have users connect to my server hosted on Ubuntu 14.04LTS, on which I setted up a Wifi hotspot.
The users connect to the wifi network with mobile devices, and then go with their browser to
http://my.server.local.ip/
What is the easiest way to set up a DNS (or something else) so that they are able to browse to a human readable URL instead of my IP ?
Sorry if the question has been answered before, I am a beginner in network configuration and I may not search the good keywords.
Thanks for reading
EDIT:
I forgot to mention that my network provides no access to Internet. I already own a domain for this app, but for the online-version of it. My goal is to build a portable server machine which can serve the application to mobiles on bad Internet coverage areas.
This depends on which machine acts as the DNS-server for your network. Does your Server/WiFi-AP just redirect/bridge the traffic to an ethernet-port and the DHCP-requests from the mobile devices are answered by another device (router-box?) in your network? In that case, that box will also be the DNS-server the mobile devices will be querying for hostname resolution. Maybe you can configure a static IP and hostname for your Ubuntu-server in the router's web interface.
Otherwise, you can set up a DHCP and/or DNS-server on the Ubuntu-machine. A lightweight tool for this job is DNSmasq (http://www.thekelleys.org.uk/dnsmasq/doc.html). This seems to be what you want, reading your latest comment. Configure a static IP address for the server-machine's WiFi-Interface and configure your DNS-server running on the Ubuntu-machine to map the hostname/domain of your choice to that IP. Then the mobile devices can access the website delivered by the Ubuntu machine by using that domain name.

how to restrict a web portal to a particular computer?

I am in the process of creating a Ruby on rails portal
This portal requires a lot of data feeding by the site owner's back-office personnel.
My client has this problem :
the office staff should not be able to access the back office interface from any other than his office computers
I have no idea how to achieve this. Is there a method for this?
Thanks in advance.
Edit:
Is tracking the Mac address a good solution.? is it possible if a ok?
I don't think that you should do anything in rails - this should be configured elsewhere. If rails is running on Apache then see mod_access.
The best way to set this up is to have the app hosted INSIDE the organisation's firewall. Best option - server lives inside the company on a subnet isolated entirely from direct internet access.
If you currently host outside the company, you can set up a firewall that prevents access from unknown IP addresses. You would only accept requests that come from the company's IP ranges. Ideally, you do this at the host/operating system level.
If that can't work, you can do add to your Rails authentication - detect the IP address of the request and if it is not in the company range, prevent access.
found a solution. Using a java applet one can access the machine's hardware details including MAC address. am using this idea.

Resources