Nikto kali linux ��� ������������

Nikto: A Practical Website Vulnerability Scanner

The most critical part of any website is its web server. The web server is responsible for accepting requests from your visitors, understanding them, and giving your website visitors answers to their requests.

Table of contents

Consequently, your web server is also the first component of your website in the line of attack. That’s because attackers target your web server to find any vulnerabilities, configuration-related errors and SSL certificate-related security issues.

As part of the SecurityTrails blog series highlighting both online vulnerability scanning tools and information gathering utilities, today we’ll explore a tool focused on scanning web servers called Nikto. Let’s learn more about Nikto and how to use it to scan your web server.

What is Nikto?

Nikto, also known as Nikto2, is an open source (GPL) and free-to-use web server scanner which performs vulnerability scanning against web servers for multiple items including dangerous files and programs, and checks for outdated versions of web server software. It also checks for server configuration errors and any possible vulnerabilities they might have introduced.

The Nikto vulnerability scanner project is a fast-moving effort, frequently updated with the latest known vulnerabilities. This allows you to scan your web servers with confidence as you search for any possible issues.

  • Nikto is free to use, open source and frequently updated
  • Can be used to scan any web server (Apache, Nginx, Lighttpd, Litespeed, etc.)
  • Scans against 6,700+ known vulnerabilities and version checks for 1,250+ web servers (and growing)
  • Scans for configuration-related issues such as open index directories
  • SSL certificate scanning
  • Ability to scan multiple ports on a server with multiple web servers running
  • Ability to scan through a proxy and with http authentication
  • Ability to specify maximum scan time, exclude certain types of scans and unusual report headers seen as well

Nikto installation

The Nikto vulnerability scanner can be installed in multiple ways on both Windows- and Linux-based systems. It is available in package format on Linux for easy installation via a package manager (apt, yum, etc.) and also available via GitHub to be installed or run directly from the project source.

For our tutorial, we’ll install Nikto from an operating system distribution package as well as from GitHub directly. This will give us multiple ways to install and integrate the Nikto web scanner into our tool sets.

GitHub-based installation

While the Nikto web scanner can be installed from most operating systems’ software repositories, installation from GitHub will always ensure you have the latest version of Nikto working with your system. This is important for any security analysis tool, ensuring the search for vulnerabilities is working with the most current information possible.

The GitHub-based installation method is also ideal for Linux distributions which do not carry Nikto in their software repositories, which makes installing Nikto possible on nearly every Linux distribution/platform.

To begin the installation from GitHub, clone the git repository:

Switch to the nikto/program folder:

You can now use the Nikto website vulnerability scanner to scan any website or IP address. Simply replace “http://www.example.com” with any domain or IP address you wish to scan:

If the above command does not work, you can try:

Kali Linux-based installation

Kali Linux is the go-to Linux distribution for users who are into pentesting and security analysis. And adding the Nikto vulnerability scanner to your security analysis tool set on Kali Linux can be achieved with just a couple of commands, as shown below.

First, refresh your APT package lists and install any pending updates:

Next, install the Nikto web scanner with the command:

To verify that the Nikto website vulnerability scanner is installed and ready for use, run the command:

Читайте также:  Unlimited vpn windows 10 что это

Which should then give you a similar output which lists the version of Nikto installed:

Note: The same installation commands work on other Debian-based distributions like Ubuntu or Debian itself.

Follow us on Twitter to receive updates!

10 Nikto commands to perform vulnerability scanning

Running a basic website scan

The most basic way to scan a host with Nikto is to use the -h flag with the nikto command:

The output should look like this:

Note: Nikto does a deep scan of the web server, and it may take a long time to finish due to the number of vulnerabilities Nikto checks against. Run under a “screen” session if running Nikto scanner from a remote machine.

Running a scan on a website with SSL

Nikto also has an SSL scanner mode, for SSL certificates installed on a website. With this you can get SSL cipher and issuer information.

To run a website SSL scan run:

As seen above, when scanning with the -ssl option enabled, we can find more vulnerabilities and configuration errors present in the web server we’ve just scanned when compared to the non-ssl scan. This is often observed with misconfigured web servers, which hastily include SSL support.

