-
Notifications
You must be signed in to change notification settings - Fork 3
/
VagrantFile
121 lines (94 loc) · 4.32 KB
/
VagrantFile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#Lots of inspiration from:
#https://github.com/rgl/windows-domain-controller-vagrant
#https://github.com/UNT-CAS/Vagrant-AD-Lab
#https://github.com/clong/DetectionLab
Vagrant.configure("2") do |config|
config.vm.define "parentDC" do |cfg|
cfg.vm.box = "gusztavvargadr/windows-server"
#config.vm.box_version = "1809.0.2109"
cfg.vm.hostname = "parentDC"
# use the plaintext WinRM transport and force it to use basic authentication.
cfg.winrm.transport = :plaintext
cfg.winrm.basic_auth_only = true
cfg.vm.communicator = "winrm"
# Setting DC ip statically for host-only adapter.
# If you change this, you'll also need to change it in Dmain Join script.
cfg.vm.network :private_network, ip: "192.168.56.2"
cfg.vm.provision "shell", path: "domain-controller.ps1"
cfg.vm.provision "shell", reboot: true
cfg.vm.provision "shell", path: "domain-controller-configure.ps1"
cfg.vm.provision "shell", reboot: true
cfg.vm.provider "virtualbox" do |vb, override |
vb.gui = true
vb.customize ["modifyvm", :id, "--memory", 2048]
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--vram", "32"]
vb.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]
vb.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
end
end
config.vm.define "parentWkstn" do |cfg|
cfg.vm.box = "gusztavvargadr/windows-server"
#config.vm.box_version = "1809.0.2109"
cfg.vm.hostname = "parentWkstn"
cfg.vm.communicator = "winrm"
cfg.vm.network :private_network, ip: "192.168.56.3", gateway: "192.168.56.2", dns: "192.168.56.2"
cfg.vm.provision "shell", reboot: true
cfg.vm.provision "shell", path: "domainjoin.ps1"
cfg.vm.provision "shell", reboot: true
cfg.vm.provision "shell",
inline: "net localgroup Administrators rebecca.howe /add"
cfg.vm.provision "shell", path: "autologin-rebecca.ps1"
cfg.vm.provider "virtualbox" do |vb, override|
vb.gui = true
vb.customize ["modifyvm", :id, "--memory", 2048]
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--vram", "32"]
vb.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]
vb.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
end
end
config.vm.define "parentSQL" do |cfg|
cfg.vm.box = "gusztavvargadr/windows-server"
#config.vm.box_version = "1809.0.2109"
cfg.vm.hostname = "parentSQL"
cfg.vm.communicator = "winrm"
cfg.vm.network :private_network, ip: "192.168.56.4", gateway: "192.168.56.2", dns: "192.168.56.2"
cfg.vm.provision "shell", reboot: true
cfg.vm.provision "shell", path: "domainjoin.ps1"
cfg.vm.provision "shell", reboot: true
cfg.vm.provision "shell",
inline: "net localgroup Administrators svc.acct /add"
cfg.vm.provision "shell", path: "autologin-rebecca.ps1"
cfg.vm.provider "virtualbox" do |vb, override|
vb.gui = true
vb.customize ["modifyvm", :id, "--memory", 2048]
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--vram", "32"]
vb.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]
vb.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
end
end
config.vm.define "attacker" do |cfg|
cfg.vm.box = "gusztavvargadr/windows-server"
#config.vm.box_version = "1809.0.2109"
cfg.vm.hostname = "attacker"
cfg.vm.communicator = "winrm"
cfg.vm.network :private_network, ip: "192.168.56.10", gateway: "192.168.56.2", dns: "192.168.56.2"
cfg.vm.provision "shell", reboot: true
cfg.vm.provision "shell", path: "domainjoin.ps1"
cfg.vm.provision "shell", reboot: true
cfg.vm.provision "shell",
inline: "net localgroup Administrators tester /add"
cfg.vm.provision "shell",
inline: "echo 'Now you can logon to attacker vm with tester:It3st2Detest!'"
cfg.vm.provider "virtualbox" do |vb, override|
vb.gui = true
vb.customize ["modifyvm", :id, "--memory", 2048]
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--vram", "32"]
vb.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]
vb.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
end
end
end