Skip to content

Instantly share code, notes, and snippets.

@shoxxdj
Created September 25, 2021 20:48
Show Gist options
  • Save shoxxdj/d46157d570389a6a7b39bc14d55158fb to your computer and use it in GitHub Desktop.
Save shoxxdj/d46157d570389a6a7b39bc14d55158fb to your computer and use it in GitHub Desktop.
Detection Lab adds
cd Vagrant/scripts/ && mkdir perso && vim conf.ps1
conf.ps1
```
#Create Groups
#Create Users
New-ADUser -Name "user01" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -force)
New-ADUser -Name "user02" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -force)
#Create Service Accounts
New-ADUser -Name "mssql_svc" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -force)
#Activate accounts
Enable-ADAccount -Identity "user01"
Enable-ADAccount -Identity "user02"
Enable-ADAccount -Identity "mssql_svc"
#Make it kerberoastable
Set-ADUser -Identity "mssql_svc" -ServicePrincipalNames @{Add='MSSQL/ad@windomain.local'}
```
Edit Vagrantfile :
Add following line before "DC Provisioning Complete" line
```
cfg.vm.provision "shell", path: "scripts/perso/conf.ps1", privileged: false
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment