Title: RE: Info: MAC

thanks. The problem That I experiance is that I have the MAC address and not the IP address. I need to trace the IP address.

-----Original Message-----
From: henry isham [mailto:[EMAIL PROTECTED]]
Sent: 10 June 2003 04:14 PM
To: Mundell, R. (Ronald); Perl-Unix-Users (E-mail); Perl-Win32-Users
(E-mail)
Subject: RE: Info: MAC


Ronald,
 
Please find attached a couple of scripts that I use to get MAC/IP addresses pairs. I hope it helps.
 
-Henry
 
The following script is used to get the MAC info (I'm sure it can be made more efficient):
 
use Net::Ping;
my $ui;
my $p;
open (NBTOUT, ">nbtout.txt") or die "\n\nCould not open NBTOUT.txt output file. ";
print "Beginning network scan. Please be patient, this process takes a while.\n";
#Subnet range 192.168.72.10 to 192.168.72.126
for ($i = 10; $i < 126; $i++) {
    $p = Net::Ping->new("icmp");
    $host = "192.168.72.$i";
    if ($p->ping($host,1)) {
        print "Trying 192.168.72.$i\n";
        print NBTOUT "Trying 192.168.72.$i\n";
        $ui = `nbtstat -a 192.168.72.$i`;
        print NBTOUT $ui;
        }
    $p->close();
    }
   
Then I clean up the output a little bit:
 
open (NBTOUT2, ">nbtout2.txt") or die "\n\nCould not open NBTOUT2.txt output file. Please make sure it isn't open by another program.";

$ui = `type nbtout.txt`;
$ui =~ s/3F97DF49-4AF8-442C-AC99-B4DE75E6FCDE//g;  <--- you'll need to change this for your PC
$ui =~ s/Local Area Connection//g;
$ui =~ s/Node IpAddress//g;
$ui =~ s/---------------------------------------------/\t/g;
$ui =~ s/Host not found.//g;
$ui =~ s/Scope Id//g;
$ui =~ s/\\Device\\NetBT_Tcpip_\{\}:\n//g;
$ui =~ s/: \[0.0.0.0\] : \[\]//g;
$ui =~ s/\[192.168.247.1\]//g; <--- you'll need to change this for your PC
$ui =~ s/\[\]//g;
$ui =~ s/\s+:\s+/\n/g;
$ui =~ s/:\s+/\t/g;
$ui =~ s/\s\s\s//g;
$ui =~ s/MyDomain//g; <--- you'll need to change this for your Domain
$ui =~ s/Trying\s+//g;
$ui =~ s/\t//g;
$ui =~ s/\n.*\=//g;
$ui =~ s/\-/\:/g;
$ui =~ s/\n\:/\n/g;
print NBTOUT2 $ui;
 

        -----Original Message-----
        From: Mundell, R. (Ronald) [mailto:[EMAIL PROTECTED]]
        Sent: Tue 6/10/2003 1:21 AM
        To: Perl-Unix-Users (E-mail); Perl-Win32-Users (E-mail)
        Cc:
        Subject: Info: MAC
       
       

        Good Day All

        I would like to know if there is a perl module that could help me to resolve mac addresses to IP's

        Ronald Mundell
         

       
  _____ 


       

       

        This email and any accompanying attachments may contain confidential and proprietary information.  This information is private and protected by law and, accordingly, if you are not the intended recipient, you are requested to delete this entire communication immediately and are notified that any disclosure, copying or distribution of or taking any action based on this information is prohibited.

        Emails cannot be guaranteed to be secure or free of errors or viruses.  The sender does not accept any liability or responsibility for any interception, corruption, destruction, loss, late arrival or incompleteness of or tampering or interference with any of the information contained in this email or for its incorrect delivery or non-delivery for whatsoever reason or for its effect on any electronic device of the recipient.

        If verification of this email or any attachment is required, please request a hard-copy version.

  _____ 


This email and any accompanying attachments may contain confidential and proprietary information.  This information is private and protected by law and, accordingly, if you are not the intended recipient, you are requested to delete this entire communication immediately and are notified that any disclosure, copying or distribution of or taking any action based on this information is prohibited.

Emails cannot be guaranteed to be secure or free of errors or viruses.  The sender does not accept any liability or responsibility for any interception, corruption, destruction, loss, late arrival or incompleteness of or tampering or interference with any of the information contained in this email or for its incorrect delivery or non-delivery for whatsoever reason or for its effect on any electronic device of the recipient.

If verification of this email or any attachment is required, please request a hard-copy version.


Reply via email to