Introduction to Nikto Usage
Nikto is a scanner used to detect potential vulnerabilities in web applications. With over 6700 tests, it can check for software versions, configuration errors, and other security issues.
Setup
To install Nikto, you can use the following command:
Basic Usage Commands
-h
A Simple Scan
You can crawl a target website with the following command:This scans for basic vulnerabilities at .http://www.example.com
SSL Supported Scanning
To browse a website with HTTPS enabled, you must add the option:-ssl
This command performs SSL scanning on port 443.
IP Address Scanning
To scan an IP address directly:
Scanning on Specific Ports
Web servers often run on non-standard ports. In this case, you can use the option to scan a specific port:-port
Here you should write the domain name or IP address you want to scan and the port number you want to scan.example.com
8080
Saving Output to File
You can use the option to save the scan results to a file :-output
This command saves the scan results to the specified file.
Browsing via Proxy
Some websites are only accessible through a network proxy. In this case, you can use a command like the following:
Scanning for Sites Requiring Authentication
If the target website requires HTTP authentication, you can specify the username and password with the option:-id
Ignore Certain HTTP Codes
If you want to ignore certain HTTP codes during scanning, you can use the option:-IgnoreCode
This command ignores 301 redirects.
Determining Maximum Scan Time
You may want to limit the crawl time for large websites. To do this, you can specify the maximum time in seconds using the option:-maxtime
In this example, you would limit the scan to 60 seconds.
Scanning Multiple IP Addresses
To scan multiple IP addresses or domains, you can put them in a text file and scan as follows:Here is a file with one IP address or domain name per line.domains.txt
Export Output
To export the scan results, you can specify the file name using the option:-o
You can also add the option to specify the output format :-Format
Here you can use this command to get output in CSV format.
Customized Scanning Options
Nikto offers many options that allow you to customize scans. Here are some important options:
- -Display : Customizes the output. For example:
- -Format : Specifies the report format (csv, html, xml etc.):
- -Tuning : Determines the areas where the scan will focus:
Reporting
You can use the option to save the scan results to a file :-o
PEN-200 Test Specific Commands
The PEN-200 course aims to develop basic skills in penetration testing. You can practice using Nikto in this course. Below are some sample usage scenarios for PEN-200:
Sample Scenario: Web Application Scanning
To apply the information you learned in the PEN-200 course, you can perform a scan like the following:
This command scans your address, focusing on specific vulnerabilities , and saves the results in HTML format.webscantest.com
Sample Scenario: Goal Setting and Analysis
To perform in-depth analysis on a target, you can use a command like the following:
This command scans the specified CGI directories and shows only redirects.
Conclusion
Nikto is a powerful tool for detecting vulnerabilities in web applications. The above-mentioned commands and options will help you use Nikto effectively. Learning how to use such tools in the PEN-200 course will increase your proficiency in penetration testing. Before performing any security testing, be sure to get written permission from the target system owner; otherwise, you may face legal issues.