@@ -266,8 +266,10 @@ resource "azurerm_virtual_machine" "logger" {
|
|||||||
}
|
}
|
||||||
inline = [
|
inline = [
|
||||||
"sudo add-apt-repository universe && sudo apt-get -qq update && sudo apt-get -qq install -y git",
|
"sudo add-apt-repository universe && sudo apt-get -qq update && sudo apt-get -qq install -y git",
|
||||||
|
"sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config && sudo service ssh restart",
|
||||||
"echo 'logger' | sudo tee /etc/hostname && sudo hostnamectl set-hostname logger",
|
"echo 'logger' | sudo tee /etc/hostname && sudo hostnamectl set-hostname logger",
|
||||||
"sudo adduser --disabled-password --gecos \"\" vagrant && echo 'vagrant:vagrant' | sudo chpasswd",
|
"sudo adduser --disabled-password --gecos \"\" vagrant && echo 'vagrant:vagrant' | sudo chpasswd",
|
||||||
|
"echo 'vagrant:vagrant' | sudo chpasswd",
|
||||||
"sudo mkdir /home/vagrant/.ssh && sudo cp /home/ubuntu/.ssh/authorized_keys /home/vagrant/.ssh/authorized_keys && sudo chown -R vagrant:vagrant /home/vagrant/.ssh",
|
"sudo mkdir /home/vagrant/.ssh && sudo cp /home/ubuntu/.ssh/authorized_keys /home/vagrant/.ssh/authorized_keys && sudo chown -R vagrant:vagrant /home/vagrant/.ssh",
|
||||||
"echo 'vagrant ALL=(ALL:ALL) NOPASSWD:ALL' | sudo tee -a /etc/sudoers",
|
"echo 'vagrant ALL=(ALL:ALL) NOPASSWD:ALL' | sudo tee -a /etc/sudoers",
|
||||||
"sudo git clone https://github.com/clong/DetectionLab.git /opt/DetectionLab",
|
"sudo git clone https://github.com/clong/DetectionLab.git /opt/DetectionLab",
|
||||||
|
|||||||
@@ -231,8 +231,17 @@
|
|||||||
sed -i "s/license_key =/license_key = $MAXMIND_LICENSE/g" /opt/splunk/etc/apps/TA-asngen/local/asngen.conf
|
sed -i "s/license_key =/license_key = $MAXMIND_LICENSE/g" /opt/splunk/etc/apps/TA-asngen/local/asngen.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Replace the props.conf for Sysmon TA and Windows TA
|
||||||
|
# Removed all the 'rename = xmlwineventlog' directives
|
||||||
|
# I know youre not supposed to modify files in "default",
|
||||||
|
# but for some reason adding them to "local" wasnt working
|
||||||
|
cp /vagrant/resources/splunk_server/windows_ta_props.conf /opt/splunk/etc/apps/Splunk_TA_windows/default/props.conf
|
||||||
|
cp /vagrant/resources/splunk_server/sysmon_ta_props.conf /opt/splunk/etc/apps/TA-microsoft-sysmon/default/props.conf
|
||||||
|
|
||||||
# Add custom Macro definitions for ThreatHunting App
|
# Add custom Macro definitions for ThreatHunting App
|
||||||
cp /vagrant/resources/splunk_server/macros.conf /opt/splunk/etc/apps/ThreatHunting/default/macros.conf
|
cp /vagrant/resources/splunk_server/macros.conf /opt/splunk/etc/apps/ThreatHunting/default/macros.conf
|
||||||
|
# Fix props.conf in ThreatHunting App
|
||||||
|
sed -i 's/EVAL-host_fqdn = Computer/EVAL-host_fqdn = ComputerName/g' /opt/splunk/etc/apps/ThreatHunting/default/props.conf
|
||||||
# Fix Windows TA macros
|
# Fix Windows TA macros
|
||||||
mkdir /opt/splunk/etc/apps/Splunk_TA_windows/local
|
mkdir /opt/splunk/etc/apps/Splunk_TA_windows/local
|
||||||
cp /opt/splunk/etc/apps/Splunk_TA_windows/default/macros.conf /opt/splunk/etc/apps/Splunk_TA_windows/local
|
cp /opt/splunk/etc/apps/Splunk_TA_windows/default/macros.conf /opt/splunk/etc/apps/Splunk_TA_windows/local
|
||||||
|
|||||||
@@ -9,12 +9,8 @@ Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) First, set DNS to DC to join the doma
|
|||||||
$newDNSServers = "192.168.38.102"
|
$newDNSServers = "192.168.38.102"
|
||||||
$adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {$_.IPAddress -match "192.168.38."}
|
$adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {$_.IPAddress -match "192.168.38."}
|
||||||
# Don't do this in Azure. If the network adatper description contains "Hyper-V", this won't apply changes.
|
# Don't do this in Azure. If the network adatper description contains "Hyper-V", this won't apply changes.
|
||||||
$adapters | ForEach-Object {if (!($_.Description).Contains("Hyper-V")) {$_.SetDNSServerSearchOrder($newDNSServers)}}
|
# Specify the DC as a WINS server to help with connectivity as well
|
||||||
|
$adapters | ForEach-Object {if (!($_.Description).Contains("Hyper-V")) {$_.SetDNSServerSearchOrder($newDNSServers); $_.SetWINSServer($newDNSServers, "")}}
|
||||||
# Hardcoding DNS domain name in hosts file to sidestep any DNS issues
|
|
||||||
If (!(Select-String -Path $hostsFile -Pattern "192.168.38.102")) {
|
|
||||||
Add-Content $hostsFile " 192.168.38.102 windomain.local"
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Now join the domain..."
|
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Now join the domain..."
|
||||||
$hostname = $(hostname)
|
$hostname = $(hostname)
|
||||||
@@ -28,7 +24,7 @@ If ($hostname -eq "wef") {
|
|||||||
# Attempt to fix Issue #517
|
# Attempt to fix Issue #517
|
||||||
Set-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control' -Name 'WaitToKillServiceTimeout' -Value '500' -Type String -Force -ea SilentlyContinue
|
Set-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control' -Name 'WaitToKillServiceTimeout' -Value '500' -Type String -Force -ea SilentlyContinue
|
||||||
New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Desktop' -Name 'AutoEndTasks' -Value 1 -PropertyType DWord -Force -ea SilentlyContinue
|
New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Desktop' -Name 'AutoEndTasks' -Value 1 -PropertyType DWord -Force -ea SilentlyContinue
|
||||||
Set-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\SessionManager\Power' -Name 'HiberbootEnabled' -Value 0 -PropertyType DWord -Force -ea SilentlyContinue
|
Set-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\SessionManager\Power' -Name 'HiberbootEnabled' -Value 0 -Type DWord -Force -ea SilentlyContinue
|
||||||
} ElseIf ($hostname -eq "win10") {
|
} ElseIf ($hostname -eq "win10") {
|
||||||
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Adding Win10 to the domain. Sometimes this step times out. If that happens, just run 'vagrant reload win10 --provision'" #debug
|
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Adding Win10 to the domain. Sometimes this step times out. If that happens, just run 'vagrant reload win10 --provision'" #debug
|
||||||
Add-Computer -DomainName "windomain.local" -credential $DomainCred -OUPath "ou=Workstations,dc=windomain,dc=local"
|
Add-Computer -DomainName "windomain.local" -credential $DomainCred -OUPath "ou=Workstations,dc=windomain,dc=local"
|
||||||
|
|||||||
Reference in New Issue
Block a user