Try   HackMD

Занятие 0 - Подготовка стенда

Часть 0. Загрузка файлов и подготовка среды виртуализации

Подготовка среды виртуализации

Необходимо скачать и установить программу виртуализации: https://www.virtualbox.org/wiki/Downloads
В дополнение скачать и установить Oracle VM VirtualBox Extension Pack: https://www.virtualbox.org/wiki/Downloads

Для модуля понадобятся образы Windows server 2016 en, Windows server 2016 ru, Windows 10 Pro, mikrotik, kali linux. Их можно скачать с портала edu, либо по ссылкам ниже.

  1. Образы Windows server 2016 en, Windows server 2016 ru, Windows 10 Pro доступны для скачивания с официального сайта Microsoft: Server2016, Windows10.

  2. Скачать mikrotik можно по ссылке на облачное хранилище.

  3. Актуальную версию ОС Kali Linux можно скачать с официального сайта.

  • В случае проблем со скачиванием образов Windows с официального сайта, Windows server 2016 en, Windows server 2016 ru, Windows 10 Pro можно скачать по ссылке на облачное хранилище

Часть 1. Установка Windows Server

1.1 Создадим шаблон виртуальной машины:
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.2 Укажем версию устанавливаемой ОС:
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.3 Выделим необходимое количество оперативной памяти (ОП).
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 →
::
Если в вашем ПК 6-8 гб ОП, то выделяйте для winserver 1,5 гб ОП. Если 16 и более выделяйте 2-4 гб ОП.
1.4 Создадим новый виртуальный жесткий диск
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.5 Оставим тип и формат без изменений
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 →
1.6 Рекомендую создавать диск не менее, чем 30Гб
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.7 Виртуальная машина готова! Включим её:
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.8 При запуске необходимо указать, где берём файлы ОС. Это будет наш ISO образ. Укажем путь к нему:
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 →
В MAC OS сразу откроется finder, где можно будет выбрать ISO
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 →
В Windows OS нужно нажать дополнительную кнопку, после чего выбрать ISO.
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.9 Пункты для установки по порядку:
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 →
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 →
Пойдет процесс установки. Виртуальная машина перезагрузится и предложит вам создать пароль пользователя. После ввода пароля запустится Windows. На этом установка окончена.

Часть 2. Установка Windows 10 Pro

Пункты 1-8 по созданию шаблона виртуальной машины аналогичны ранее приведенной инструкции в части 1. По техническим требованиям рекомендую давать 4Гб оперативной памяти в случае, если на ПК общий объем ОП 16Гб и более. Если менее 16Гб ОП то выдать виртуальной машине 2Гб ОП. По диску выдать не менее 30Гб.

Процесс установки:
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 →
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 →
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 →
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 →
После этого Windows включится. На текущем этапе более ничего конфигурировать не нужно.

Часть 3. Настройка роутера

Импорт Mikrotik

Необходимо войти в меню импорта виртуальных машин

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 →

Выбрать скачанный образ микротика mikrotik-6-44.ovf

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 →

Конфигурация Mikrotik

Учетка: Admin
Пароль пустой.

Здесь будет приведен первый способ, связанный с настройкой устройства через графический интерфейс программы. А внизу статьи будет приведен набор команд, которые можно ввести в консоли микротика (этот способ быстрее, но рекомендуется только опытным пользователям Linux или людям, имеющим опыт конфигурации устройств через консоль)

Примечание: В статье приводится пример, когда адаптеры mikrotik называются ether5,6,7. Но может произойти так, что адаптеры будут называться ether1,2,3. Если это произойдет, просто применяйте все команды учитывая соответствие, что ether1=ether5, ether2=ether6 и так далее.

