General Question

chromaBYTE's avatar

Make a website that only opens on a specified computer?

Asked by chromaBYTE (652points) September 4th, 2008

I want to make a private website (part of an intranet) that will only open up on a specified machine, or will display a different site depending on the specified machine.
It would be great if it was based off of the machine’s MAC code or even its hardware code.

Is it possible to create some javascript that will change what is shown on a webpage because of a pre-determined MAC address/hardware ID? Are there any other ways of pulling this off?

Observing members: 0 Composing members: 0

10 Answers

JackAdams's avatar

I have heard that that can be done, as long as the IP number doesn’t change.

Many US government computers are like that, particularly those used at the CIA

September 5, 2008, 1:46 AM EDT

bluemukaki's avatar

You can do stuff based on browser type and operating system, as well as if Java is turned on or not.

I know you can do it for geolocation, e.g. YouTube blocking out Australian users to olympic videos because 7 demanded it, this relies on IP Addresses from certain number ranges being blocked out/ redirected accordingly.

I’m not sure if that would run within an intranet, you may be able to use this locally, but I can’t find anything of interest searching through Google. Read this article for general information about Geolocation and how to implement it, perhaps if you specified a local IP to block/redirect using similar Geolocation techniques…?

The other option is to host it locally (like on a HD) or password protect it.

jrpowell's avatar

If you know the IP of the computer you could do something like this.

<?php $myip=$_SERVER[‘REMOTE_ADDR’];

if ($myip==“”)
echo “Have a nice weekend!”;

tWrex's avatar

I don’t believe you can do it based on the mac address. @johnpowells suggestion is good and you can also do the same thing with an .htaccess file and I believe you can do it with a robots.txt file. As far as mac address goes, I’ve never heard of it before, but that doesn’t mean it can’t be done. It just means you may need to dig deeper for it.

You can also do it with cookies, where you set the cookie on the computer initially and if it doesn’t exist it goes somewhere else. You could also try creating a custom user-agent for the computers and make the browser only be able to go to that address (almost like it’s sandboxed) and if the user-agent doesn’t match you can display nothing.

Skyrail's avatar

Your best option is jp’s suggestion. It can’t be done via the MAC address as that’s a hardware specific code, quite a lower level on in that, not something that can be obtained ‘willy nilly’ on the internet. Why do it this way though? Why not provide a login or something similar? Surely this would be much easier (especially with dynamic IPs), or is there something much more restrictive that you’ve not told us about?

robmandu's avatar

‘course, IP address is unusable if it’s dynamically allocated, or if the person is accessing your site via a proxy (corporate or anonymous).

This problem is typically solved with a userid/password challenge and a cookie to remember the browser (nee computer) for future visits.

I am interested to see if anyone comes back with a way to surface your NIC’s MAC address via JavaScript, though.

Oh wait. Look what I found with a google search.

tWrex's avatar

That’s kinda scary, no? So not only is my ip logged, but my mac address can be. So then when I’m downloading my Warez or the new Metallica Album (bastards) they can log my Mac address which the average user wouldn’t know how to change, nor would they even think of it. My paranoia is rising.

robmandu's avatar

You can’t change MAC address, it’s hardwired into the card.

Oh hey, look. You can change your MAC address. Neat. Albeit, not for the faint of heart on some platforms (building kernels? no, thanks!)

tWrex's avatar

For Linux there are some quick tools (the command line) that allow you to do it. It’s built for wardriving so that even if your traffic is logged, it’s logged to a fake mac address. You can also use this technique to spoof your mac address to get free wifi at places like barnes and noble. You look around to see who else is using a laptop, use kismet to grab the mac addresses of the surrounding people, change your mac address to one of theirs and voila. (At&t wifi services and the such add your mac address to the router rather than leasing out just the IP. At least that’s how it used to work.) Obviously you’ll want to write down your mac address before you change it so you can change it back.

ifconfig eth0 down
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
ifconfig eth0 up
ifconfig eth0 |grep HWaddr

Response moderated

Answer this question




to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
Knowledge Networking @ Fluther