In going through all the tools with Alex on Backtrack I have discovered a few bugs and missing modules or libs. I will be writting posts on how to fix them but I will also be adding the fix’s to Backtrack svn as well. This morning I was writting the article on Dnsenum by my buddy Barbsie and I ran into a missing perl module.
- root@666:/pentest/enumeration/dnsenum# ./dnsenum.pl --enum -f dns.txt --update a -r cnn.com
- dnsenum.pl VERSION:1.2
- Warning: can't load Net::Whois::IP module, whois queries desabled.
Below I will show to to download and install the needed module:
First thing we need to do is download the Net-Whois-IP package from cpan:
- root@666:~# wget http://search.cpan.org/CPAN/authors/id/B/BS/BSCHMITZ/Net-Whois-IP-1.04.tar.gz
- --2010-05-22 14:24:09-- http://search.cpan.org/CPAN/authors/id/B/BS/BSCHMITZ/Net-Whois-IP-1.04.tar.gz
- Resolving search.cpan.org... 207.115.101.144, 64.235.248.44
- Connecting to search.cpan.org|207.115.101.144|:80... connected.
- HTTP request sent, awaiting response... 302 Found
- Location: http://ftp.ndlug.nd.edu/pub/perl/authors/id/B/BS/BSCHMITZ/Net-Whois-IP-1.04.tar.gz [following]
- --2010-05-22 14:24:09-- http://ftp.ndlug.nd.edu/pub/perl/authors/id/B/BS/BSCHMITZ/Net-Whois-IP-1.04.tar.gz
- Resolving ftp.ndlug.nd.edu... 129.74.152.229
- Connecting to ftp.ndlug.nd.edu|129.74.152.229|:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 4735 (4.6K) [application/x-tar]
- Saving to: `Net-Whois-IP-1.04.tar.gz'
- 100%[====================================================================>] 4,735 --.-K/s in 0.04s
- 2010-05-22 14:24:09 (118 KB/s) - `Net-Whois-IP-1.04.tar.gz' saved [4735/4735]
Next, Lets open it in the usual way:
- root@666:~# tar xzvf Net-Whois-IP-1.04.tar.gz
- Net-Whois-IP-1.04/
- Net-Whois-IP-1.04/MANIFEST
- Net-Whois-IP-1.04/META.yml
- Net-Whois-IP-1.04/IP.pm
- Net-Whois-IP-1.04/test.pl
- Net-Whois-IP-1.04/Changes
- Net-Whois-IP-1.04/Makefile.PL
Change into the directory of the new package:
- root@666:~# cd Net-Whois-IP-1.04
- <strong>In perl you have to create the make file in a little bit different fashion than most tools:</strong>
- [sourcecode LANG=bash]
- root@666:~/Net-Whois-IP-1.04# perl Makefile.PL
- Checking if your kit is complete...
- Looks good
- Writing Makefile for Net::Whois::IP
Now we issue the standard make command:
- root@666:~/Net-Whois-IP-1.04# make
- cp IP.pm blib/lib/Net/Whois/IP.pm
- AutoSplitting blib/lib/Net/Whois/IP.pm (blib/lib/auto/Net/Whois/IP)
- Manifying blib/man3/Net::Whois::IP.3pm
Perl also allows for a test feature which will make sure you have all the required modules which are depndencies:
- root@666:~/Net-Whois-IP-1.04# make test
- PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
- 1..1
- ok 1
- 1..4
- ok 1
- ok 2
- ok 3
- ok 4
- ok 5
- Things seem OK!
Finally we issue the make install command to finalize the install:
- root@666:~/Net-Whois-IP-1.04# make install
- Installing /usr/local/share/perl/5.10.0/Net/Whois/IP.pm
- Installing /usr/local/share/perl/5.10.0/auto/Net/Whois/IP/autosplit.ix
- Installing /usr/local/man/man3/Net::Whois::IP.3pm
- Writing /usr/local/lib/perl/5.10.0/auto/Net/Whois/IP/.packlist
- Appending installation info to /usr/local/lib/perl/5.10.0/perllocal.pod
One extra thing I always do is issue the make clean command to clean up the file so I can use it on another box if I need to:
- root@666:~/Net-Whois-IP-1.04# make clean
- rm -f \
- *.a core \
- core.[0-9] blib/arch/auto/Net/Whois/IP/extralibs.all \
- core.[0-9][0-9] IP.bso \
- pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \
- IP.x \
- perl tmon.out \
- *.o pm_to_blib \
- blib/arch/auto/Net/Whois/IP/extralibs.ld blibdirs.ts \
- core.[0-9][0-9][0-9][0-9][0-9] *perl.core \
- core.*perl.*.? Makefile.aperl \
- perl IP.def \
- core.[0-9][0-9][0-9] mon.out \
- libIP.def perlmain.c \
- perl.exe so_locations \
- IP.exp
- rm -rf \
- blib
- mv Makefile Makefile.old > /dev/null 2>&1
After this Dnsenum and any other tool which works using the Net::Whois::IP Module will work fine.
Heya,
Personally I find it a lot easier to use the CPAN built-in installer:
barbsie@xps:~$ perl -MCPAN -e shell
Terminal does not support AddHistory.
cpan shell — CPAN exploration and modules installation (v1.9402)
Enter ‘h’ for help.
cpan[1]> install Net::Whois
…
Thanks for posting this and thanks to barbsie for the comment. Seems this module is missing even in the latest Kali release.