Active Directory Lab Setup - 102
A step-by-step guide for building your very own Cybersecurity Home Lab using VMware Workstation
TEARING DOWN the DOMAIN CONTROLLER
TEARING DOWN the DOMAIN CONTROLLER
We executed ./gen_ad.ps1 but we dont know the important part of this Powershell Script. Lets look at our ./gen_ad.ps1 a little bit more.
The provided PowerShell functions WeakenPasswordPolicy
and StrengthenPasswordPolicy
are designed to modify the local security policy on a Windows machine. These functions specifically adjust the password complexity requirements and minimum password length settings. Here's a detailed explanation of each function:
Function: WeakenPasswordPolicy
Function: WeakenPasswordPolicy
The Purpose of this is to weaken the password policy by setting:
Password complexity requirement to off (0).
Minimum password length to 1 character.
Steps:
Export Current Security Policy:
This command exports the current security policy settings to a configuration file
secpol.cfg
.Modify Security Policy Settings:
This line reads the exported configuration file, replaces the
PasswordComplexity
setting from 1 (enabled) to 0 (disabled), and changes theMinimumPasswordLength
from 7 to 1. The modified content is then written back tosecpol.cfg
.Apply Modified Security Policy:
This command applies the modified security policy settings from
secpol.cfg
to the system.Remove Temporary Configuration File:
This line deletes the temporary configuration file
secpol.cfg
without asking for confirmation.
Function: StrengthenPasswordPolicy
Function: StrengthenPasswordPolicy
The Purpose to strengthen the password policy by setting:
Password complexity requirement to on (1).
Minimum password length to 7 characters.
Steps:
Export Current Security Policy:
This command exports the current security policy settings to a configuration file
secpol.cfg
.Modify Security Policy Settings:
This line reads the exported configuration file, replaces the
PasswordComplexity
setting from 0 (disabled) to 1 (enabled), and changes theMinimumPasswordLength
from 1 to 7. The modified content is then written back tosecpol.cfg
.Apply Modified Security Policy:
This command applies the modified security policy settings from
secpol.cfg
to the system.Remove Temporary Configuration File:
This line deletes the temporary configuration file
secpol.cfg
without asking for confirmation.
Summary :
WeakenPasswordPolicy reduces security by allowing simpler and shorter passwords.
StrengthenPasswordPolicy enhances security by requiring more complex and longer passwords.
Both functions automate the process of exporting, modifying, applying, and cleaning up the local security policy configuration to change password requirements on a Windows system.
Last updated