Thus scanning both http and https is vital for a complete picture of the vulnerabilities present in a web server setup.

Scanning specific ports with Nikto

On certain deployments, web servers are run on non-standard ports like 8081 or 8080, or multiple web servers are run on the same host on different network ports. It’s therefore vital to have the ability to scan specific ports as well as the main 80 and 443 ports.

This can be achieved by running the command:

Replace example.com with the host or IP you wish to scan, and 8083 with the port you wish to scan. The output should look like:

Save Nikto output to a specific file

The Nikto scanner also includes the ability to save the scan output to a file for future reference. This is ideal when running multiple scans and/or large scans which can be easier to reference from a file.

This is achieved by running the command:

Which should then output similar to:

Scanning through a network proxy

Certain websites may only be available through a network proxy or specific IP, and this feature allows Nikto to scan the website through that proxy address as well:

Scanning websites which require authentication

Nikto also includes the ability to scan websites which are protected by http authentication:

Ignore certain HTTP codes

When running a web server scan with Nikto, it’s important to ignore certain HTTP codes such as 301 redirects, to prevent the scan from scanning unnecessary objects. In such a scenario we can use the -IgnoreCode flag:

Maximum scan time

When scanning a web server for a large website, we may get a large number of results which can take hours to gather and analyse. In this scenario, it’s often better to limit the scan to a few minutes or seconds to gather information, resolve the errors or vulnerabilities reported, and then retry the scan to find the next set of errors or vulnerabilities. Nikto makes this possible with the -maxtime flag, which takes input in number of seconds:

Disable response cache

Modern web servers often cache websites to save on CPU performance as well as to serve websites more quickly. This is why it’s possible to get a “cached” version of the website when trying a scan.

This cached website may not have all the vulnerabilities present, or it may still have vulnerabilities present which were cached, so it’s important to flush the cache as well as use the -nocache flag to scan a non-cached version of the website.

Updating Nikto

Maintaining an updated database or a list of vulnerabilities to check against is very important. With new vulnerabilities discovered almost every day, it’s crucial to keep Nikto updated with the latest vulnerabilities to check against whenever you run a scan.

Updating Nikto is achieved by running the command:

What’s next — defend or attack?

If you are working on the defensive side, you are now aware of some of your vulnerabilities (remember that Nikto only focuses on the web-server side). Take action by protecting weak and exposed areas of your public surface, update scripts if needed, setup new authentication methods, reconfigure your SSL certificates, disable all your weak ciphers and more.

Читайте также:  Windows server 2012 r2 показать скрытые папки

And if you are part of the red team, you are probably going to jump straight into testing techniques to exploit these vulnerabilities and look for different attack vectors. In both cases, using Nikto is just the start — the real fun begins after you get the results of the scan.

Nikto vs. Nmap

Nmap is one of the better known tools for port scanning. It lets you know the port status on a device, whether there are any filtered, closed or open ports. And along with its effectiveness for checking on a web server, Nmap can also check against known vulnerabilities on ports/services running on a machine, as we covered in our previous topic: How to Detect CVEs Using Nmap Vulnerability Scan Scripts.

While the Nikto vulnerability scanner is an end-to-end scanner for the web server only, it scans the web server and checks against known vulnerabilities and lets you know right away about the possible security implications of any vulnerabilities it finds there.

It cannot scan or check other ports apart from the ones used by the web server, commonly port 80 (non-SSL) and 443 (SSL).

Nikto vs. Nessus

Nessus is a remote security scanning tool, which scans a computer for any vulnerabilities. Nessus is not limited to scanning web-servers only; it scans every port on the machine, to find vulnerabilities for any software that machine is running.

Nikto, on the other hand, is a tool for scanning vulnerabilities on the web server side and files on web servers only. Nikto is most effective for finding vulnerabilities on the web server, rather than on other services running on different ports on the machine.

Summary

To summarize our experience with the Nikto vulnerability scanner, we can safely say that adding this tool to your security analysis tool set is a must for scanning web servers. Nikto’s easy installation on a range of platforms in multiple ways is a another big plus, allowing for integration into your existing tool set without much effort.

