How to spoof your IP Address?
The title says it all really. Say my IP address was 1.2.3.4 and I wanted to change or 'spoof' it so that its exactly 2.3.4.5, would this be possible or are there too many varying factors that need to be taken into account before getting a definitive answer?
Why you might ask?
Well I was in a store the other day and they had iPads around the room setup so that they were showing the store's online website. I went over and looked at one and noticed that what was showing on their in-store iPads was different to what I would see by simply connecting to their site via my phone (and yes, they were both the exact same link using the same exact browser, Safari).
This lead me to think that the only way they're able to do this is by either having the site detect the device's IP address and show specific (or exclusive) content on their homepage based on that, or by having the site detect that the device is using the stores WiFi (although I doubt this is possible, hence why I thought the IP route was more plausible).
So I was curious whether it'd be possible to spoof my device's IP to that of the stores' exact IP so that my device showed exactly what theirs did in regards to their website.
To understand how to spoof your IP address, it would essentially be akin to replacing the numbers on your house from "123 Real Avenue" to "321 Fake Street" - the mailman isn't going to start delivering you someone else's mail, because regardless of what it says on your door, the house is physically on "Real Avenue". However, I wanted to suggest some other possible methods by which the behaviour you're seeing could be accomplished without having a table of "special IP addresses":
A unique (or shared) token stored in a cookie. When a browser visits a site, it checks for any cookies the site has given it in the past, sees if any are not expired, and sends those cookies with the request. These cookies can contain any amount of information about the client device, including "I'm an Apple Store display model".
A simple HTTP header which identifies the device. When visiting any page on the internet, your browser sends and receives some data that's not immediately visible to you. This data is contained in the HTTP headers, and can contain nearly anything. For example, one common header defines the type of the payload (i.e. text/html, application/json, etc.). Apple's servers could check for some specific non-standard header (such as I-AM-DISPLAY-IPAD), and send different content back to the client when this is detected.
An Authorization token which uniquely identifies the device. If security was a concern, they might instead use a unique cryptographically generated token which identifies the device as authentic. In addition to some secret data that makes it virtually impossible to spoof, this token can encode some other identifying properties of the device, making the token useless to any other device, even if you had a perfect copy.
The network may be using a man-in-the-middle to inject the extra content. While man-in-the-middle attacks are generally negative, it is not uncommon (though generally frowned upon) for ISPs or routers to inject some javascript inside of a non-secured page that you visit. There could be such a device on the network between the iPads and the internet, which is injecting the extra content only for devices which reach the site through that specific network.
The network may be using a customized DNS record. The first thing that happens when you try to visit xyz.com is that your browser/device contacts a Domain-Name System server to find out where xyz.com actually lives on the internet. While the site you visit on your device may have the same URL, the display devices could have a different IP address mapped to that URL, and go to a completely different server.
Related to above, the network may not be on the broader internet at all. The entire display device network may actually be part of a VPN (Virtual Private Network) that connects to some other set of servers that are not exposed to the internet at large. A proxy server within the VPN could forward requests to external sites so the device appears to be connected directly to the internet, but is in fact inside a massive walled garden. Please keep in mind this list is far from exhaustive! These are just ideas which I would start to investigate if I wanted to set up such a site which served different content to a select set of controlled devices.