Left Menu



Howto compile and use Nikto, the great Web Server vulnerability scanner

Nikto is an Open Source (GPL) web server scanner which performs comprehensive tests against web servers for multiple items, including over 3500 potentially dangerous files/CGIs, versions on over 900 servers, and version specific problems on over 250 servers. Scan items and plugins are frequently updated and can be automatically updated (if desired).

Nikto will examine your Web Server for Configuration Problems and security vulnerabilities. Since 2007 it became the most used open source vulnerability scanner. Nikto can run on any platform that supports perl enviroument. It supports SSL, proxies and host authentication. It has nmap compatibility ( Never used nmap ? Check the Howto install and use nmap for first time page ). The only one perl module that usualy don't come with the perl package is LibWhisker. For SSL support the Net::SSLeay perl module needs to be installed, which sometimes require OpenSSL.

NOTE: All these modules are included in the most distributions official three, so check your three before compiling it yourself.

Ubuntu/Debian : apt-get install <package>
Gentoo : emerge <package>
Sabayon : equo install <package>
ArchLinux : pacman <package>
and so on ... it depends on the distribution

If some of the packages are not included please refer for downloading and installation here :

PERL : http://cpan.org
LibWhisker :  http://wiretrip.net/
ActiveStatePerl : http://activestate.com
OpenSSL : http://openssl.org
nmap : http://insecure.org

If all these packages are in your official three please refer to the USAGE section.

Now most likely you are going to need LibWhisker, so let's take care of it before your first scan :
If LibWhisker (Perl module geared to HTTP testing) is not available through the official three of your distribution:

NOTE: Libwhisker is not a program to run. It's a library for people to make programs with. There is nothing to 'run' in Libwhisker. Whisker is separate from Libwhisker.

1. Download the tarball

$ wget http://www.wiretrip.net/rfp/libwhisker/libwhisker2-current.tar.gz

2. Untar the Archive

$ tar fvx libwhisker2-current.tar.gz

3. Enter the directory

$ cd libwhisker2-"version"

4.  Installation

$ sudo perl Makefile.pl install
Password:
LW2.pm installed to /usr/lib/perl5/site_perl/5.8.8
LW2.3pm installed to /usr/share/man/man3

We had to use sudo, because of Permissions issue

And you are all set and almost ready to go. If you plan on testing SSL you will ned NET_SSLeay. This is a perl module that has the ability to connect over SSL connections

Installation :

1. Download the tarball

$ wget http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Net_SSLeay.pm-1.30.tar.gz

As of making this howto this is the latest release, just in case you can check HERE 

2. Untar it

$ tar vfx Net_SSLeay.pm-1.30.tar.gz

3. Enter the directory

$ cd Net_SSLeay.pm-1.30

4. Install it

$  ./Makefile.PL -t    

This is going to install and test it (-t)
      
$ sudo make && sudo make install         
We did it with sudo because of permissions issue. This is going to install it in your perl directory.

So far so good now we are ready to proceed to Nikto installation:
                
1. Download the tarball

$ wget http://cirt.net/nikto/nikto-current.tar.gz

This will download the archive ( If you do not have wget refer to Howto install and use wget page ).

2. Untar the archive

$ tar vfx nikto-current.tar.gz

This will extrack the archive into a directory called nikto-"version" ( If you don't have tar refer to our Howto install and yse tar page ).

3. Enter the directory

$ cd nikto-"version"

4.  Testing if it works. We are going to test on the apache server that we installed from source. Brand new Apache HTTP server ( check Howto install and run Apache HTTP for first time page )

$ perl nikto.pl -h localhost

NOTE: If you have compiled it via the official three of any distro just run "nikto -h localhost"
and the output will look like :

 - Nikto v2.1.0/2.1.0
---------------------------------------------------------------------------
+ Target IP:          127.0.0.1
+ Target Hostname:    localhost
+ Target Port:        80
+ Start Time:         2009-11-13 19:39:14
---------------------------------------------------------------------------
+ Server: Apache/2.2.14 (Unix)
- Retrieved X-Powered-By header: PHP/5.2.8-pl1-gentoo
+ OSVDB-12184: GET /index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 : PHP reveals potentially sensitive information via certain HTTP requests which contain specific QUERY strings.
+ OSVDB-3233: GET /cgi-bin/test-cgi : Apache 2.0 default script is executable and reveals system information. All default scripts should be removed.
+ OSVDB-3268: GET /icons/ : Directory indexing is enabled: /icons
+ OSVDB-3268: GET /images/ : Directory indexing is enabled: /images
+ OSVDB-562: GET /server-info : This gives a lot of Apache information. Comment out appropriate line in httpd.conf or  restrict access to allowed hosts.
+ OSVDB-0: Allowed HTTP Methods: GET, HEAD, POST, OPTIONS, TRACE
+ OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST
+ OSVDB-0: Non-standard header keep-alive returned by server, with contents: timeout=5, max=100
+ 3582 items checked: 9 item(s) reported on remote host
+ End Time:           2009-11-13 19:39:30 (16 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

This is how it looks basic Apache scanning ... You can get very useful information about almost everything Apache related.


Nitko has a nmap and Nessus integration as well that you can use For more information on using nikto with nessus or nmap check the Nmap and Nessus pages

For additional questions or comments please refer to our FORUM




Delicious de.li.cio.us


|Home | LinuXchange| Updates | Contact Us | About The Project | Unique Visitors| Sponsorship|