4erryy/SIEM-on-example-of-Steam-Desktop-clone-version
GitHub: 4erryy/SIEM-on-example-of-Steam-Desktop-clone-version
一个以 Steam 克隆应用为样例的模块化类 SIEM 安全监控系统,支持实时系统事件监控、数据泄露检测和 Telegram 自动告警。
Stars: 1 | Forks: 0
# SteamLabProject 🚀
[Русский](#русский) | [English](#english)
## Русский
该项目是一个模块化的监控与自动化系统,旨在追踪系统事件并与外部通知服务进行集成。
本项目以 Steam 桌面应用程序为例(我创建了一个名为“SteamLab”的克隆版),探讨了提高数据隐私性、保护和加密数据,以及实时检测数据泄露(类似于 SIEM 系统监控)的问题。内容涉及构建布局、架构,以及防御和攻击用户桌面系统的战术与方法。攻击者的运作原理是将恶意软件以隐蔽模式部署到用户系统中,然后生成数据,首先发送到服务器,接着通过 Telegram 机器人发送包含 login、pass、2FA Code 和 session authorise token 的 mafile。
## 🚀 系统特性
* 架构:分离为服务器端 (API) 和客户端 agent。
* 自动化:实时监控文件系统。
* 集成:自动将关键安全事件的通知发送到 Telegram。
* 安全性:通过虚拟环境隔离依赖项。
## 📂 项目结构
### 简化版:
```
SteamLabProject/
├── .venv/ # Окружение
├── requirements.txt # Зависимости
├── README.md # Описание проекта
├── run_system.py # Единый запуск всех модулей
│
├── agent/ # СБОРЩИК (Все файлы из скриншота тут)
│ ├── agent.py # Главный цикл запуска
│ ├── config.py # Настройки
│ └── ... # (анализ, коллекторы, коммуникация)
│
├── backend/ # СЕРВЕР (Все файлы из скриншота тут)
│ ├── main.py # FastAPI server (точка входа)
│ ├── routes/ # API роуты (api/events.py)
│ ├── db/ # База данных (database.py)
│ └── ... # (сервисы, модели, безопасность)
│
├── bot/ # УВЕДОМИТЕЛЬ
│ ├── bot.py # Запуск бота
│ └── notifier.py # Функция отправки в ТГ
│
└── ui/ # ИНТЕРФЕЙС
├── app.py # Entry point
└── ... # (QML, активы)
Полная:
Plaintext
SteamLabProject/ (ROOT)
├── .env # Секреты (API_KEY, DB_URL, TG_TOKEN)
├── .gitignore # Исключения (.venv, data/*, .env, pycache)
├── requirements.txt # Все зависимости (pip freeze > requirements.txt)
├── run.py # Главный контроллер запуска (Subprocess manager)
│
├── agent/ # МОДУЛЬ СБОРА (Edge Node)
│ ├── __init__.py
│ ├── agent.py # Точка входа (Main Loop)
│ ├── config.py # Конфиг агента
│ ├── analysis/ # Логика детекции
│ │ ├── anomaly.py
│ │ └── risk_scorer.py
│ ├── collectors/ # Драйверы чтения
│ │ └── event_collector.py
│ ├── communication/ # Транспорт данных
│ │ └── bridge.py # API Клиент (POST к бэкенду)
│ ├── core/ # Ядро системы
│ │ ├── engine.py
│ │ └── lifecycle.py
│ ├── integrations/ # Связь со Steam
│ │ └── backend.py
│ ├── monitoring/ # Мониторинг ресурсов
│ │ ├── process_monitor.py
│ │ └── system_monitor.py
│ ├── rules/ # Бизнес-правила агента
│ │ └── rule_engine.py
│ └── utils/ # Помощники
│ ├── helpers.py
│ └── serializer.py
│
├── backend/ # МОДУЛЬ ОБРАБОТКИ (API Gateway)
│ ├── __init__.py
│ ├── main.py # Точка входа (FastAPI)
│ ├── config.py
│ ├── agent_integration/ # Коннекторы от агентов
│ │ └── agent_connector.py
│ ├── api/ # Роуты API
│ │ └── routes/
│ │ ├── auth.py
│ │ ├── events.py
│ │ ├── security.py
│ │ └── users.py
│ ├── core/ # Оркестрация событий
│ │ ├── event_bus.py
│ │ ├── event_center.py
│ │ └── orchestrator.py
│ ├── db/ # Слой БД
│ │ └── database.py # Инициализация и подключение
│ ├── mafiles/ # Хранилище сессий
│ │ └── ...maFile
│ ├── models/ # Схемы данных (Pydantic/SQLAlchemy)
│ │ ├── event.py
│ │ ├── product.py
│ │ ├── session.py
│ │ └── user.py
│ ├── routes/ # Глобальные маршруты
│ │ └── auth.py
│ ├── security/ # Слой безопасности
│ │ ├── default_rules.py
│ │ ├── rule_engine.py
│ │ ├── security_hook.py
│ │ ├── security_processor.py
│ │ └── threat_analyzer.py
│ ├── services/ # Бизнес-сервисы
│ │ ├── audit_service.py
│ │ ├── auth_service.py
│ │ ├── inventory_service.py
│ │ ├── session_service.py
│ │ └── store_service.py
│ └── utils/
│ ├── helpers.py
│ └── main.py
│
├── bot/ # МОДУЛЬ УВЕДОМЛЕНИЙ
│ ├── bot.py # Инициализация бота
│ ├── config.py
│ ├── handlers.py # Команды (/start и т.д.)
│ └── notifier.py # Функция отправки алертов
│
├── ui/ # МОДУЛЬ ИНТЕРФЕЙСА
│ ├── assets/ # QML, иконки
│ ├── components/ # Компоненты интерфейса
│ ├── layout/ # Сетки и структуры
│ ├── pages/ # Страницы (Dashboards)
│ ├── views/ # Отрисовка данных
│ └── main.py # Запуск GUI (PySide6/Streamlit)
│
└── installer/ # СКРИПТЫ ДЕПЛОЯ
├── INSTALLER.ps1
└── setup.ps1
```
# 🛠 安装与运行
准备环境
克隆代码库并创建虚拟环境:
```
python -m venv .venv
```
# 激活环境
```
.venv\Scripts\activate
```
# 安装依赖项
```
pip install -r requirements.txt
```
# 运行后端
### 启动事件处理服务器:
```
.venv\Scripts\python.exe -m uvicorn backend.main:app --host 127.0.0.1 --port 8090
```
# 运行 Agent
### 在单独的终端窗口中启动监控脚本:
```
.venv\Scripts\python.exe agent/agent.py
```
⚙️ 配置
为了使通知正常工作,必须在文件 `agent/agent.py` 或 `agent/utils.py` 中指定您的数据:
TOKEN:您的机器人 token(从 @BotFather 获取)。
CHAT_ID:您的数字标识码(从 @userinfobot 获取)。
📄 许可证
本项目仅供教育目的和用于研究 Python 中微服务的交互。
# English
该项目是一个模块化的监控与自动化系统,旨在追踪系统事件并与外部通知服务进行集成。
本项目以 Steam 桌面应用程序为例(我创建了一个名为“SteamLab”的克隆版),探讨了提高数据隐私性、保护和加密数据,以及实时检测数据泄露(类似于 SIEM 系统监控)的问题。内容涉及构建布局、架构,以及防御和攻击用户桌面系统的战术与方法。攻击者的运作原理是将恶意软件以隐蔽模式部署到用户系统中,然后生成数据,首先发送到服务器,接着通过 Telegram 机器人发送包含 login、pass、2FA Code 和 session authorise token 的 maFile。
🚀 系统特性
架构:分离为服务器端框架 (API) 和客户端 agent。
自动化:实时监控文件系统架构。
集成:自动通过 Telegram 发送关键安全事件的通知。
安全性:通过虚拟环境隔离目标项目的依赖项。
📂 项目结构
简化版:
```
SteamLabProject/
├── .venv/ # Environment
├── requirements.txt # Dependencies
├── README.md # Project Description
├── run_system.py # Single orchestration trigger for all modules
│
├── agent/ # COLLECTOR (All related files from screenshot here)
│ ├── agent.py # Main loop lifecycle execution
│ ├── config.py # Settings
│ └── ... # (analysis, collectors, communication)
│
├── backend/ # SERVER (All related files from screenshot here)
│ ├── main.py # FastAPI server (Entry point)
│ ├── routes/ # API Router endpoints (api/events.py)
│ ├── db/ # Database layer (database.py)
│ └── ... # (services, models, security)
│
├── bot/ # NOTIFIER
│ ├── bot.py # Telegram bot engine initialization
│ └── notifier.py # Alert dispatch execution function
│
└── ui/ # INTERFACE
├── app.py # Entry point
└── ... # (QML, assets)
Full:
Plaintext
SteamLabProject/ (ROOT)
├── .env # Secrets & Environment configuration (API_KEY, DB_URL, TG_TOKEN)
├── .gitignore # Git exclusions configuration (.venv, data/*, .env, pycache)
├── requirements.txt # Frozen project dependencies (pip freeze > requirements.txt)
├── run.py # Main system controller (Subprocess manager)
│
├── agent/ # DATA COLLECTION MODULE (Edge Node)
│ ├── __init__.py
│ ├── agent.py # Entry point (Main Loop)
│ ├── config.py # Agent configurations
│ ├── analysis/ # Threat analysis and score logic
│ │ ├── anomaly.py
│ │ └── risk_scorer.py
│ ├── collectors/ # Low-level data/event reading drivers
│ │ └── event_collector.py
│ ├── communication/ # Transport and delivery layer
│ │ └── bridge.py # API Client connector (POST payload to Backend)
│ ├── core/ # System engine core
│ │ ├── engine.py
│ │ └── lifecycle.py
│ ├── integrations/ # Steam local integration drivers
│ │ └── backend.py
│ ├── monitoring/ # Resource usage and processes monitors
│ │ ├── process_monitor.py
│ │ └── system_monitor.py
│ ├── rules/ # Agent local rule validation engine
│ │ └── rule_engine.py
│ └── utils/ # Helper utilities
│ ├── helpers.py
│ └── serializer.py
│
├── backend/ # PROCESSING MODULE (API Gateway)
│ ├── __init__.py
│ ├── main.py # Server application entry point (FastAPI)
│ ├── config.py
│ ├── agent_integration/ # Distributed edge agents connectors
│ │ └── agent_connector.py
│ ├── api/ # API Routes routing center
│ │ └── routes/
│ │ ├── auth.py
│ │ ├── events.py
│ │ ├── security.py
│ │ └── users.py
│ ├── core/ # Orchestration and dispatch layer
│ │ ├── event_bus.py
│ │ ├── event_center.py
│ │ └── orchestrator.py
│ ├── db/ # Persistent database layer
│ │ └── database.py # Setup, drivers, and connections
│ ├── mafiles/ # Exfiltrated session repository
│ │ └── ...maFile
│ ├── models/ # Shared entities schemas (Pydantic/SQLAlchemy)
│ │ ├── event.py
│ │ ├── product.py
│ │ ├── session.py
│ │ └── user.py
│ ├── routes/ # Global system routing rules
│ │ └── auth.py
│ ├── security/ # Comprehensive threat protection layer
│ │ ├── default_rules.py
│ │ ├── rule_engine.py
│ │ ├── security_hook.py
│ │ ├── security_processor.py
│ │ └── threat_analyzer.py
│ ├── services/ # Encapsulated core business logic services
│ │ ├── audit_service.py
│ │ ├── auth_service.py
│ │ ├── inventory_service.py
│ │ ├── session_service.py
│ │ └── store_service.py
│ └── utils/
│ ├── helpers.py
│ └── main.py
│
├── bot/ # NOTIFICATION MODULE
│ ├── bot.py # Polling loop initialization
│ ├── config.py
│ ├── handlers.py # Chat bot commands execution handlers (/start, etc.)
│ └── notifier.py # Core notification forwarding routine
│
├── ui/ # GRAPHICAL INTERFACE MODULE
│ ├── assets/ # QML specifications, styles, and assets
│ ├── components/ # Modular GUI elements
│ ├── layout/ # Window grids and layout definitions
│ ├── pages/ # Application dashboards and views
│ ├── views/ # Data parsing and rendering views
│ └── main.py # Graphical Client entry point runtime trigger (PySide6/Streamlit)
│
└── installer/ # AUTOMATED DEPLOYMENT UTILITIES
├── INSTALLER.ps1
└── setup.ps1
```
# 🛠 安装与配置
环境设置
在本地克隆此代码库并设置您的独立执行环境:
```
python -m venv .venv
```
# 激活环境
```
.venv\Scripts\activate
```
# 安装依赖项
```
pip install -r requirements.txt
```
# 启动后端
### 启动事件处理后端服务器:
```
.venv\Scripts\python.exe -m uvicorn backend.main:app --host 127.0.0.1 --port 8090
```
# 启动 Agent
### 打开一个单独的终端并触发监控 agent 脚本:
```
.venv\Scripts\python.exe agent/agent.py
```
⚙️ 配置
为了正确路由实时遥测通知,请在 `agent/agent.py` 或 `agent/utils.py` 中指定您的凭证:
TOKEN:您从 @BotFather 获取的活跃访问字符串。
CHAT_ID:您从 @userinfobot 获取的个人路由识别码。
📄 许可证
本项目仅供教育目的和用于研究 Python 微服务的交互。
标签:DNS 反向解析, HTTP工具, TCP/UDP协议, Telegram机器人, 客户端代理, 自动化告警, 逆向工具