Changeset 9
- Timestamp:
- 12/07/06 13:47:24 (2 years ago)
- Files:
-
- trunk/dhcpdetector.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dhcpdetector.pl
r8 r9 49 49 use Net::SMTP; 50 50 use Sys::Syslog; 51 use Data::Dumper; 51 52 52 53 use strict; … … 65 66 # CONFIG SECTION 66 67 # 67 # list of IP addresses of authorized DHCP servers on your network68 68 # put the hwa of any 'legitimate' dhcp servers or dhcp forwarding 69 69 # routers in this list. … … 77 77 # the bait is sent from these addresses 78 78 # XXX - cant we just use our real one(s) automagically??? 79 my %ifaces = ('eth0.0237' => '00:00:00:00:00:00', 80 'eth0.0238' => '00:00:00:00:00:00', 81 'eth0.0255' => '00:00:00:00:00:00', 82 ); 79 my @iface = split("\n",`ifconfig | grep "HWaddr"`); 80 my %ifaces = ''; 81 82 for my $row (@iface) { 83 $row =~ /(eth\d\.?\d*)\s+Link encap:Ethernet\s+HWaddr\s+([\d\:\A-Fa-f]+)\s*/; 84 $ifaces{$1} = $2; 85 } 83 86 84 87
