.

Automatically gathering a MAC address

<<

baghtal

Newbie
Newbie

Posts: 1

Joined: Tue Oct 02, 2007 1:50 pm

Post Tue Oct 02, 2007 2:00 pm

Automatically gathering a MAC address

I work with a large network that spans several subnets. I am trying to find a way to automatically include the MAC address when my users visit a tracking web page to report problems they are having. Most of my users I don't expect to know how to find their MAC on their own so pulling automatically would be best.

IP addresses are assigned by DHCP and I would like to track issues that are machine specific, which is why i need MAC tracing instead of IP.

Has anyone got any idea how to do this without ActiveX controls or a local client on the users machine?

Thanks!
<<

Negrita

User avatar

Sr. Member
Sr. Member

Posts: 299

Joined: Sat Sep 10, 2005 5:45 pm

Location: /dev/null

Post Tue Oct 02, 2007 6:07 pm

Re: Automatically gathering a MAC address

The first thing that pops into mind is snmpwalk on the ARP tables, though there is probably an easier solution.
CEH, CCSA NG/AI, NNCSS, MCP, MCSA 2003

There are 10 kinds of people, those that understand binary, and those that don't.
<<

dannioni

Newbie
Newbie

Posts: 44

Joined: Tue Sep 18, 2007 12:51 pm

Post Wed Oct 03, 2007 12:50 pm

Re: Automatically gathering a MAC address

You could send a arp request:

Who has 192.168.1.14?
Ans: 192.168.1.14 is on 00:72:B5:F8:83:CA:B4:44

That is if your network structure allows it (don't know anything about networks that big).
<<

dean

Post Wed Oct 03, 2007 2:21 pm

Re: Automatically gathering a MAC address

if you are directing your users to an internal help desk web page you can use a tool like nbtscan and a little bit of perl cgi to do this for you.

Something like this should work and output what you need to a file.

  Code:
$ip = $ENV{'REMOTE_ADDR'};
$command = "/path/to/tool/nbtscan -v -h -q -s "$ip"";

open(FH, ">>filename")
   or die "error creating or opening file: $!\n";

# Print outtput to file.
   $tm = localtime;
   print FH "Record added : $tm\n\n";

open (S, "$command |") || die "Cannot run $command! : $!\n";
   while (<S>){
   print FH $_;
     }

close(FH);


The environment variable REMOTE_ADDR will get the user's IP address for you. feed that to the tool and it should give you the data that you need.

This might be limited by your routing topology as the server will need to directly connect to the machines using the tool.

Not sure what DHCP server you're using but that should hold MAC to IP mappings too.

Return to Forensics

Who is online

Users browsing this forum: No registered users and 0 guests

.
Powered by phpBB® Forum Software © phpBB Group.
Designed by ST Software