Nikto also remains a formidable tool for finding out everything you can about your web server, ranging from SSL certificate information to security vulnerabilities in the web server software, and for finding dangerous files on your web server as well.

Esteban is a seasoned security researcher and cybersecurity specialist with over 15 years of experience. Since joining SecurityTrails in 2017 he’s been our go-to for technical server security and source intelligence info.

Источник

HackWare.ru

Этичный хакинг и тестирование на проникновение, информационная безопасность

Инструкция по использованию сканера веб-серверов Nikto

Что такое Nikto

Nikto – это сканер с открытым исходным кодом (GPL) для веб-серверов, он выполняет комплексные тесты в отношении серверов по нескольким направлениям, включая более 6700 потенциально опасных файлов/программ, проверка на устаревшие версии более 1250 серверов и проблемы, специфичные для версий более чем 270 серверов. Сканер также проверяет элементы конфигурации сервера, такие как присутствие нескольких индексных файлов, серверные опции HTTP и пытается определить имя и версии веб-сервера и программного обеспечения.

На официальном сайте изменения замерли на 2.1.5 версии аж в 2012 году. Тем не менее, под руководством автора проект живёт на GitHub’е, пользователи регулярно добавляют в базу данных и плагины изменения для сканирования новых уязвимостей, новых версий и т.д.

Nikto не создавался быть незаметным. Он будет тестировать веб-сервер за самое быстрое возможное время, очевидно, что его активность попадёт в логи веб-сервера и в поле зрение IPS/IDS (систем обнаружения/предотвращения вторжений). Тем не менее, имеется поддержка для анти-IDS методов из LibWhisker – на случай, если вы захотите их попробовать (или протестировать вашу систему IDS).

Не каждая проверка относится к проблеме безопасности, хотя большинство относятся. Некоторые пункты являются проверками типа «только для информации», которые ищут вещи, может быть не имеющие брешей безопасности, но веб-мастер или инженер по безопасности могут не знать, что это присутствует на сервере. Обычно в выводимой информации эти элементы помечены соответствующим образом. Есть также некоторые проверки на неизвестные элементы, которые были замечены в файлах журналов.

Особенности и возможности Nikto

Вот некоторые из основных особенностей Nikto:

  • Поддержка SSL (Unix с OpenSSL или может быть Windows с Perl/NetSSL в ActiveState)
  • Полная поддержка HTTP прокси
  • Проверка на устаревшие компоненты сервера
  • Сохранение отчёта в виде простого текста, XML, HTML, NBE или CSV
  • Движок шаблонов для простой настройки отчётов
  • Сканирование нескольких портов на сервере или несколько серверов полученных из файла ввода (включая вывод nmap)
  • Техники кодирования LibWhisker IDS
  • Идентификация установленного программного обеспечения по заголовкам, иконкам (favicon) и файлам
  • Аутентификация на хосте с Basic и NTLM
  • Угадывание поддоменов
  • Перечисление имён пользователей Apache и cgiwrap
  • Техники мутации для «рыбалки» за контентом веб-серверов
  • Подстройка сканирования, для включения или исключения целых классов проверок на уязвимости
  • Предположение учётных данных для области авторизации (включая множество стандартных комбинаций логинов/паролей)
  • Угадывание авторизации работает с любой директорией, а не только с корневой
  • Улучшенное подавление ложных срабатываний посредством нескольких методов: заголовки, содержимое страницы и вычисления хеша содержимого
  • Сообщение о «необычных» увиденных заголовках
  • Интерактивный статус, можно поставить на паузу и изменить настройки вербальности
  • Сохранение полных запросов/ответов для тестов, давших положительные результаты
  • Повторное воспроизведение положительных запросов
  • Максимальное время выполнения на одну цель
  • Автоматическая постановка на паузу в определённое время
  • Проверки на распространённые «парковочные» сайты
  • Вход в Metasploit
Читайте также:  Mac os from grub

Установка Nikto

Хотя Nikto и предустановлен в Kali Linux, на момент написания пакет не обновлялся уже 2 года.

При этом на GitHub’е жизнь вокруг проекта есть, причём довольно активная.

Поэтому не смотря на установленную версию, мы загрузим Nikto с GitHub’а и будем использовать его для сканирований:

