Try   HackMD

Отчет по выполнению Занятия 2. Основные атаки на L2.

Практическая работа 2.

Задание к практической работе 2:

Задание для практической работы:

Необходимо провести атаки на канальном уровне модели OSI (L2):
Топология сети выгляди следующим образом:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Часть 1. Переполнение таблицы коммутации.

  1. Установим утилиту dsniff на kali. dsniff - это утилита (набор инструментов) для сниффинга паролей и анализа сетевого трафика. Сначала обновим ссылки на репозитории, откуда будем скачивать утилиту.

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Далее включим атаку, введя команду macof. Эта атака флудит MAC-адресами на подключенный коммутатор, таким образом переполняется его таблица коммутации, где хранятся все MAC-адреса подключенных к нему устройств. Из-за лавинного флуда коммутатор, не зная куда ему направлять данные (адресов-то пришло много, а место в таблице коммутации не резиновое), начинает отправлять из всем, в том числе и злоумышленнику.

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

    Коммутатор Switch7 до атаки MAC-flooding-attack:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Так выглядит процесс атаки:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Коммутатор после атаки:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Также во время атаки подключенные устройства будут испытывать пробемы с сетью, на скриншоте ниже была запущена утилита ping на компьютере Win10 (отчетливо видны задержки и потери пакетов):

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

Часть 2. Arp-Spoofing.

  1. Установим утилиту telnet на Win7:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Проверим работоспособность telnet:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Успешно вошли в Switch7:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Настроим kali для атаки, а именно изменим настройки маршрутизации (ракомментировав строку "net.ipv4.ip_forward=1", мы разрешаем мы разрешаем пересылку IP-пакетов в IP-сети):

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Начнем атаку arpspoof (испульзуемые флаги "-i eth0" - сетевой интерфейс kali, "-t 192.168.1.50" - адрес Win7, "-r 192.168.1.100" - адрес Switch7):

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Подключаемся к Switch7 через Win7 по telnet:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Предварительно включив WireShark на интерфейсе kali, смотрим лог трафика во время подключения к Switch7. По фильтру telnet можем увидеть последовательность пакетов telnet.

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Если собрать поток и включить следование, увидим аутентификационные данные целиком, а не посимвольно.

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

Часть 3. VLAN hopping.

  1. Для начала поместим Win10 в vlan10 и сконфигурируем trunk port на Switch7:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Настроим на Switch9 интерфесы е0/0, e0/1, e0/2 в trunk:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Настроим шлюз на роутере Router для vlan10:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Таким обазом, мы настроили доступ по сети между kali и win10, но трафик между ними будет проходит через маршрутизацию роутером. Используем атаку VLAN hopping, чтобы получить доступ в рамках широковещательного домена из Kali до win10.

    Для проведения атаки нам потребуется утилита yersinia, установим её:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Запустим утилиту:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Будем проводить атаку на протокол DTP:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Сконфигурируем интерфесы kali, установим адрес 192.168.1.50/24 на интерфейс eth0.10 и сгенерируем трафик в сторону Win10:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Посмотрим лог сгенерированного трафика в WireShark:

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →