read MAC address of machine from Adobe AIR - apache-flex

i want to read MAC address of machine from Adobe AIR. I am using flex 3 and AIR 2.
how can i do this
the main purpose is i want to install that product in only one machine

var ni:NetworkInfo = NetworkInfo.networkInfo;
var interfaceVector:Vector.<NetworkInterface> = ni.findInterfaces();
Taken from the Network Info sample in the desktop version of Tour de Flex.

As far as I can tell, you cannot do it with Flex/AIR alone - you can however use the NativeProcess API to communicate with a Java/C program that can do this for you.
If you want to limit your application to just one machine, why don't you just install it manually without giving away the setup file - is it a remote machine? Even in that case you should be able to do a remote installation, right?

The answer "track the combination of IP address and user ID" won't satisfy my (very similar) needs. If the (laptop) computer is moved across WiFi domains, its IP address will change. If the computer is on a commerical IP provider, the IP address can often change without warning or notice.
My users don't want to deal with such problems. They don't even want to know that these problems exist!
The binding of MAC address and user ID can be done at installation time. It's not perfect, but it's pretty good.
Of course what we need is an implementation of public-private key...
Oz

Related

How to get MAC address in asp.net? [duplicate]

I'm looking for a solution to find out about the MAC number of a user using asp.net website. I know you can get an IP address (don't know why but it can't be complicated) but can i find out the MAC address having the IP?
Edit: I mean programmatically (not manually) in .NET
The IP address is necessary for routing the communication between the client system requesting the information and the server. You can get it, because the IP address is pulled from a lower level in the TCP/IP stack (level 3 I believe). The MAC Address isn't necessary for any of this and hence it isn't included in the communication between the client and the server.
If your site is trusted, you can do this in IE:
http://www.devarticles.com/c/a/JavaScript/Advanced-JavaScript-with-Internet-Explorer-Retrieving-Networking-Configuration-Information/1/
I wouldn't expect it to work for any typical visitors, just users who's systems you already control, like on your local network. There may be a second way in IE if you can find a common activex that generates a guid using CoCreateGuid. It returns the mac address in part of the guid. I wouldn't bet on finding one that's commonly installed though.
no chance to get this sorry.
Even if you could it would not make sense to attempt to get this, when I access a website on the internet my MAC address never leaves my home network.
Ok if the user was on the same LAN say in a company intranet for example this could be determined by having the ip address and using command line tools like arp.
ARP stands for Address Resolution Protocol and it can be used for finding a host's link layer (hardware) address when only its Internet Layer (IP) or some other Network Layer address is known.
Java 6 has a NetworkInterface#getHardwareAddress() method which usually returns the MAC address of the computer in question. You could create a small Java applet to communicate with your web server to obtain the MAC address, though there are ways and means of spoofing a MAC address.
The MAC address you get might not be practical to use. If someone has multiple network adapters then they also have multiple MAC addresses. And it's not uncommon anymore that someone has two networks. (For example, bluetooth, regular cabled and WiFi would already be three.)
A MAC address is just for identification and it can be requested. The Address Resolution Protocol is created for this purpose. By arping you can get a MAC address. Unfortunately, this only works on local networks, not on the Internet. I think that by using IPv6, you might also have a few options. Although I think it would still be limited to just a local system.
Getting the MAC address of your visitor might be considered inappropriate and perhaps even criminal since a MAC address is generally used as an unique identifier. This information could be misused by hackers, especially when the hacker manages to gain physical access to the users network. It would allow him to impersonate the user. Your site might make some security specialists very unhappy...
At http://www.ipaddresslocation.org/find-mac-address.php there's a Java applet which they claim will work. It doesn't on my system with Google Chrome, though.
I have a similar problem (I'm using the client device MAC address as a key to target different content at different devices). This thread has been useful. Given that there seems to be no way to do this implicitly I have instead included the MAC address as one of the parameters passed by the client to the web service.
(N.B. This is not a generic answer, it only makes sense where the client and server are tightly integrated and where there is scope for passing data with the call.)
I don't think this is possible on any platform.

AIR/Flash Player connect to another machine without cirrus/stratus

Is it possible to connect to a Air app running on another machine via socket(assuming we know ip) or some other mechanism(which doesnt use Cirrus/stratus)? If it is can someone please help me on how?
Let me rephrase question, I dont want to connect to a server over socket. I would like to know if it is possible to connect from one AIR app on machine A to connect to another AIR app on machine B via sockets without cirrus. I'm not asking for someone else to do my work, I couldnt find any documentation or possibility of the above thing. My conclusion now is that it is not possible, but I would just like it to be verified by other people(experts).
Absolutely, as3 supports sockets. http://www.ultrashock.com/forum/viewthread/81676/
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html?filter_flash=cs5&filter_flashplayer=10.2&filter_air=2.6
There are two ways to do it. One AIR app can act as a server by creating a ServerSocket object while the other app connects to this with the Socket class. The other way is to use the DatagramSocket class.
In both cases, the trick is that because of network access translation, the IP address to use is not always easily discoverable unless at least one of the computers has a static IP. If both computers are on the same network subnet you can look up the IP address needed to reach one computer from the other manually. Otherwise, the IP one computer must use to reach the other won't be the same IP that the computer sees for itself. This matchmaking is the service that stratus/cirrus provides.
See http://www.brynosaurus.com/pub/net/p2pnat/ for a description of the problem.

Use Synergy on a computer on a workgroup and a laptop on a different domain

So, I recently installed synergy because I was tired of using two mice and keyboards. Problem is, set up is not working. First, the setup.
Server:
Desktop
Windows 7 64 - on our home network, part of Workgroup: WORKGROUP
Client:
work issued laptop
Windows XP SP2 32 - on home network, part of workd Domain: DOMAIN
Server is set up, all the computer names are correct. I'm a bit of a noob at networking things, and I don't want to mess up the configuration of my work laptop again (I already switched the domain to my workgroup, BAD). So, any suggestions that aren't too crazy please, since it's a company laptop.
I've tried putting in the ip on the client as well, firewall is allowing on the port in use, just can't get it to work. I think I'm SOL with the Workgroup/Domain difference though...
From what I remember, Synergy doesn't care about the workgroup and/or domain, it just needs to be able to communicate with the server/client IPs. Did you try to manually insert IPs of client/server?
In a very similar situation I discovered that when trying to ping my non-domain desktop with its workgroup name the dns resolver was appending the work domain to the desktops name. So when I tried synergy with an IP address I successfully connected the two computers.
The only caveat I can offer is maybe you needed to add the application to the windows firewall exception list for both machines. I would assume the port setting was the same between the two computers (default is 24800) in which case you should only use the IP address because the application knows to access 24800 via that setting in the advanced configuration.
You can add the program to the whitelist or specifically the port if you prefer via the Windows Firewall. On a side note - I am also using an older version of synergy (1.3.1) and not the latest as of this answer (1.4.2 Beta) which did not work for me, but I will assume it's because my server was running 1.3.1.
I chose not to update all 6 machines and their respective horrific configuration constructs that synergy loves to enforce upon us. [caution... rant: x is left of y and y is right of x... really? are you sure about that Einstein? Synergy could at least INFER that bit of logic instead of REQUIRING it!]
Hope that helps.

control a users USB device via a webpage? Possible?

I'm wondering if there is a way to create an asp.net webpage that will connect a visitors USB device to an application on the windows bases server? This way we avoid having to install a software on the visitors computer to control a USB device update that they purchase form us.
All they have to do is visit our update page, plug their deivce to the USB, and have our site update the usb hardware.
Possible? or am I dreaming? :)
i found software like: USB over IP, and few others. But not show ure its possible to create a C# or vb.net based ASP.net page to control the visitors USB device.
Please advise.
In general, Web pages and scripts that run in browsers are limited in what local system resources they can access. Direct access to hardware like USB devices has obvious security implications.
The only way I can think of to do this might be an ActiveX control (IE only, I think) or some other kind of browser plugin.
One possibility is building a webserver into the USB device. Give the device internet access, and get it to download its own firmware in a process controlled through the webpage that the usb device serves.
Note that I have no idea if this is actually possible, just thought I'd throw in this different way of looking at the problem.
It is possible to create an ActiveX/.NETcontrol/Java Applet that will do it.
Granting the rights to this thing to access local devices will require certain security setup which can be automated, but in any case will require some user consent/interaction
I see here 2 ways:
ActiveX control
The problem is that the user should first download and install the
ActiveX from an Internet web server or from a local file
USB Device driver + DHCP Server + Web server embedded in the
device
Your USB device, once plugged, should present itself as a "Virtual
Ethernet Interface" in order for Windows to add the driver to the
list of the Internet Connections.
The Device should have also a DHCP server in order to give Windows
an IP address. Beware of the fact
The USB Device should also have an HTTP server.
At the end of this process, Windows will have 2 IP addresses.
Now you have to figure out how to have IE point to the index.html
file of the device.
Buy/Find a commercial software
You are not the first guy on this planet that has similar
requirements.
The only way I can possibly imagine doing this is through JAVA
EDIT: Looks like there might be an ActiveX way to do this as well, though ActiveX is Internet Explorer only, which limits it's usability.

