Subject: | Cisco-CopyConfig does not work with IPv6 addresses |
Date: | Tue, 5 Aug 2014 22:32:05 -0400 |
To: | bug-Cisco-CopyConfig [...] rt.cpan.org |
From: | John Sherwood <jsherwood0 [...] gmail.com> |
Hello,
I have recently been doing some security work with some IPv6 systems,
and found that the Cisco-CopyConfig module doesn't seem to accept IPv6
addresses. The problem seems to be that Net::SNMP requires the
'-domain' (or 'Domain') property to be set to 'udp/ipv6' in order for
it to handle IPv6 addresses. I'm not sure if you have a github
account set up, if so I can submit a pull request for my fix. If not,
below I have included a diff that shows the four lines that I had to
change.
The issue can be demonstrated by running copy-router-config.pl (part
of the default kali install) against a Cisco device with a known RW
community string.
Please let me know if you have any questions that I haven't answered here.
Regards,
-John
== Details about my version ==
It is straight out of a default install of Kali Linux with all packages updated.
CopyConfig.pm - v 1.3 2004/11/04 22:23:19
Perl Version - perl 5, version 14, subversion 2 (v5.14.2) built for
x86_64-linux-gnu-thread-multi (with 88 registered patches)
OS - Linux audit 3.12-kali1-amd64 #1 SMP Debian 3.12.6-2kali1
(2014-01-06) x86_64 GNU/Linux
== Diff below ==
--- /usr/share/perl5/Cisco/CopyConfig.pm 2004-11-21
17:11:31.000000000 -0500
+++ CopyConfig.pm 2014-08-05 21:42:24.894187437 -0400
@@ -21,7 +21,8 @@
'host' => '', ## - Default host
'comm' => '', ## - Default community
'tmout' => 2, ## - Default timeout
- 'retry' => 2 ## - Default retries
+ 'retry' => 2, ## - Default retries
+ 'domain' => 'udp/ipv4' ## - Default
protocol domain
}, $class;
$self->_newarg(@_); ## - Parse arguments
srand(time() ^ ($$ + ($$ << 15))); ## - Seed random number
@@ -41,6 +42,7 @@
return undef;
}
$self->{'snmp'} = Net::SNMP->session( ## -
Create SNMP object
+ Domain => $self->{'domain'},
Hostname => $self->{'host'},
Community => $self->{'comm'},
Timeout => $self->{'tmout'},
@@ -126,6 +128,7 @@
$self->{'tmout'} = $arg{$_}, next if /^tmout$/oi; ## - SNMP timeout
$self->{'retry'} = $arg{$_}, next if /^Retry$/oi; ## - SNMP timeout
}
+ $self->{'domain'} = 'udp/ipv6' if $self->{'host'} =~ /:/;
}
sub _cktftp {