Простые проверки с Nikto

Самое простое сканирование Nikto требует только указания хоста в качестве цели, поскольку 80 порт подразумевается, если не указан. Хостом может быть как IP, так и имя хоста машины, указывается используя опцию -h (-host). Следующая команда просканирует 192.168.0.1 на TCP порту 80:

Для проверки на другом порте, укажите с опцией -p (-port) номер порта. Следующая команда просканирует 192.168.0.1 на TCP порту 443:

Хосты, порты и протоколы также можно указывать используя синтаксис полного URL:

Не необходимости указывать 443 порт для SSL, т.к. Nikto начнёт с обычного HTTP и если это не получится, перейдёт к HTTPS. Если вы уверены, что это сервер с SSL, указание -s (-ssl) ускорит тест.

Сканирование нескольких портов в Nikto

Nikto может сканировать несколько портов за одну сессию сканирования. Для тестирования более чем одного порта на том же хосте, укажите список портов в опции -p (-port). Порты можно указать в виде диапазона (т.е. 80-90), в качестве разделённого запятой списка (т.е. 80,88,90). Следующая команда просканирует хост на портах 80, 88 и 443:

Сканирование нескольких хостов в Nikto

Nikto поддерживает сканирование нескольких хостов за одну сессию. Их можно указать в текстовом файле имён хостов или IP. Вместо передачи имени хоста или IP для опции -h (-host), можно передать имя файла. Файл хостов должен иметь формат один хост на одну строку с номером(номерами) портов на конце каждой строки. Порты могут быть отделены от хоста и других портов двоеточием или запятой. Если порт не указан, подразумевается 80 порт.

Это пример правильного файла хостов:

Файлом хостов также может быть вывод nmap в формате «greppable» (т.е. вывод с опцией -oG).

Файл можно передать в Nikto через стандартный вывод/ввод используя в качестве имени файла ««. Например:

Использование прокси

Nikto может использовать прокси при указании его в файле настройки (nikto.conf), либо в опции командной строки.

Для использования файла nikto.conf установите переменные PROXY* и затем выполните Nikto с опцией -useproxy. Все соединения будут переданы через HTTP прокси, указанный в файле конфигурации.

Для установки прокси в командной строке, используйте опцию -useproxy с настройками прокси в качестве аргумента, например:

Интерактивные функции

Nikto содержит несколько опций, которые могут быть изменены во время активного сканирования.

Во время активного сканирования, нажатия любой нижеприведённой клавиши включит или отключит указанную функцию или выполнить указанное действие. Они чувствительны к регистру.

  • Пробел – Сообщить текущий статус сканирования
  • v – Включить/включить вербальный режим
  • d – Включить/выключить режим отладки
  • e – Включить/включить сообщения об ошибках
  • p – Включить/включить сообщение о прогрессе
  • r – Включить/включить отображения перенаправления
  • c – Включить/включить отображение кукиз
  • o – Включить/включить показ OK
  • a – Включить/включить отображение аутентификации
  • q – Выйти
  • N – Следующий хост
  • P – Пауза

Анонимные сканирования с Nikto

Для анонимных сканирований можно воспользоваться услугами сети Tor. Но поскольку Nikto не поддерживает работу с SOCKS, то нам дополнительно нужно настроить ещё и Privoxy.

В Kali Linux установка Privoxy делается так:

Примечание: настройка в Arch Linux / BlackArch осуществляется аналогичным образом, но за исключением команды по установке пакетов. Вместо вышеприведённой нужно использоваться

В файл /etc/privoxy/config добавляем строки:

Запускаем и добавляем в автозагрузку службы:

Теперь для того, чтобы сканирование происходило через Tor, добавляйте к каждой команде -useproxy http://localhost:8118/. Например:

Бесплатный онлайн сервис сканирования с Nikto

Для тех, кто не хочет разбираться с запуском Nikto, предлагается бесплатный онлайн сканер, который использует все возможности Nikto.

Сканер действительно абсолютно бесплатен и для доступа даже не требует регистрации, но длительные сканирования, особенно при загруженности сервера, могут быть сброшены до своего завершения.

Источник

Оцените статью