read ip and mac

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
how can I read the MAC and IP from the browsing internet explorer,
Using javascript, or any other simple language.

I tried this, but it causes problems when using https and when using http a
confirmation box is required by default.

                <title>WMI Scripting HTML</title>

                <script FOR="foo" EVENT="OnCompleted(hResult, pErrorObject,
pAsyncContext)" LANGUAGE="JScript">

                <script FOR="foo" EVENT="OnObjectReady(objObject,

         if(objObject.IPEnabled != null && objObject.IPEnabled !=
"undefined" && objObject.IPEnabled == true)

                   if(objObject.MACAddress != null &&
objObject.MACAddress != "undefined")
                         MACAddr = objObject.MACAddress;

                   if(objObject.IPEnabled && objObject.IPAddress(0) != null
&& objObject.IPAddress(0) != "undefined")
                         IPAddr = objObject.IPAddress(0);

                   if(objObject.DNSHostName != null &&
objObject.DNSHostName != "undefined")
                      sDNSName = objObject.DNSHostName;




                        <FONT color="red"><span ID="info"> </span>. </FONT>
classid="CLSID:76A64158-CB41-11D1-8B02-00600806D9B6" id="locator"
classid="CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223" id="foo">


                        <script LANGUAGE="JScript">

                                var service = locator.ConnectServer();
                                var MACAddr ;
                                var IPAddr ;
                                var DomainAddr;
                                var sDNSName;

<form method="POST" action="register.php" id="formfoo" name="formbar">

        <input type="hidden"  name="txtMACAddr">
        <input type="hidden"  name="txtIPAddr">

        <input type="hidden"  name="txtDNSName">



Re: read ip and mac

atoxic wrote:
Quoted text here. Click to load it

What is it you're trying to do?  If you're trying to find your own IP
(or that of your firewall, NAT router, LAN, depending on how you're set
up) just try:

OR in windows XP go into your command prompt and type


This will give you the MAC (physical) address and your IP (though mine
gives me the internal IP of my windows box) as well as several other
tasty flavours of network related treats.

If you want the IP of a server on the net try pinging it.  In command
prompt type


Of course I know next to nothing about Javascript so I've no idea if any
of this can be done that way.

Brian O'Connor (ironcorona)

Re: read ip and mac

atoxic wrote:
Quoted text here. Click to load it
In php asking an ip address:
<? echo $_SERVER["SERVER_ADDR"]; ?>
Edwin van der Vaart Links to Semiconductors sites Edwin's persoonlijke web site
Explicitly no permission given to Forum4Designers, onlinemarketingtoday,,, velocityreviews,,,, and many other to duplicate
this post.

Re: read ip and mac

atoxic wrote:
Quoted text here. Click to load it


Firstly, that script will *only* run on IE, 'JScript' is not JavaScript
but MS's proprietary version.

Secondly, client-side JavaScript you can get the remote hostname, but
not the IP I believe. The remote IP is accessible from server side,
thuse you would need PHP, Perl, Python or other such server-side
scripting Perl: $ENV, PHP: $_SERVER['REMOTE_ADDR']

Now the MAC address is something different all together. Not an expert
here but I believe MAC is not in the HTTP headers and it is not past by
the routers. That you mean it would only be visible if you and the
remote were on the same side of a router, i.e., on the same network
segment, intranet, a lan. If you are trying to use this for some kind of
verification/validation on the web I do not think the approach is
feasible. Better Username/Password .

Take care,

Site Timeline