Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Resolve MAC addresses?

Posted on 1998-09-16
8
Medium Priority
?
312 Views
Last Modified: 2013-12-25
Is there some kind of variable (like cgi.remote_host for ip's) for retriving MAC addresses? I am using IIS3 and Cold Fusion 3.
Thanks for your help.
0
Comment
Question by:jagoodie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 7

Expert Comment

by:faster
ID: 1828638
The answer is definetly NO.  A browser never send the MAC address to the server.  If you really need it, you can consider to write an ActiveX control, which get the MAX address by itself and then fill it in the form using VB script (or directly talk to the server).
0
 
LVL 2

Author Comment

by:jagoodie
ID: 1828639
Pretty cockey to think you are the end all know it all (if I don't know it, it doesn't exist attitude).
Thanks for your comment/opionion.
0
 
LVL 7

Expert Comment

by:faster
ID: 1828640
It is not that I know it all, but I did read the whole http 1.0 and http 1.1 protocol, all the information sent from a browser are based on these two protocols.  So if you have a look at the these two RFCs, you will know that it is not possible that a browser will ever send this kind of information to the server, unless you send it by yourself, that is, writing your own ActiveX or the kind.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
LVL 2

Author Comment

by:jagoodie
ID: 1828641
my point is that someone has this code that i am looking for and i am hoping that they read this question, and if i accept your answer then i have to learn programming just to get this script.
any idea where i would find this script?
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1828642
faster is correct in that the client does not send back the MAC address. To do so would require the application protocol to understand the details of the lower level protocols which runs contrary to the entire approach of network communications.

There are functions within the WINSOCK API that will allow you to obtain the MAC address from an IP address but to utilise these you will need to learn how to write programs.

But given I can't see what you will use these four unless you are writing a program I can't see your problem.

Incidently its worth remembering that the IP address (and thus the resultant MAC address) will not always be that of the client but that of a proxy that the client has accessed you site through.

Steve
0
 
LVL 2

Author Comment

by:jagoodie
ID: 1828643
if this is the answer, faster deserves the points.
i am not collecting outside our LAN, in is for internal use- maintaining a bootp table, so i don't care about any proxys.
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1828644
Fine then award them. Just because you don't like an answer is not the reason to reject an answer.

Incidently using WEB access to maintain a bootp table is a recipe for disaster.

Steve
0
 
LVL 5

Accepted Solution

by:
thoellri earned 200 total points
ID: 1828645
As said before by faster and mouatts, the MAC address of a system connecting to you server is not available in the environment. All you get is the ip-address and/or hostname of the system talking to your server. However, for packets being transported back to the system in question, the MAC address has to be know.
You can try the following from a CMD.EXE seesion: After getting the IP-address from the cgi.remote_host field, ping the system using "ping ip-address". Now do a "arp -a"  and look for the ip-address of the system you just pinged. You will see that the matching MAC-address appears in the second column.
A look through the Windows Socket 2 documentation should get you on the right track.
Here is what I did for UNIX/Perl5. The following sub gets either ip or mac-address and return ip and MAC-address (filling in the missing one). This is done after the system has been pinged to make sure that the MAC/IP-addresses are known to ARP:
sub fromarp {
    my($ip,$ether) = @_;
    my ($a_name, $a_ether, $a_ip, $addr);
    open(PIPE,"arp -a|") || return (undef, undef);
    while (<PIPE>) {
        chomp;
        $addr=undef;
        if (/^\S+\s+(\S+)\s+.*\s+([\dabcdef:]+)$/) {
            $a_name=$1;$a_ether=$2;
            if ($addr=gethostbyname($a_name)) {
                $addr=inet_ntoa($addr);
            }
        } else {
            next;
        }
        if (defined($ip)) {
            if (defined($addr) && ($ip eq $addr)) {
                $ether=$a_ether;
                last;
            }
        } else {
            if (defined($addr) && ($ether eq $a_ether)) {
                $ip=$addr;
                last;
            }
        }
    }
    close(PIPE);
    return ($ip, $ether);
}

Hope this helps
Tobias
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question