Router to handle multiple public IP addresses

I am presently running several websites and a mail server from my home network. I have a business DSL account with 8 public IP addresses (1 by itself, and 7 in a block). To handle routing/firewall/gateway, I am presently using RRAS, DNS, & DHCP from Windows 2003 running on a ancient (circa 2001) PC -- which I suspect is going to fail any time now.
What I would like to do is replace that with a simple router. Have a consumer model LinkSys Wifi-router, which I'm presently just using as an access point (don't have the model number handy, but it's one of their standard models). It seems to be able to handle all the NAT/firewall/DHCP tasks -- except for handling routing the multiple public addresses. (e.g., I need x.x.x.123, port 21 getting to one machine, but port 80 of x.x.x.123 & x.x.x.124 to going to another, and x.x.x.123, port 5000 to still another etc).
So my questions are:
Can this be done with standard Linksys router, which they just don't explain in the consumer manual?
Can this be done ... if I replace the firmware with a community/OS version (and if so, which one?)
If neither of the above, can someone recommend a profession router (preferably with wifi) that does do this, which is close to a consumer level price point.
Alternately, is there a reliable OS/3rd party replacement to RRAS which handles this (since RRAS is the part causing the most trouble)
Alternate-Alternately, can someone point to a VERY simple HOWTO to doing this (ie. follow these steps and forget about it), to installing a LINUX system to do this) (since I assume I can run Linux longer on the old machine)?
This can't be done on a Linksys router with stock firmware. It can be done if you load a third-party firmware, but there's no GUI (afaik) to accomplish it, so you'll be hacking system shell scripts which is pretty hairy. I would recommend getting a low-power or older PC and installing PFSense.
PFSense is an open-source router appliance OS distribution with a very easy to use web front end.
Install DD-wrt On your linksys box. I believe this will have everything you need link text

Resources