Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
dc-sonar — 分析AD域中与用户账户相关的安全风险 | Kitploit
工具/GitHubGitHub/st1lly/dc-sonar
密码破解漏洞分析学习与教育
GitHubst1lly/dc-sonar

dc-sonar

分析AD域中与用户账户相关的安全风险

查看仓库网站
6493年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

DC Sonar 社区

仓库

该项目包含以下仓库:

  • dc-sonar-frontend
  • dc-sonar-user-layer
  • dc-sonar-workers-layer
  • ntlm-scrutinizer

免责声明

仅供教育目的使用。

请勿在生产环境中的 Active Directory (AD) 域下使用。

任何贡献者均不对其使用承担任何责任。

社交媒体

查看我们的红队社区 Telegram 频道

目录

  1. 描述
    1. 架构
    2. 功能
  2. 安装
    1. Docker
    2. 使用 dpkg 手动安装
  3. 风格指南
  4. 开发部署
    1. Docker
    2. 使用 Windows 宿主机和 Ubuntu Server 虚拟机手动部署
      1. 设置虚拟机
      2. 配置 Windows
      3. 设置共享文件夹
      4. 配置 Ubuntu Server
      5. 各层

描述

架构

关于可视化描述,请使用 diagrams.net 工具打开 图表文件。

该应用由以下部分组成:

  • dc-sonar-frontend 是用户 Web 界面的前端部分,基于:
    • Angular
    • Angular Material
  • dc-sonar-user-layer 是 Web 应用的后端部分,基于:
    • Python 3.10
    • Django
    • Django ORM
    • Django REST framework
    • Celery
    • RabbitMQ
    • PostgreSQL
  • dc-sonar-workers-layer 是执行并运行分析流程的逻辑层,基于:
    • Python 3.10
    • SQLAlchemy
    • Alembic
    • APScheduler
    • RabbitMQ
    • PostgreSQL
  • ntlm-scrutinizer 是 NTLM 哈希执行器,提供 REST API,基于:
    • Python 3.10
    • FastAPI
    • hashcat
    • impacket

功能

DC Sonar 社区提供分析 AD 域中与账户相关安全风险的功能:

  • 在应用中注册待分析的 AD 域

    register_ad

  • 查看域分析进程的状态

    domains_analyze_statuses

  • 从指定的 AD 域中导出并暴力破解 NTLM 哈希,列出密码薄弱或易受攻击的账户

    weak_passwords

  • 分析 AD 域账户,列出密码永不过期的账户

    no_expired_passwords

  • 通过 NTLM 密码哈希分析 AD 域账户,确定密码重复的账户和域

    reused_passwords

安装

Docker

开发中 ...

使用 dpkg 手动安装

假定你有一个纯净的 Ubuntu Server 22.04 环境,并且拥有一个用户名为 "user" 的账户。

应用将安装至 /home/user/dc-sonar。

未来的版本可能会提供更灵活的安装方式。

从最新发行版下载 dc_sonar_NNNN.N.NN-N_amd64.tar.gz 到服务器。

创建用于解压文件的文件夹:

root@kitploit:~
mkdir dc_sonar_NNNN.N.NN-N_amd64

解压下载的归档文件:

root@kitploit:~
tar -xvf dc_sonar_NNNN.N.NN-N_amd64.tar.gz -C dc_sonar_NNNN.N.NN-N_amd64

进入解压后的文件夹:

root@kitploit:~
cd dc_sonar_NNNN.N.NN-N_amd64/

安装 PostgreSQL:

root@kitploit:~
sudo bash install_postgresql.sh

安装 RabbitMQ:

root@kitploit:~
sudo bash install_rabbitmq.sh

安装依赖:

root@kitploit:~
sudo bash install_dependencies.sh

它会要求确认添加 ppa:deadsnakes/ppa 仓库,按 Enter 键确认。

安装 dc-sonar 本身:

root@kitploit:~
sudo dpkg -i dc_sonar_NNNN.N.NN-N_amd64.deb

它会要求提供创建 Django 管理员用户的信息,请提供用户名、邮箱和密码。

它会要求提供创建自签名 SSL 证书的信息两次,请提供所需信息。

打开:https://localhost

输入之前安装过程中设置的 Django 管理员用户凭据。

风格指南

请参阅 STYLE_GUIDE.md 中的信息。

开发部署

Docker

开发中 ...

使用 Windows 宿主机和 Ubuntu Server 虚拟机手动部署