3.1 Коннект к микротику
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 →
После запуска виртуальной машины необходимо открыть Winbox, нажать на кнопку "neighbors", там должен отобразиться интерфейс микротика с MAC адресом (возможно придется подождать минуту перед тем, как адрес появится). Нужно нажать на этот мак адрес так, чтобы он появился в верхнем поле (либо ввести его вручную), ввести имя аккаунта admin, а поле пароля оставить пустым, после чего нажать connect. Должно открыться окно конфигурации роутера.
3.2 Чтобы роутер работал корректно, необходимо перегенерировать MAC адреса адаптеров. Зайти в меню interfaces
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. Нажать на интерфейс ether5 и выключить его. То же самое сделать с ether6
::
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.4 Зайти в интерфейс ether5, нажать кнопку "Reset MAC address", после этого apply и ok. Аналогично с ether6.
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.5 Включить ether5 и ether6
3.6 Зайти в меню dhcp client
3.7 2 раза нажать по интерфейсу, откроется меню конфигурирования
3.8 Проверить, что там выставлен ether5 и нажать apply
интерфейс получит ip адрес и микротик сможет выходить в сеть интернет (можно проверить пингами из терминала микротика)
3.9 Далее настроим ip адрес для внутреннего адаптера сети. Зайдем в меню адресов интерфейсов
3.10 Там добавим новый адрес
3.11 И настроим его.
3.12 Для того, чтобы инфраструктура могла обращаться к сети интернет, необходимо сконфигурировать правило. Заходим в IP->Firewal, затем во вкладку NAT
3.13 Добавляем через синюю кнопку плюс новое правило NAT. Во вкладке General укажем интерфейс для исходящего трафика. Во вкладке Action нужно включить маскарадинг.
3.14 Зайдите в меню DNS
3.15 Впишите адрес внешнего кеширующего сервера в верхний пункт и разрешите удалённые запросы. После этого примените настройки

После данных манипуляций необходимо на всех остальных виртуальных машинах (windows server 2016 en и ru, win10pro, kali linux) выставить в настройках сетевого адаптера тип "внутренняя сеть"

Часть 4. Настройка виртуальной Windows

Необходимо изменить имя ПК и поставить ему произвольное и читаемое (например, PC1). Для этого в панели управления перейдем в настройки системы
Зайдем в меню переименования
После подтверждения изменений windows перезагрузится

Траблшутинг.

Если на fedora не запускается vmware:

Uefi secure boot мог блокировать подгрузку модулей в ядро. После отключения все должно заработать

Если микротик жалуется на лицензию и говорит, что превратится в тыкву через 24 часа, необходимо применить в cmd хостовой windows, запущенной от имени администратора, следующие 3 команды:

C:\Program Files\Oracle\VirtualBox> vboxmanage setextradata "имявиртуалкимикротика" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/SerialNumber" "string:00000000000000000001"

C:\Program Files\Oracle\VirtualBox> VBoxManage setextradata "имявиртуалкимикротика" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/FirmwareRevision" "string:QM00001"

C:\Program Files\Oracle\VirtualBox> VBoxManage setextradata "имявиртуалкимикротика" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/ModelNumber" "string:VMware Virtual IDE Hard Drive"

Проблемы с виртуализацией

  1. Проверьте, включена ли виртуализация на вашем ПК. Если нет, то включите в биосе.
Проверить можно в диспетчере задач
Либо другими способами, описанными тут
  1. Проверьте, отключен ли компонент Hyper-V. Если включен, то его необходимо выключить.

  2. Ошибка Credential Guard

Конфигурация Mikrotik через консоль

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

ip dhcp-client add interface=ether1 disabled=no
ip address print

Вы должны увидеть, что первый интерфейс получил ip адрес (скорее всего это будет 10.0.2.15, но может быть и похожий)

После настроим NAT

ip firewall nat add chain=srcnat action=masquerade out-interface=ether1

И дадим адрес на врутренний интерфейс

ip address add address=192.168.10.254/24 interface=ether2

Готово!

Если хочется Win11, но вылетает ошибка несовместимости с ТТХ

Когда вылетит это окно:

  • Нажмите Shift+F10.
  • Введите команду «regedit» и нажмите кнопку ввода.
  • Вставьте в адресную строку редактора реестра такой маршрут «HKEY_LOCAL_MACHINE\SYSTEM\Setup» и нажмите кнопку ввода (либо пройдите по этому пути в появившемся проводнике).
  • нажмите на Setup ПКМ, пройдите в меню new и там нажмите key. Вы создадите ветку реестра, назовите её LabConfig.
  • в этой ветке нужно создать три значения DWORD 32-bit. Называться они будут «BypassTPMCheck», «BypassRAMCheck» и «BypassSecureBootCheck».
  • После создания и переименования проставьте значение на каждый из трех параметров. Значение будет 1.

  • Зактойте меню редактора
  • Закройте меню с ошибкой проверки ТТХ. Откроется меню к кнопкой install
  • Нажмите install и продолжайте обычную установку.