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

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

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

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

工具目录

分类

查看所有分类
Loading categories
ADLab — 自定义PowerShell模块,用于设置Active Directory实验室环境以练习渗透测试。 | Kitploit
工具/GitHubGitHub/xbufu/adlab
渗透测试学习与教育实验室与实践
GitHubxbufu/adlab

ADLab

自定义PowerShell模块,用于设置Active Directory实验室环境以练习渗透测试。

查看仓库
183351年前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

ADLab PowerShell 模块

简介

此模块旨在自动化部署用于内部渗透测试练习的 Active Directory 实验室环境。

感谢 Joe Helle 及其 PowerShell for Pentesters 课程 提供的攻击向量生成思路。


使用说明

准备

可选但推荐:将模块移入 PSModulePath

root@kitploit:~
# Display PSModulePath
$env:PSModulePath.split(";")

# Move module to path
Move-Item .\ADLab\ "C:\Windows\system32\WindowsPowerShell\v1.0\Modules\"

导入模块

root@kitploit:~
# Import global module
Import-Module ADLab

# Import local module
Import-Module .\ADLab.psm1

初始实验室设置

Invoke-DCPrep

此函数准备当前虚拟机/计算机以用作新林的域控制器。它会设置静态 IP 地址、将 DNS 服务器设为 localhost 并重命名计算机。

root@kitploit:~
# Prepare the current VM with all default values while displaying verbose output
Invoke-DCPrep -Verbose

# Set custom hostname and use Google DNS for Internet access
Invoke-DCPrep -Hostname "DC" -NewIPv4DNSServer "8.8.8.8"

# Use custom IP and default gateway and display verbose output
Invoke-DCPrep -Verbose -NewIPv4Address "192.168.1.99" -NewIPv4Gateway "192.168.1.1"

Invoke-ForestDeploy

此函数安装 AD DS 功能并设置新的 Active Directory 林,无需任何用户输入。完成后重新启动计算机。

root@kitploit:~
# Installs a new forest with FQDN of "bufu-sec.local" with default DSRM password of "Password!"
Invoke-ForestDeploy -Domain bufu-sec.local

# Installs a new forest with FQDN of "bufu-sec.local" with the DSRM password set to "P@ssword!" and displaying debug messages
Invoke-ForestDeploy -Domain "bufu-sec.local" -DSRMPassword "P@ssword!" -Verbose

Invoke-DNSDeploy

此函数首先安装 DNS 功能。然后添加主要区域并配置服务器转发器。

root@kitploit:~
# Install and configure DNS on the current host and display verbose output.
Invoke-DNSDeploy -Verbose -NetworkID 192.168.47.0/24 -ZoneFile "47.168.192.in-addr.arpa.dns" -ServerForwarder 1.1.1.1

Invoke-DHCPDeploy

此函数首先在当前计算机上安装 DHCP 功能。然后添加必要的安全组并使用域控制器授权新的 DHCP 服务器。最后,使用提供的值配置新的 DHCP 作用域。

root@kitploit:~
# Install and configure DHCP on the local DC.
Invoke-DHCPDeploy -Verbose -ScopeName "Default" -ScopeID 192.168.47.0 -StartIP 192.168.47.100 -EndIP 192.168.47.200 -SubnetMask 255.255.255.0 -DNSServer 192.168.47.10 -Router 192.168.47.10

# Install and configure DHCP on the specified DC.
Invoke-DHCPDeploy -Verbose -ScopeName "Default" -ScopeID 192.168.47.0 -StartIP 192.168.47.100 -EndIP 192.168.47.200 -SubnetMask 255.255.255.0 -DNSServer 192.168.47.10 -Router 192.168.47.10 -DCFQDN DC01.bufu-sec.local

内容

Invoke-ADLabFill

此函数首先创建全局 Groups 变量中定义的组和 OU。然后默认情况下为每个 OU 生成 10 个用户对象。

root@kitploit:~
# Fill forest with objects and display verbose output
Invoke-ADLabConfig -Verbose

# Create 50 users for each OU and display verbose output
Invoke-ADLabConfig -Verbose -UserCount 50

攻击向量

Set-ASREPRoasting

此函数从域中获取一定数量的随机用户,并为每个用户设置 DoesNotRequirePreAuth 标志。排除 Administrator 和 krbtgt 等默认账户。默认情况下使 5% 的用户可 ASREP-Roast。

root@kitploit:~
# Make 5% of users ASREP-Roastable and display verbose output
Set-ASREPRoasting -Verbose

# Make 10 random users in the domain ASREP-Roastable
Set-ASREPRoasting -VulnerableUsersCount 10

# Make user bufu ASREP-Roastable and display verbose output
Set-ASREPRoasting -Users bufu -Verbose

# Make supplied list of users ASREP-roastable and display verbose output
Set-ASREPRoasting -Users ("bufu", "pepe") -Verbose

Set-Kerberoasting

此函数从域中获取一定数量的随机用户,并为每个用户添加 SPN。排除 Administrator 和 krbtgt 等默认账户。默认情况下使 5% 的用户可 Kerberoast。

root@kitploit:~
# Make 5% of users ASREP-Roastable and display verbose output
Set-Kerberoasting -Verbose

# Make 10 random users in the domain ASREP-Roastable
Set-Kerberoasting -VulnerableUsersCount 10

# Make user bufu ASREP-Roastable and display verbose output
Set-Kerberoasting -Users bufu -Verbose

# Make supplied list of users ASREP-roastable and display verbose output
Set-Kerberoasting -Users ("bufu", "pepe") -Verbose

Set-BadACLs

此函数首先授予 Chads 组对 Domain Admins 的 GenericAll 权限。然后授予 Degens 组对 Chads 组的 GenericAll 权限。最后,授予 Normies 组中的某些用户对 Degens 组中某些用户的 GenericAll 权限。

root@kitploit:~
# Create vulnerable ACLs and display verbose output
Set-BadACLs -Verbose

Set-PSRemoting

此函数首先配置 GPO 以允许通过 TCP 端口 5985 对域内系统使用 WinRM。然后通过 GPO 启用 PS 远程处理。

root@kitploit:~
# Enable PS Remoting and display verbose output
Set-PSRemoting -Verbose
下载工具