在这种情况下,我们将搭建环境,在 Windows 宿主机上编辑代码,同时在 Ubuntu 虚拟机上运行 Python 代码。

设置虚拟机

在 VirtualBox 中使用 Ubuntu Server 22.04 ISO 镜像创建一个虚拟机,配置为 2 个 CPU、2048 MB 内存、10GB SSD。

如果 Ubuntu 安装程序在虚拟机安装前要求更新安装程序,请同意。

选择安装 OpenSSH Server。

VirtualBox 端口转发规则:

配置 Windows

下载并安装 Python 3.10.5。

为 DC Sonar 项目创建一个文件夹。

使用 Git for Windows 进入项目文件夹:

root@kitploit:~
cd '{PATH_TO_FOLDER}'

按照 dc-sonar-user-layer 的 Windows 安装步骤操作。

按照 dc-sonar-workers-layer 的 Windows 安装步骤操作。

按照 ntlm-scrutinizer 的 Windows 安装步骤操作。

按照 dc-sonar-frontend 的 Windows 安装步骤操作。

设置共享文件夹

按照步骤从"打开 VirtualBox"到"重启虚拟机",但在 VirtualBox 中为虚拟机添加共享文件夹,并勾选"自动挂载",如下图所示:

vm_shared_folders

重启后,运行命令:

root@kitploit:~
sudo adduser $USER vboxsf

注销并重新登录所使用的用户账户。

在 /home/user 目录下,你可以使用已挂载的文件夹:

root@kitploit:~
ls -l
root@kitploit:~
Output:
total 12
drwxrwx--- 1 root vboxsf 4096 Jul 19 13:53 dc-sonar-user-layer
drwxrwx--- 1 root vboxsf 4096 Jul 19 10:11 dc-sonar-workers-layer
drwxrwx--- 1 root vboxsf 4096 Jul 19 14:25 ntlm-scrutinizer

配置 Ubuntu Server

配置 PostgreSQL

在 Ubuntu 20.04 上安装 PostgreSQL:

root@kitploit:~
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql.service

创建管理员数据库账户:

root@kitploit:~
sudo -u postgres createuser --interactive
root@kitploit:~
Output:
Enter name of role to add: admin
Shall the new role be a superuser? (y/n) y

创建 dc_sonar_workers_layer 数据库账户:

root@kitploit:~
sudo -u postgres createuser --interactive
root@kitploit:~
Output:
Enter name of role to add: dc_sonar_workers_layer
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n

创建 dc_sonar_user_layer 数据库账户:

root@kitploit:~
sudo -u postgres createuser --interactive
root@kitploit:~
Output:
Enter name of role to add: dc_sonar_user_layer
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n

创建 back_workers_db 数据库:

root@kitploit:~
sudo -u postgres createdb back_workers_db

创建 web_app_db 数据库:

root@kitploit:~
sudo -u postgres createdb web_app_db

运行 psql:

root@kitploit:~
sudo -u postgres psql

为 admin 账户设置密码:

root@kitploit:~
ALTER USER admin WITH PASSWORD '{YOUR_PASSWORD}';

为 dc_sonar_workers_layer 账户设置密码:

root@kitploit:~
ALTER USER dc_sonar_workers_layer WITH PASSWORD '{YOUR_PASSWORD}';

为 dc_sonar_user_layer 账户设置密码:

root@kitploit:~
ALTER USER dc_sonar_user_layer WITH PASSWORD '{YOUR_PASSWORD}';

授予 dc_sonar_workers_layer 账户对 back_workers_db 数据库的 CRUD 权限:

root@kitploit:~
\c back_workers_db
GRANT CONNECT ON DATABASE back_workers_db to dc_sonar_workers_layer;
GRANT USAGE ON SCHEMA public to dc_sonar_workers_layer;
GRANT ALL ON ALL TABLES IN SCHEMA public TO dc_sonar_workers_layer;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO dc_sonar_workers_layer;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO dc_sonar_workers_layer;

授予 dc_sonar_user_layer 账户对 web_app_db 数据库的 CRUD 权限:

root@kitploit:~
\c web_app_db
GRANT CONNECT ON DATABASE web_app_db to dc_sonar_user_layer;
GRANT USAGE ON SCHEMA public to dc_sonar_user_layer;
GRANT ALL ON ALL TABLES IN SCHEMA public TO dc_sonar_user_layer;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO dc_sonar_user_layer;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO dc_sonar_user_layer;

退出 psql:

root@kitploit:~
\q

打开 pg_hba.conf 文件:

root@kitploit:~
sudo nano /etc/postgresql/12/main/pg_hba.conf

添加一行配置以允许从宿主机连接到 PostgreSQL,保存更改并关闭文件:

root@kitploit:~
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             admin           0.0.0.0/0               md5

打开 postgresql.conf 文件:

root@kitploit:~
sudo nano /etc/postgresql/12/main/postgresql.conf

修改下面指定的参数,保存更改并关闭文件:

root@kitploit:~
listen_addresses = 'localhost,10.0.2.15'
shared_buffers = 512MB
work_mem = 5MB
maintenance_work_mem = 100MB
effective_cache_size = 1GB

重启 PostgreSQL 服务:

root@kitploit:~
sudo service postgresql restart

检查 PostgreSQL 服务状态:

root@kitploit:~
service postgresql status

如果需要,检查日志文件:

root@kitploit:~
tail -f /var/log/postgresql/postgresql-12-main.log

现在,你可以使用 admin 账户和客户端(例如 Windows 上的 DBeaver)连接到已创建的数据库。

配置 RabbitMQ

使用脚本安装 RabbitMQ。

启用管理插件:

root@kitploit:~
sudo rabbitmq-plugins enable rabbitmq_management

创建 RabbitMQ 管理员账户:

root@kitploit:~
sudo rabbitmqctl add_user admin {YOUR_PASSWORD}

为创建的用户打上标签,以授予完整的管理 UI 和 HTTP API 访问权限:

root@kitploit:~
sudo rabbitmqctl set_user_tags admin administrator

在 http://localhost:15672/ 上打开管理 UI。

安装 Python3.10

确保你的系统已更新,并安装了所需的软件包:

root@kitploit:~
sudo apt update && sudo apt upgrade -y

安装添加自定义 PPA 所需的依赖:

root@kitploit:~
sudo apt install software-properties-common -y

然后继续添加 deadsnakes PPA 到 APT 包管理器源列表,如下所示:

root@kitploit:~
sudo add-apt-repository ppa:deadsnakes/ppa

下载 Python 3.10:

root@kitploit:~
sudo apt install python3.10=3.10.5-1+focal1

安装依赖:

root@kitploit:~
sudo apt install python3.10-dev=3.10.5-1+focal1 libpq-dev=12.11-0ubuntu0.20.04.1 libsasl2-dev libldap2-dev libssl-dev

安装 venv 模块:

root@kitploit:~
sudo apt-get install python3.10-venv

检查已安装的 python 版本:

root@kitploit:~
python3.10 --version

Output:
Python 3.10.5
Hosts

将域控制器的 IP 地址添加到 /etc/hosts

root@kitploit:~
sudo nano /etc/hosts

各层

设置 venv

我们必须在上一级目录创建 venv,因为 VirtualBox 不允许在共享文件夹中创建。

进入共享文件夹所在的 home 目录:

root@kitploit:~
cd /home/user

在 Ubuntu 上按照 步骤 部署 dc-sonar-user-layer。

在 Ubuntu 上按照 步骤 部署 dc-sonar-workers-layer。

在 Ubuntu 上按照 步骤 部署 ntlm-scrutinizer。

配置模块

在 Ubuntu 上按照 步骤 配置 dc-sonar-user-layer。

在 Ubuntu 上按照 步骤 配置 dc-sonar-workers-layer。

在 Ubuntu 上按照 步骤 配置 ntlm-scrutinizer。

运行

在 Ubuntu 上按照 步骤 运行 ntlm-scrutinizer。

在 Ubuntu 上按照 步骤 运行 dc-sonar-user-layer。

在 Ubuntu 上按照 步骤 运行 dc-sonar-workers-layer。

在 Windows 上按照 步骤 运行 dc-sonar-frontend。

在 Windows 宿主机上的浏览器中打开 https://localhost:8000/admin/,并同意自签名证书。

在 Windows 宿主机上的浏览器中打开 https://localhost:4200/,并使用已创建的 Django 用户登录。

下载工具
名称协议宿主机 IP宿主机端口虚拟机 IP虚拟机端口
SSHTCP127.0.0.1222210.0.2.1522
RabbitMQ management consoleTCP127.0.0.11567210.0.2.1515672
Django ServerTCP127.0.0.1800010.0.2.158000
NTLM ScrutinizerTCP127.0.0.1500010.0.2.155000
PostgreSQLTCP127.0.0.12543210.0.2.155432