Dirb kali linux как пользоваться
Перейти к содержимому

Dirb kali linux как пользоваться

  • автор:

Web Application Information Gathering with Kali Linux: Web Object & Directory Enumeration with Dirb in Kali Linux

In Linux, you can hide a directory and file by adding a dot (.) prefix in the filename, for example the .htaccess. This file is not visible to others but can be accessed publicly sometimes. Some objects or content in the web server are used to facilitate the data processing. But often times, there are configuration errors especially in the permissions set which leads to potential vulnerability such as Directory traversal, Sensitive data exposure, Cross-Site Request Forgery (CSRF) attacks, XSS LFI/RFI attack, Unvalidated redirects and forwards, and many more.

We will learn the following topics in detail:

  • Brute Force Attacks
  • Wordlists File in Kali Linux
  • Find Hidden Objects on a Website

Brute Force Attacks

Brute force is a type of cyber-attack method that relies on a wordlist. Brute force is specifically applied in many areas of cyber-attacks such as fuzzing, cracking, and credential login. A Wordlist is a plain text file which contains a collection of words such as usernames, passwords, objects, and directories.

You can find the wordlists freely on the internet. The most popular wordlist that is used by penetration testers is SecLists. You can download the files at GitHub at https://github.com/danielmiessler/SecLists. Kali Linux also comes with a bunch of prebuilt wordlists. You can find the wordlists file in your Kali Linux using this command:

My Kali Linux machine has 176 plain text wordlist files as shown in the following figure:

DIRB – Directory Buster in Kali Linux

Dirb is a preinstalled Kali Linux tool which is used to enumerate the web server directories and objects. Dirb searches for content by fuzzing the URL on the target website based on a wordlist that is prepared beforehand or, in other words, using the Brute Force technique. Dirb analyzes and displays the response code which is provided by the target website. The response code 200 means that the object exists.

DIRB – Commands and Usage

Let’s first take a look at the available Dirb commands and the usage in the following examples.

Now, analyze the most interesting options in the following:

Define a Custom USER_AGENT

Some web server uses firewall technology to filter the request to the server. One of the most frustrating things as a penetration tester is when we perform crawling or brute force. The firewall catches our request as a bot, then it blocks the requests. There are several features of Dirb to evade the firewall detection. The first point to evade the firewall is to define a legitimate user agent instead of a Dirb default user agent. You can find a list of user agents on the internet. For example, you can find it at https://developers.whatismybrowser.com/useragents/explore/.

To define a user agent when using Dirb in the Kali Linux terminal, use the following argument:

Add a Delay to the Request

Dirb does the request simultaneously, one request after another. Using this default request speed sometimes causes the request flooding to the server. Some firewalls may block our request immediately when they catch the flood request. To avoid that, we could define a delay in milliseconds format. A thousand milliseconds mean one second.

Using a Non-Recursive Request

The main purpose to use this option is basically the same as adding a delay to the request. Yes, it is to bypass the firewall detection. Use the -r switch to enable this option.

Don’t Stop on a Warning Message

Activating this option tells Dirb to keep sending the request whatever it takes until the last word in a wordlist. Use the -w switch to enable this option.

Logging

Saving the output result to a file is important; we don’t remember everything, right?

How to Use Dirb in Kali Linux

From the information about the command and the usage in the previous examples, the following is my favorite command for using Dirb:

Note that the milliseconds number in delaying the request may vary. You need to do a trial test before that.

Based on the previous command pattern, the actual command should be like this:

URL TARGET https://www.blitarkab.go.id
WORDLIST FILE /usr/share/dirb/wordlists/big.txt
USER_AGENT Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X
TIME DELAY 200 milliseconds
OUTPUT FILENAME output.txt

From the previous Dirb scans, we get some interesting results such as:

The WordPress administrator login page at https://www.blitarkab.go.id/admin which is redirected to https://www.blitarkab.go.id/wp-login.php.

The cPanel login page at https://www.blitarkab.go.id/cpanel which is redirected to the actual cPanel web service page at https://www.blitarkab.go.id:2083/.

And a webmail login page at https://www.blitarkab.go.id:2096/.

Now, we could brute force those credential pages in the next stage.

Conclusion

We covered how to find the hidden objects and directories using Dirb in Kali Linux. We also found two credential login pages for WordPress CMS and cPanel. Those pages are not meant to be accessed publicly.

Перебор каталогов сайта на Kali Linux

Перебор каталогов Kali Linux

Перебор каталогов — это один из первых этапов взлома сайта. Это по сути поиск возможных скрытых каталогов сайта, с помощью атаки брутфорс и списка популярного имен каталогов. В статье покажу в действии, три популярных инструмента для перебора каталогов на Kali Linux.

Перебор каталогов сайта на Kali Linux

Мы будем использовать 3 инструмента:

  • Gobuster
  • Dirbuster
  • Dirb

Трудно сказать какой из них лучше. Каждый имеет свои достоинства и недостатки.

Перебор каталогов с помощью Gobuster

Откройте терминал Kali и установите Gobuster:

После установки запустите тулзу или еще лучше, загляните в справку:

Перебор каталогов Gobuster

В демонстрационных целях я использую намеренно уязвимый сайт testphp.vulnweb от Acunetix, специально разработанный для таких, как мы (этичных хакеров).

Для перебора каталогов сайта, введите и выполните:

После выполнения будут отображены каталоги веб-сервера.

Перебор каталогов Gobuster

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

Брутфорс каталогов Gobuster

Можно запустить перебор каталогов и файлов на основе определенных расширений, таких как .txt, .css, .js и т. д. Для этого используйте директиву — x .

Брут каталогов Gobuster

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

Перебор каталогов с помощью Dirb

Теперь давайте посмотрим, как найти скрытые каталоги с помощью Dirb. Для этого в терминале введите:

Перебор каталогов с помощью Dirb

В принципе, здесь, нечего объяснять, Если непонятно, используйте справку.

Перебор каталогов с помощью Dirbuster

Теперь мы будем использовать Dirbuster — версию dirb с графическим интерфейсом для перечисления каталогов. В статье «Как установить и использовать DirBuster на Linux и Windows» мы про него подробно рассказывали. Очень рекомендую ознакомиться.

Откройте меню приложений Kali Linux и зайдите в —> Анализ веб-приложений —> Поисковые роботы и брутфорс каталогов -> Dirbuster.

Перебор каталогов Dirbuster

Теперь введите адрес целевого сайта, добавьте файл списка слов и необходимы расширения файлов.

Перебор каталогов сайта Dirbuster

После заполнения и нажатия на кнопку «Start», Dirbuster начнет сканирование директорий сайта и файлов.

Брут каталогов сайта Dirbuster

Так выглядит результат в виде списка директорий и файлов.

Список скрытых директорий сайта

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

Так выглядит список найденных каталогов, в виде древовидной структуры.

Древовидный вид директорий сайта

Древовидный вид директорий сайта

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

Заключение

Это были три простых и наиболее часто используемых инструмента для перебора директорий веб-приложений. Это все на сегодня. Увидимся в следующей статье.

Инструменты Kali Linux

Список инструментов для тестирования на проникновение и их описание

Описание DIRB

DIRB — это сканер веб-контента. Он ищет существующие (возможно, скрытые) веб-объекты. В основе его работы лежит поиск по словарю, он формирует запросы к веб-серверу и анализирует ответ.

DIRB поставляется с набором настроенных на атаку словарей для простого использования, но вы можете использовать и ваш собственный список слов. Также иногда DIRB можно использовать как классический CGI сканер, но помните, что в первую очередь это сканер содержимого, а не сканер уязвимостей.

Главная цель DIRB — это помочь профессионалам в аудите веб-приложений. Особенно в тестах ориентированных на безопасность. Она покрывает некоторые дыры, не охваченные классическими сканерами веб-уязвимостей. DIRB ищет специфические веб-объекты, которые другие сканеры CGI не ищут. Она не ищет уязвимости и не ищет веб-содержимое, которое может быть уязвимым.

Может быть, эта программа станет последней попыткой для невезучих аналитиков по безопасности… ��

Day 6 — Dirb — 100 tools in 100 days!

This post is designed to teach you what the tool Dirb accomplishes and how to use it.

1. Introduction

Welcome to the sixth blog post of 100 tools in 100 days.
In this post and concurrent posts, I will introduce you to a tool in Kali or Parrot Linux.
I will discuss use cases for the tool.
Finally, I will show a quick how-to to get you started using it.

2. My Setup

For running the Dirb tool, I used Kali Linux in a VmWare Workstation 16 Player virtualized environment.

For my victim website, I used the Metasploitable2 server on a VMWare Workstation 16 Player virtualized environment.

  • You could use Dirb on Hack The Box rooms and some Try Hack Me rooms if you do not have resources for setting up Metasploitable 2.

3. What is Dirb?

Dirb is a command line web content scanner that enumerates directories and objects using a dictionary style attack.

Find more information about Dirb here.

4. Why use Dirb?

Discovery! Dirb allows a user to discover pages and objects inside of a website.

Dirb allows a developer or pentester to enumerate the directory and objects of a website.

Most importantly this can help developers find pages that are accessible to the public that should not be visible.

Dirb does have some limitations, you shouldn’t expect Dirb to find every directory and object as its search parameters are limited to the default wordlist or wordlist you choose.

Disclaimer:

Dirb scans directories of a website, using this on a website you are not authorized to will create alerts and possible punishment in some jurisdictions. Dirb is an active reconnaisance tool.

5. How to use Dirb?

Here is a breakdown of the above command:

I skipped recursive scanning as I just wanted to get top level directories and objects. You can choose to scan as you wish.

After scanning is completed, my terminal has a standard output that lists all objects and directories that Dirb found during its scan. Again this is limited to the dictionary list used (I used the default common.txt that Dirb uses).
See my output below:

Now you can see from my screenshot below the directory dvwa was found immediately.

6. Summary

This blog post showed you a very brief overview of what Dirb is, and some of its capabilities.

Dirb is a quick and easy to use directory and object web scanner.

Dirb does have some limitations, it uses a wordlist for finding directories and objects, as demonstrated when dvwa was not in the default world list, dirb did not find it.

Dirb should only be used on websites where you have permission to perform active reconnaisance.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *