From ee9a1f87fdc88559f325e31fd13044a29b8977d5 Mon Sep 17 00:00:00 2001 From: Chris Long Date: Tue, 3 Dec 2019 00:42:02 -0800 Subject: [PATCH 1/6] Removing Splunk forwarder from Windows hosts --- Vagrant/Vagrantfile | 5 -- Vagrant/bootstrap.sh | 14 ++++ Vagrant/resources/logger/20-detectionlab | 71 +++++++++++++++++++ .../resources/splunk_forwarder/inputs.conf | 29 -------- .../splunk_forwarder/wef_inputs.conf | 4 +- Vagrant/scripts/install-osquery.ps1 | 8 +-- ci/build_machine_bootstrap.sh | 4 +- ci/manual_machine_bootstrap.sh | 4 +- ci/manual_machine_bootstrap_vmware.sh | 10 +-- 9 files changed, 98 insertions(+), 51 deletions(-) create mode 100644 Vagrant/resources/logger/20-detectionlab delete mode 100755 Vagrant/resources/splunk_forwarder/inputs.conf diff --git a/Vagrant/Vagrantfile b/Vagrant/Vagrantfile index f6a0fb1..4688a1a 100644 --- a/Vagrant/Vagrantfile +++ b/Vagrant/Vagrantfile @@ -43,8 +43,6 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/provision.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/download_palantir_wef.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/download_palantir_osquery.ps1", privileged: false - cfg.vm.provision "shell", path: "scripts/install-splunkuf.ps1", privileged: false - cfg.vm.provision "shell", path: "scripts/install-inputsconf.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-utilities.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-redteam.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-choco-extras.ps1", privileged: false @@ -101,7 +99,6 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/install-wefsubscriptions.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-splunkuf.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-windows_ta.ps1", privileged: false - cfg.vm.provision "shell", path: "scripts/install-inputsconf.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-utilities.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-redteam.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-choco-extras.ps1", privileged: false @@ -151,12 +148,10 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/download_palantir_wef.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/download_palantir_osquery.ps1", privileged: false cfg.vm.provision "shell", inline: 'wevtutil el | Select-String -notmatch "Microsoft-Windows-LiveId" | Foreach-Object {wevtutil cl "$_"}', privileged: false - cfg.vm.provision "shell", path: "scripts/install-splunkuf.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-utilities.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-redteam.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-choco-extras.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-osquery.ps1", privileged: false - cfg.vm.provision "shell", path: "scripts/install-inputsconf.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-sysinternals.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false diff --git a/Vagrant/bootstrap.sh b/Vagrant/bootstrap.sh index b6f2a3e..a26116d 100644 --- a/Vagrant/bootstrap.sh +++ b/Vagrant/bootstrap.sh @@ -6,6 +6,7 @@ echo "apt-fast apt-fast/dlflag boolean true" | debconf-set-selections; sed -i "2ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted universe multiverse\ndeb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted universe multiverse\ndeb mirror://mirrors.ubuntu.com/mirrors.txt xenial-backports main restricted universe multiverse\ndeb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted universe multiverse" /etc/apt/sources.list apt_install_prerequisites() { + echo "[$(date +%H:%M:%S)]: Adding apt repositories..." # Add repository for apt-fast add-apt-repository -y ppa:apt-fast/stable # Add repository for yq @@ -22,6 +23,18 @@ apt_install_prerequisites() { apt-fast -qq install -y jq whois build-essential git docker docker-compose unzip htop yq } +modify_motd() { + echo "[$(date +%H:%M:%S)]: Updating the MOTD..." + # Force color terminal + sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/g' /root/.bashrc + sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/g' /home/vagrant/.bashrc + # Remove some stock Ubuntu MOTD content + chmod -x /etc/update-motd.d/10-help-text + # Copy the DetectionLab MOTD + cp /vagrant/resources/logger/20-detectionlab /etc/update-motd.d/ + chmod +x /etc/update-motd.d/20-detectionlab +} + test_prerequisites() { for package in jq whois build-essential git docker docker-compose unzip yq do @@ -453,6 +466,7 @@ postinstall_tasks() { main() { apt_install_prerequisites + modify_motd test_prerequisites fix_eth1_static_ip install_splunk diff --git a/Vagrant/resources/logger/20-detectionlab b/Vagrant/resources/logger/20-detectionlab new file mode 100644 index 0000000..dda4277 --- /dev/null +++ b/Vagrant/resources/logger/20-detectionlab @@ -0,0 +1,71 @@ +#! /bin/sh + +txtred='\033[1;31m' +txtcyan='\033[1;36m' +txtblue='\033[1;34m' +txtwhite='\033[1;37m' +reset='\033[1;0m' + +cat << EOM +$(echo "${txtwhite} +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtcyan}(${txtwhite}@@@@${txtcyan}(&${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#${txtcyan}((((${txtwhite}@@@@${txtcyan}(((((${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtcyan}((((((((${txtwhite}@@@@${txtcyan}((((((((&${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%${txtcyan}(((((((((((${txtwhite}@@@@${txtcyan}(((((((((((${txtwhite}#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#${txtcyan}((((((((((((${txtwhite}@@@@@@@@#${txtcyan}((((((((((((&${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtcyan}&((((((((((((${txtwhite}#@@@@@@@@@@@@@@${txtcyan}&((((((((((((%${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtcyan}(((((((((((((${txtwhite}@@@@@@@@@@@@@@@@@@@@@@#${txtcyan}((((((((((((&${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtcyan}((((((((%${txtwhite}@@@@@@@@@@${txtred}&%#((#%&${txtwhite}@@@@@@@@@@${txtcyan}&((((((((&${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtcyan}((${txtwhite}@@@@@@@@@${txtred}&(((((#%&&%#(((((${txtwhite}#@@@@@@@@@#${txtcyan}(${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}(${txtwhite}@@@@@@@@@@@@@@@@@@@${txtred}(((&${txtwhite}@@@@@@@@@@@@@@@${txtred}(((&${txtwhite}@@@@@@@@@@@@@@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,&${txtwhite}@@@@@@@@@@@@@${txtred}((&${txtwhite}@@@@#${txtred}(((((((((((${txtwhite}@@@@@${txtred}((%${txtwhite}@@@@@@@@@@@@@${txtblue}*,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,,,,%${txtwhite}@@@@@@@@@@@@@@${txtred}&(((((((((((((((((${txtwhite}@@@@@@@@@@@@@@${txtblue}&,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,,,,,,&${txtwhite}@@@@@@@@@@@@@#${txtred}(((((((((((((((&${txtwhite}@@@@@@@@@@@@@${txtblue},,,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,,,,,,${txtwhite}&@${txtblue},,*${txtwhite}@@@@@@@@@@@@${txtred}((((((((((&${txtwhite}@@@@@@@@@@@%${txtblue},,${txtwhite}@@${txtblue},,,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&${txtblue},,,,,,${txtwhite}&@${txtblue},,,,,${txtwhite}*@@@@@@@@@@@@${txtred}((((&${txtwhite}@@@@@@@@@@@/${txtblue},,,,,${txtwhite}@@${txtblue},,,,,,%${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,${txtwhite}&@@/${txtblue},,${txtwhite}&@${txtblue},,,,,,,,${txtwhite}%@@@@@@@@@@@@@@@@@@@@@@&${txtblue},,,,,,,,${txtwhite}@@${txtblue},,*${txtwhite}@@@${txtblue},,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,,,${txtwhite}&@@@@${txtblue},,,,,,,,${txtwhite}%@${txtblue},,${txtwhite}(@@@@@@@@@@@@@@%${txtblue},,${txtwhite}@&${txtblue},,,,,,,,${txtwhite}@@@@@*${txtblue},,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,,,,,,${txtwhite}&@@${txtblue}%,,,,,,${txtwhite}%@${txtblue},,,,,/${txtwhite}@@@@@@@@${txtblue}(,,,,,${txtwhite}@&${txtblue},,,,,,/${txtwhite}@@@${txtblue},,,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,,,,,,${txtwhite}&@,/@@&${txtblue},,,${txtwhite}%@${txtblue},,,,,,,,${txtwhite}@@@@${txtblue},,,,,,,,${txtwhite}@&${txtblue},,,${txtwhite}#@@%,${txtwhite}@@${txtblue},,,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#${txtblue},,,,,,${txtwhite}&@${txtblue},,,,,${txtwhite}&@@&@${txtblue},,,,,,,,${txtwhite}@@@@${txtblue},,,,,,,,${txtwhite}@@@@@*${txtblue},,,,${txtwhite}@@${txtblue},,,,,,(${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,${txtwhite}(@@&${txtblue},,,${txtwhite}&@${txtblue},,,,,,,,${txtwhite}&@@#${txtblue},,,,,,${txtwhite}@@@@${txtblue},,,,,,/${txtwhite}@@@${txtblue},,,,,,,,${txtwhite}@@${txtblue},,,(${txtwhite}@@#${txtblue},,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}*,,,,${txtwhite}*@@&&@${txtblue},,,,,,,,${txtwhite}%@${txtblue},(${txtwhite}@@%${txtblue},,,${txtwhite}@@@@${txtblue},,,(${txtwhite}@@&${txtblue},${txtwhite}@&${txtblue},,,,,,,,${txtwhite}@@%@@#${txtblue},,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}*,,,,,,,*${txtwhite}@@@${txtblue}*,,,,,,${txtwhite}%@${txtblue},,,,(${txtwhite}@@&@@@@%@@#${txtblue},,,,${txtwhite}@&${txtblue},,,,,,,${txtwhite}@@@${txtblue}/,,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}*,,,,,,,,${txtwhite}&@,&@@${txtblue}/,,,${txtwhite}%@${txtblue},,,,,,,${txtwhite}*@@@@${txtblue}/,,,,,,,${txtwhite}@&${txtblue},,,*${txtwhite}@@@${txtblue},${txtwhite}@@${txtblue},,,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}#,,,,,,,${txtwhite}&@${txtblue},,,,${txtwhite}(@@&%@${txtblue},,,,,,,,${txtwhite}&@@@${txtblue},,,,,,,,${txtwhite}@&#@@%${txtblue},,,,${txtwhite}@@${txtblue},,,,,,,/${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}&,,,,${txtwhite}&@${txtblue},,,,,,,*${txtwhite}@@@${txtblue}*,,,,,,${txtwhite}&@@@${txtblue},,,,,,,${txtwhite}%@@(${txtblue},,,,,,,${txtwhite}@@${txtblue},,,,(${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}&,${txtwhite}&@${txtblue},,,,,,,,%${txtwhite}@,@@@*${txtblue},,,${txtwhite}&@@@${txtblue},,,,${txtwhite}&@@/@&${txtblue},,,,,,,,${txtwhite}@@${txtblue},${txtwhite}%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}*,,,,,,,${txtwhite}%@${txtblue},,,,${txtwhite}&@@/&@@@*@@@*${txtblue},,,${txtwhite}@&${txtblue},,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}%,,,,${txtwhite}#@${txtblue},,,,,,,${txtwhite}/@@@@#${txtblue},,,,,,,${txtwhite}@&${txtblue},,,,/${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue}%,${txtwhite}#@${txtblue},,,,,,,,${txtwhite}&@@@${txtblue},,,,,,,,${txtwhite}@&${txtblue}${txtwhite},#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,,,,,${txtwhite}&@@@${txtblue},,,,,,,,${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${txtblue},,,,,${txtwhite}&@@@${txtblue},,,,,&${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#,&@@@,(${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@${txtblue}&&&&&${txtwhite}@@@@@@@${txtblue}&&&&&&&&&${txtwhite}@${txtblue}&&&&&&&&&${txtwhite}@@${txtblue}&&&&&&&&${txtwhite}@@@@@@${txtblue}&((%${txtwhite}@@@@${txtblue}&&&&&&&&&${txtwhite}@@${txtblue}&${txtwhite}@@@@@@@${txtblue}#(#&${txtwhite}@@@@@@${txtblue}&${txtwhite}@@@@@@@@${txtblue}&${txtwhite}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@${txtblue},&${txtwhite}@@@@${txtblue}/,/${txtwhite}@@@${txtblue}(,${txtwhite}@@@@@@@@@@@@${txtblue},%${txtwhite}@@@@@${txtblue},(${txtwhite}@@@@@@@@@${txtblue}(,/${txtwhite}@@@@${txtblue}(,(${txtwhite}@@@@${txtblue}%,${txtwhite}@@@@@${txtblue}&,${txtwhite}@@@@${txtblue},,&${txtwhite}@@@@${txtblue},,${txtwhite}@@@@${txtblue},,*${txtwhite}@@@@@${txtblue}#,${txtwhite}@@@${txtcyan}((${txtwhite}@@@@@@@@@@@${txtcyan}(((%${txtwhite}@@@@@${txtcyan}((%%%%${txtcyan}(((${txtwhite}@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@${txtblue},&${txtwhite}@@@@@@${txtblue}/,${txtwhite}@@${txtblue}(,${txtwhite}@@@@@@@@@@@@${txtblue},%${txtwhite}@@@@@${txtblue},(${txtwhite}@@@@@@@@${txtblue}*,${txtwhite}@@@@@@@@@@@@@${txtblue}%,${txtwhite}@@@@@${txtblue}&,${txtwhite}@@@${txtblue},#${txtwhite}@@@@@@@${txtblue}&,%${txtwhite}@@${txtblue},&*,${txtwhite}@@@@${txtblue}#,${txtwhite}@@@${txtcyan}((${txtwhite}@@@@@@@@@@${txtcyan}((${txtwhite}@${txtcyan}((&${txtwhite}@@@@${txtcyan}(#${txtwhite}@@@@@${txtcyan}((${txtwhite}@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@${txtblue},&${txtwhite}@@@@@@@${txtblue},#${txtwhite}@${txtblue}(,,,,,,,(${txtwhite}@@@@@${txtblue},%${txtwhite}@@@@@${txtblue},,,,,,,,${txtwhite}@@${txtblue},%${txtwhite}@@@@@@@@@@@@@${txtblue}%,${txtwhite}@@@@@${txtblue}&,${txtwhite}@@${txtblue}(,${txtwhite}@@@@@@@@@${txtblue}*,${txtwhite}@@${txtblue},&${txtwhite}@${txtblue}&,/${txtwhite}@@${txtblue}#,${txtwhite}@@@${txtcyan}((${txtwhite}@@@@@@@@@${txtcyan}((${txtwhite}@@@${txtcyan}((${txtwhite}@@@@${txtcyan}((((((((${txtwhite}@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@${txtblue},&${txtwhite}@@@@@@${txtblue}%,&${txtwhite}@${txtblue}(,${txtwhite}@@@@@@@@@@@@${txtblue},%${txtwhite}@@@@@${txtblue},(${txtwhite}@@@@@@@@${txtblue},/${txtwhite}@@@@@@@@@@@@@${txtblue}%,${txtwhite}@@@@@${txtblue}&,${txtwhite}@@${txtblue}%,${txtwhite}@@@@@@@@@${txtblue},/${txtwhite}@@${txtblue},&${txtwhite}@@@${txtblue}/,&#,${txtwhite}@@@${txtcyan}((${txtwhite}@@@@@@@@${txtcyan}#(#${txtwite}&&&&${txtcyan}((${txtwhite}@@@${txtcyan}(#${txtwhite}@@@@@${txtcyan}((${txtwhite}@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@${txtblue},&${txtwhite}@@@@@${txtblue}(,%${txtwhite}@@${txtblue}(,${txtwhite}@@@@@@@@@@@@${txtblue},%${txtwhite}@@@@@${txtblue},(${txtwhite}@@@@@@@@@${txtblue},*${txtwhite}@@@@@@${txtblue}/%${txtwhite}@@@@${txtblue}%,${txtwhite}@@@@@${txtblue}&,${txtwhite}@@@${txtblue}/,&${txtwhite}@@@@@@${txtblue},*${txtwhite}@@@${txtblue},&${txtwhite}@@@@@${txtblue},*,${txtwhite}@@@${txtcyan}((${txtwhite}@@@@@@@${txtcyan}%((${txtwhite}&&&&&${txtcyan}%((${txtwhite}@@${txtcyan}(#${txtwhite}@@@@@${txtcyan}((${txtwhite}@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@${txtblue},,,,,,*${txtwhite}@@@@@${txtblue}(,,,,,,,*${txtwhite}@@@@@${txtblue},%${txtwhite}@@@@@${txtblue},,,,,,,,${txtwhite}@@@@@${txtblue}*,,,,,&${txtwhite}@@@@@${txtblue}%,${txtwhite}@@@@@${txtblue}&,${txtwhite}@@@@@${txtblue}(,,,,,/${txtwhite}@@@@@${txtblue},&${txtwhite}@@@@@@${txtblue},,${txtwhite}@@@${txtcyan}((((((((${txtwhite}&${txtcyan}((${txtwhite}@@@@@@@${txtcyan}%((${txtwhite}@${txtblue}((((((((${txtwhite}@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +${reset}") +EOM \ No newline at end of file diff --git a/Vagrant/resources/splunk_forwarder/inputs.conf b/Vagrant/resources/splunk_forwarder/inputs.conf deleted file mode 100755 index cf1d39f..0000000 --- a/Vagrant/resources/splunk_forwarder/inputs.conf +++ /dev/null @@ -1,29 +0,0 @@ -[WinEventLog://Microsoft-Windows-Sysmon/Operational] -index = sysmon -disabled = false -renderXml = true - -[monitor://c:\Program Files\osquery\log\osqueryd.results.log] -index = osquery -disabled = false -sourcetype = osquery:json - -[monitor://c:\Program Files\osquery\log\osqueryd.snapshots.log] -index = osquery -disabled = false -sourcetype = osquery:json - -[monitor://c:\Program Files\osquery\log\osqueryd.INFO.*] -index = osquery-status -disabled = false -sourcetype = osquery-info:syslog - -[monitor://c:\Program Files\osquery\log\osqueryd.WARNING.*] -index = osquery-status -disabled = false -sourcetype = osquery-warn:syslog - -[monitor://c:\Program Files\osquery\log\osqueryd.ERROR.*] -index = osquery-status -disabled = false -sourcetype = osquery-error:syslog diff --git a/Vagrant/resources/splunk_forwarder/wef_inputs.conf b/Vagrant/resources/splunk_forwarder/wef_inputs.conf index 02e48bc..02018be 100755 --- a/Vagrant/resources/splunk_forwarder/wef_inputs.conf +++ b/Vagrant/resources/splunk_forwarder/wef_inputs.conf @@ -322,9 +322,9 @@ current_only = 0 checkpointInterval = 5 [WinEventLog://WEC6-Sysmon] -sourcetype = WinEventLog:Sysmon +sourcetype = "XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" source = WinEventLog:Sysmon -index=wineventlog +index=sysmon disabled = 0 start_from = oldest current_only = 0 diff --git a/Vagrant/scripts/install-osquery.ps1 b/Vagrant/scripts/install-osquery.ps1 index b46e1ee..e5ffec3 100755 --- a/Vagrant/scripts/install-osquery.ps1 +++ b/Vagrant/scripts/install-osquery.ps1 @@ -14,11 +14,7 @@ If (-not ($service)) { Copy-Item "c:\Users\vagrant\AppData\Local\Temp\osquery-configuration-master\Classic\Endpoints\Windows\*" "c:\Program Files\osquery" Copy-Item "c:\Users\vagrant\AppData\Local\Temp\osquery-configuration-master\Classic\Endpoints\packs" -Path "c:\Program Files\osquery" - ## Use the TLS config by default. Un-comment the line below to use the local configuration and avoid connecting to Fleet. - # Copy-Item "c:\Program Files\osquery\osquery_no_tls.flags" -Path "c:\Program Files\osquery\osquery.flags" -Force - - ### --- TLS CONFIG BEGINS --- - ### COMMENT ALL LINES BELOW UNTIL "TLS CONFIG ENDS" if using local configuration + ## Use the TLS config ## Add entry to hosts file for Kolide for SSL validation Add-Content "c:\windows\system32\drivers\etc\hosts" " 192.168.38.105 kolide" ## Add kolide secret and avoid BOM @@ -32,7 +28,7 @@ If (-not ($service)) { (Get-Content "c:\Program Files\osquery\osquery.flags") -replace 'c:\\ProgramData\\osquery\\certfile.crt', 'c:\Program Files\osquery\certfile.crt' | Set-Content "c:\Program Files\osquery\osquery.flags" ## Add certfile.crt Copy-Item "c:\vagrant\resources\fleet\server.crt" "c:\Program Files\osquery\certfile.crt" - ### --- TLS CONFIG ENDS --- + ## Start the service Start-Service osqueryd } else { diff --git a/ci/build_machine_bootstrap.sh b/ci/build_machine_bootstrap.sh index 8b33a47..d8c3a52 100755 --- a/ci/build_machine_bootstrap.sh +++ b/ci/build_machine_bootstrap.sh @@ -75,8 +75,8 @@ ufw --force enable echo "[$(date +%H:%M:%S)]: Installing Vagrant..." mkdir /opt/vagrant cd /opt/vagrant || exit 1 -wget --progress=bar:force https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb -dpkg -i vagrant_2.2.5_x86_64.deb +wget --progress=bar:force https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.deb +dpkg -i vagrant_2.2.6_x86_64.deb echo "[$(date +%H:%M:%S)]: Installing vagrant-reload plugin..." vagrant plugin install vagrant-reload diff --git a/ci/manual_machine_bootstrap.sh b/ci/manual_machine_bootstrap.sh index 8d4d8c6..2e00ac9 100644 --- a/ci/manual_machine_bootstrap.sh +++ b/ci/manual_machine_bootstrap.sh @@ -22,8 +22,8 @@ git clone https://github.com/clong/DetectionLab.git /opt/DetectionLab # Install Vagrant mkdir /opt/vagrant cd /opt/vagrant || exit 1 -wget https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb -dpkg -i vagrant_2.2.5_x86_64.deb +wget https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.deb +dpkg -i vagrant_2.2.6_x86_64.deb # Disable IPv6 - may help with the vagrant-reload plugin: https://github.com/hashicorp/vagrant/issues/8795#issuecomment-468945063 echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf diff --git a/ci/manual_machine_bootstrap_vmware.sh b/ci/manual_machine_bootstrap_vmware.sh index 2ba70be..7e188ea 100644 --- a/ci/manual_machine_bootstrap_vmware.sh +++ b/ci/manual_machine_bootstrap_vmware.sh @@ -14,9 +14,9 @@ apt-get install -y linux-headers-"$(uname -r)" build-essential unzip git ufw apa pip install awscli --upgrade --user cp /root/.local/bin/aws /usr/local/bin/aws && chmod +x /usr/local/bin/aws -wget -O VMware-Workstation-Full-15.0.4-12990004.x86_64.bundle "https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-15.0.4-12990004.x86_64.bundle?HashKey=6f83753e4d9e94da7f920c32b5808033¶ms=%7B%22custnumber%22%3A%22KipkcHRoJWVlZA%3D%3D%22%2C%22sourcefilesize%22%3A%22472.70+MB%22%2C%22dlgcode%22%3A%22WKST-1504-LX%22%2C%22languagecode%22%3A%22en%22%2C%22source%22%3A%22DOWNLOADS%22%2C%22downloadtype%22%3A%22manual%22%2C%22eula%22%3A%22Y%22%2C%22downloaduuid%22%3A%225caee685-d5ad-4f6b-94db-2ddc4f7f3a97%22%2C%22purchased%22%3A%22N%22%2C%22dlgtype%22%3A%22Product+Binaries%22%2C%22productversion%22%3A%2215.0.4%22%2C%22productfamily%22%3A%22VMware+Workstation+Pro%22%7D&AuthKey=1556427011_a994b5252f29429710c077c8dcab1c19" -chmod +x VMware-Workstation-Full-15.0.4-12990004.x86_64.bundle -sudo sh VMware-Workstation-Full-15.0.4-12990004.x86_64.bundle --console --required --eulas-agreed --set-setting vmware-workstation serialNumber $SERIALNUMBER +wget -O VMware-Workstation-Full-15.5.1-15018445.x86_64.bundle "https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-15.5.1-15018445.x86_64.bundle" +chmod +x VMware-Workstation-Full-15.5.1-15018445.x86_64.bundle +sudo sh VMware-Workstation-Full-15.5.1-15018445.x86_64.bundle --console --required --eulas-agreed --set-setting vmware-workstation serialNumber $SERIALNUMBER # Set up firewall ufw allow ssh @@ -28,8 +28,8 @@ git clone https://github.com/clong/DetectionLab.git /opt/DetectionLab # Install Vagrant mkdir /opt/vagrant cd /opt/vagrant || exit 1 -wget --progress=bar:force https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb -dpkg -i vagrant_2.2.5_x86_64.deb +wget --progress=bar:force https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.deb +dpkg -i vagrant_2.2.6_x86_64.deb # Disable IPv6 - may help with the vagrant-reload plugin: https://github.com/hashicorp/vagrant/issues/8795#issuecomment-468945063 echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf sysctl -p /etc/sysctl.conf > /dev/null From f3fa80299f9e03fd6c4d08b99bdda71634364704 Mon Sep 17 00:00:00 2001 From: Chris Long Date: Tue, 3 Dec 2019 19:53:59 -0800 Subject: [PATCH 2/6] Adding rearm to each Windows host --- Terraform/main.tf | 6 +++++- Vagrant/Vagrantfile | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Terraform/main.tf b/Terraform/main.tf index a7361df..243c091 100644 --- a/Terraform/main.tf +++ b/Terraform/main.tf @@ -236,7 +236,11 @@ resource "aws_instance" "wef" { instance_type = "t2.medium" provisioner "remote-exec" { - inline = ["choco install -force -y winpcap"] + inline = [ + "choco install -force -y winpcap", + "cscript c:\\windows\\system32\\slmgr.vbs -rearm", + "shutdown -r", + ] connection { type = "winrm" diff --git a/Vagrant/Vagrantfile b/Vagrant/Vagrantfile index 4688a1a..0a55609 100644 --- a/Vagrant/Vagrantfile +++ b/Vagrant/Vagrantfile @@ -57,6 +57,7 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false cfg.vm.provision "shell", inline: 'wevtutil el | Select-String -notmatch "Microsoft-Windows-LiveId" | Foreach-Object {wevtutil cl "$_"}', privileged: false cfg.vm.provision "shell", inline: "Set-SmbServerConfiguration -AuditSmb1Access $true -Force", privileged: false + cfg.vm.provision "shell", inline: "cscript c:\\windows\\system32\\slmgr.vbs -rearm", privileged: false cfg.vm.provider "vmware_desktop" do |v, override| v.vmx["displayname"] = "dc.windomain.local" @@ -108,6 +109,7 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false cfg.vm.provision "shell", inline: "Set-SmbServerConfiguration -AuditSmb1Access $true -Force", privileged: false cfg.vm.provision "shell", path: "scripts/install-microsoft-ata.ps1", privileged: false + cfg.vm.provision "shell", inline: "cscript c:\\windows\\system32\\slmgr.vbs -rearm", privileged: false cfg.vm.provider "vmware_desktop" do |v, override| v.vmx["displayname"] = "wef.windomain.local" @@ -154,6 +156,7 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/install-osquery.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-sysinternals.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false + cfg.vm.provision "shell", inline: "cscript c:\\windows\\system32\\slmgr.vbs -rearm", privileged: false cfg.vm.provider "vmware_desktop" do |v, override| v.vmx["displayname"] = "win10.windomain.local" From 249ce2ec76d73a3cab17be4d43198b4d91222dcb Mon Sep 17 00:00:00 2001 From: Chris Long Date: Tue, 3 Dec 2019 22:18:20 -0800 Subject: [PATCH 3/6] Updating channel permissions for Microsoft-Windows-Sysmon --- Vagrant/Vagrantfile | 5 ++--- .../Custom Event Channel Permissions.htm | Bin 150094 -> 152480 bytes .../Default Domain Controllers Policy.htm | Bin 144954 -> 144954 bytes .../Backup.xml | 18 ++++++++++++++++++ .../Machine/Preferences/Registry/Registry.xml | 1 + .../bkupInfo.xml | 1 + .../gpreport.xml | Bin 24866 -> 26270 bytes .../Backup.xml | 18 ------------------ .../bkupInfo.xml | 1 - 9 files changed, 22 insertions(+), 22 deletions(-) mode change 100644 => 100755 Vagrant/resources/GPO/reports/Custom Event Channel Permissions.htm mode change 100644 => 100755 Vagrant/resources/GPO/reports/Default Domain Controllers Policy.htm create mode 100755 Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/Backup.xml rename Vagrant/resources/GPO/wef_configuration/{{AE232F63-0190-47EE-BAF9-B78754178376} => {1C916D7C-52F4-4EB4-8EA7-081349532B3C}}/DomainSysvol/GPO/Machine/Preferences/Registry/Registry.xml (84%) mode change 100644 => 100755 create mode 100755 Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/bkupInfo.xml rename Vagrant/resources/GPO/wef_configuration/{{AE232F63-0190-47EE-BAF9-B78754178376} => {1C916D7C-52F4-4EB4-8EA7-081349532B3C}}/gpreport.xml (84%) mode change 100644 => 100755 delete mode 100644 Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/Backup.xml delete mode 100644 Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/bkupInfo.xml diff --git a/Vagrant/Vagrantfile b/Vagrant/Vagrantfile index 0a55609..f9c1bdb 100644 --- a/Vagrant/Vagrantfile +++ b/Vagrant/Vagrantfile @@ -57,7 +57,6 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false cfg.vm.provision "shell", inline: 'wevtutil el | Select-String -notmatch "Microsoft-Windows-LiveId" | Foreach-Object {wevtutil cl "$_"}', privileged: false cfg.vm.provision "shell", inline: "Set-SmbServerConfiguration -AuditSmb1Access $true -Force", privileged: false - cfg.vm.provision "shell", inline: "cscript c:\\windows\\system32\\slmgr.vbs -rearm", privileged: false cfg.vm.provider "vmware_desktop" do |v, override| v.vmx["displayname"] = "dc.windomain.local" @@ -92,6 +91,7 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/fix-second-network.ps1", privileged: false, args: "-ip 192.168.38.103 -dns 192.168.38.102" cfg.vm.provision "shell", path: "scripts/provision.ps1", privileged: false + cfg.vm.provision "shell", inline: "cscript c:\\windows\\system32\\slmgr.vbs -rearm", privileged: false cfg.vm.provision "reload" cfg.vm.provision "shell", path: "scripts/provision.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/download_palantir_wef.ps1", privileged: false @@ -109,7 +109,6 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false cfg.vm.provision "shell", inline: "Set-SmbServerConfiguration -AuditSmb1Access $true -Force", privileged: false cfg.vm.provision "shell", path: "scripts/install-microsoft-ata.ps1", privileged: false - cfg.vm.provision "shell", inline: "cscript c:\\windows\\system32\\slmgr.vbs -rearm", privileged: false cfg.vm.provider "vmware_desktop" do |v, override| v.vmx["displayname"] = "wef.windomain.local" @@ -145,6 +144,7 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/fix-second-network.ps1", privileged: false, args: "-ip 192.168.38.104 -dns 192.168.38.102" cfg.vm.provision "shell", path: "scripts/MakeWindows10GreatAgain.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/provision.ps1", privileged: false + cfg.vm.provision "shell", inline: "cscript c:\\windows\\system32\\slmgr.vbs -rearm", privileged: false cfg.vm.provision "reload" cfg.vm.provision "shell", path: "scripts/provision.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/download_palantir_wef.ps1", privileged: false @@ -156,7 +156,6 @@ Vagrant.configure("2") do |config| cfg.vm.provision "shell", path: "scripts/install-osquery.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-sysinternals.ps1", privileged: false cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false - cfg.vm.provision "shell", inline: "cscript c:\\windows\\system32\\slmgr.vbs -rearm", privileged: false cfg.vm.provider "vmware_desktop" do |v, override| v.vmx["displayname"] = "win10.windomain.local" diff --git a/Vagrant/resources/GPO/reports/Custom Event Channel Permissions.htm b/Vagrant/resources/GPO/reports/Custom Event Channel Permissions.htm old mode 100644 new mode 100755 index 7db032b3234366d3898c22404e87de41cb7b63d0..a192d95788c84e32f0c043247ab7b2d2718079e3 GIT binary patch delta 357 zcmX>%g>%7j&W0_FeP0y~8H^b88BBoKh{1rtkin8cfx(o)ioqDjwgO_a?d!iX{$x?d zrp^Sc&KO7I7z1|1;VeEQAbjKR~7{b5w|GzMB@26Un^(1}Js6}mvSDT5o3uM6~o8-o+jA-X`) z87Sun7K3=n5XiRxsx=4dHUjFXML2VN*ogB0z3CqmnPjG)VP{g9_McH= Qy21}emhJOAm^Ls106>dR^8f$< delta 311 zcmZ3mob%ii&W0_FeP0#L8T1*97$BqpgCUTmz+k~(#b5vw1(Vy?e`Wm1q7G4E23C!% z&WOPTsLqJN45%-F!FT#X9wznaAAT}QO&9phs6?8!hTn{jrl0uDm@@s?A4WA#GX^&X zQwB$%lgxq6v0%^z(iT8y24tB4<=hxtfh;EmV<2_|vW$RyOQ0HoadXP}pA5sunk z_LotHdHR~4j6&0A0g0(6n8K!?`pGCUJ%*7OY7ytkO diff --git a/Vagrant/resources/GPO/reports/Default Domain Controllers Policy.htm b/Vagrant/resources/GPO/reports/Default Domain Controllers Policy.htm old mode 100644 new mode 100755 index e50193da1a1ea7efb94b9c9fc614bb715dd7a1b5..deb6612b2d3e8f2a511f1c546a04f4e3d435bd59 GIT binary patch delta 165 zcmdn>hGW+oj)pCalfEh%G8i%FGnfFe5rYAPA%i7@0)r`o6%d<)Nt5lHzcRA2s$)}U w0#pIg1tN`r`WzX2ryt~GQlCEIH>1>ah2M-yBx&0Y)V7R~(QUi=Uq)t20KH=%$^ZZW delta 165 zcmdn>hGW+oj)pCalfEjNGw3rIF+fNI216iAfx&{oiopOVYQ + 01 00 04 9c 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 04 00 ec 00 08 00 00 00 05 02 28 00 00 01 00 00 01 00 00 00 8f fd ac ed b3 ff d1 11 b4 1d 00 a0 c9 68 f9 39 01 01 00 00 00 00 00 05 0b 00 00 00 00 00 24 00 ff 00 0f 00 01 05 00 00 00 00 00 05 15 00 00 00 bd d8 5d 55 72 8b b8 b4 bb d9 f7 34 e8 03 00 00 00 02 24 00 ff 00 0f 00 01 05 00 00 00 00 00 05 15 00 00 00 bd d8 5d 55 72 8b b8 b4 bb d9 f7 34 00 02 00 00 00 02 24 00 ff 00 0f 00 01 05 00 00 00 00 00 05 15 00 00 00 bd d8 5d 55 72 8b b8 b4 bb d9 f7 34 07 02 00 00 00 02 14 00 94 00 02 00 01 01 00 00 00 00 00 05 09 00 00 00 00 02 14 00 94 00 02 00 01 01 00 00 00 00 00 05 0b 00 00 00 00 02 14 00 ff 00 0f 00 01 01 00 00 00 00 00 05 12 00 00 00 00 0a 14 00 ff 00 0f 00 01 01 00 00 00 00 00 03 00 00 00 00 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/DomainSysvol/GPO/Machine/Preferences/Registry/Registry.xml b/Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/DomainSysvol/GPO/Machine/Preferences/Registry/Registry.xml old mode 100644 new mode 100755 similarity index 84% rename from Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/DomainSysvol/GPO/Machine/Preferences/Registry/Registry.xml rename to Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/DomainSysvol/GPO/Machine/Preferences/Registry/Registry.xml index ad42d31..6430a1f --- a/Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/DomainSysvol/GPO/Machine/Preferences/Registry/Registry.xml +++ b/Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/DomainSysvol/GPO/Machine/Preferences/Registry/Registry.xml @@ -2,6 +2,7 @@ + diff --git a/Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/bkupInfo.xml b/Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/bkupInfo.xml new file mode 100755 index 0000000..7e8fa51 --- /dev/null +++ b/Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/bkupInfo.xml @@ -0,0 +1 @@ + diff --git a/Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/gpreport.xml b/Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/gpreport.xml old mode 100644 new mode 100755 similarity index 84% rename from Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/gpreport.xml rename to Vagrant/resources/GPO/wef_configuration/{1C916D7C-52F4-4EB4-8EA7-081349532B3C}/gpreport.xml index 5012f4c3968b85f611f2f3cb8a9d62876abb64b3..6b424f9265a6f9695597b5077ed14abaa2bd4104 GIT binary patch delta 1076 zcmbtTK}%Fo6#nkaa~v{9Y-nL2NiKBrY~H+i<2)N>9LHd&q+tq~7#poN7A0y56*4;o zp+y~N*&BOg?+Png3) zo2eOGH+F=CE=G`&MXP-7D8ggR;~)aA{Itfs<1jukF0UOTGHdS1nJ?T#9v4KlCFOS8 zkBbg(cKL=h5$?Ya+VsfI6Q3i9rpzmY{GbRPEwQo^`yMKPqy2rDe7z9wwn7nnI@uAK z3{e4A!DcmBIr-JoE4u^hFR}^U>PkfQLC?KTePw7b7V3fB$!{^)KNXJT*}&)UB$vIN zb~P+^y-M4x-;slvm~M@pNJ^rx+C1EYee9P*eTwtw!wTkc7o+r_8rcN$Nt{)GonHvn@ z=jsl28rS$$`$liG&X1RN6+X8(FLARuEK5u{sP?Q2jL1PeZ&h(xRxr~3;0LW!mzTaJ L%t93wU - 01 00 04 9c 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 04 00 ec 00 08 00 00 00 05 02 28 00 00 01 00 00 01 00 00 00 8f fd ac ed b3 ff d1 11 b4 1d 00 a0 c9 68 f9 39 01 01 00 00 00 00 00 05 0b 00 00 00 00 00 24 00 ff 00 0f 00 01 05 00 00 00 00 00 05 15 00 00 00 c3 ba 37 ad 66 a9 3f 6a cb ef b8 9d e8 03 00 00 00 02 24 00 ff 00 0f 00 01 05 00 00 00 00 00 05 15 00 00 00 c3 ba 37 ad 66 a9 3f 6a cb ef b8 9d 00 02 00 00 00 02 24 00 ff 00 0f 00 01 05 00 00 00 00 00 05 15 00 00 00 c3 ba 37 ad 66 a9 3f 6a cb ef b8 9d 07 02 00 00 00 02 14 00 94 00 02 00 01 01 00 00 00 00 00 05 09 00 00 00 00 02 14 00 94 00 02 00 01 01 00 00 00 00 00 05 0b 00 00 00 00 02 14 00 ff 00 0f 00 01 01 00 00 00 00 00 05 12 00 00 00 00 0a 14 00 ff 00 0f 00 01 01 00 00 00 00 00 03 00 00 00 00 - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/bkupInfo.xml b/Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/bkupInfo.xml deleted file mode 100644 index efa3bbc..0000000 --- a/Vagrant/resources/GPO/wef_configuration/{AE232F63-0190-47EE-BAF9-B78754178376}/bkupInfo.xml +++ /dev/null @@ -1 +0,0 @@ - From f64ff20aaf476862bab694d311f392fbfdc364a3 Mon Sep 17 00:00:00 2001 From: Chris Long Date: Wed, 4 Dec 2019 11:27:35 -0800 Subject: [PATCH 4/6] Disabling default windows inputs. Adding powershell command for event channel perms --- Vagrant/scripts/install-splunkuf.ps1 | 2 +- Vagrant/scripts/install-sysinternals.ps1 | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Vagrant/scripts/install-splunkuf.ps1 b/Vagrant/scripts/install-splunkuf.ps1 index 242003d..0e76820 100755 --- a/Vagrant/scripts/install-splunkuf.ps1 +++ b/Vagrant/scripts/install-splunkuf.ps1 @@ -7,7 +7,7 @@ If (-not (Test-Path "C:\Program Files\SplunkUniversalForwarder\bin\splunk.exe")) Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Installing & Starting Splunk" [Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" (New-Object System.Net.WebClient).DownloadFile('https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=windows&version=7.1.0&product=universalforwarder&filename=splunkforwarder-7.1.0-2e75b3406c5b-x64-release.msi&wget=true', $msiFile) - Start-Process -FilePath "c:\windows\system32\msiexec.exe" -ArgumentList '/i', "$msiFile", 'RECEIVING_INDEXER="192.168.38.105:9997" WINEVENTLOG_SEC_ENABLE=1 WINEVENTLOG_SYS_ENABLE=1 WINEVENTLOG_APP_ENABLE=1 AGREETOLICENSE=Yes SERVICESTARTTYPE=1 LAUNCHSPLUNK=1 SPLUNKPASSWORD=changeme /quiet' -Wait + Start-Process -FilePath "c:\windows\system32\msiexec.exe" -ArgumentList '/i', "$msiFile", 'RECEIVING_INDEXER="192.168.38.105:9997" WINEVENTLOG_SEC_ENABLE=0 WINEVENTLOG_SYS_ENABLE=0 WINEVENTLOG_APP_ENABLE=0 AGREETOLICENSE=Yes SERVICESTARTTYPE=1 LAUNCHSPLUNK=1 SPLUNKPASSWORD=changeme /quiet' -Wait } Else { Write-Host "Splunk is already installed. Moving on." } diff --git a/Vagrant/scripts/install-sysinternals.ps1 b/Vagrant/scripts/install-sysinternals.ps1 index 0ffa5de..a761de1 100755 --- a/Vagrant/scripts/install-sysinternals.ps1 +++ b/Vagrant/scripts/install-sysinternals.ps1 @@ -58,3 +58,6 @@ If ((Get-Service -name Sysmon64).Status -ne "Running") { throw "The Sysmon service did not start successfully" } + +# Make the event log channel readable. For some reason this doesn't work in the GPO and only works when run manually. +wevtutil sl Microsoft-Windows-Sysmon/Operational "/ca:O:BAG:SYD:(A;;0x5;;;BA)(A;;0x1;;;S-1-5-20)(A;;0x1;;;S-1-5-32-573)" From 4a8485c28e2591474d6b16fa9f6771b8430e55c3 Mon Sep 17 00:00:00 2001 From: Chris Long Date: Wed, 4 Dec 2019 13:45:43 -0800 Subject: [PATCH 5/6] Disable IPv6 on Windows adapters --- Vagrant/scripts/provision.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Vagrant/scripts/provision.ps1 b/Vagrant/scripts/provision.ps1 index f5cb1c6..d1cd5a8 100644 --- a/Vagrant/scripts/provision.ps1 +++ b/Vagrant/scripts/provision.ps1 @@ -7,6 +7,9 @@ $box = $box.ComputerName.ToString().ToLower() Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting timezone to UTC..." c:\windows\system32\tzutil.exe /s "UTC" +Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Disable IPv6 on all network adatpers..." +Get-NetAdapterBinding -ComponentID ms_tcpip6 | ForEach-Object {Disable-NetAdapterBinding -Name $_.Name -ComponentID ms_tcpip6} + if ($env:COMPUTERNAME -imatch 'vagrant') { Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Hostname is still the original one, skip provisioning for reboot..." From 0393d627ad5d02089b283467c1a9c6be8370cf29 Mon Sep 17 00:00:00 2001 From: Chris Long Date: Wed, 4 Dec 2019 18:49:28 -0800 Subject: [PATCH 6/6] Convert ADSI:Exists to Get-ADOrganizationalUnit --- Vagrant/scripts/configure-ou.ps1 | 27 +++++++++++++-------------- Vagrant/scripts/provision.ps1 | 3 +++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Vagrant/scripts/configure-ou.ps1 b/Vagrant/scripts/configure-ou.ps1 index 8b8022d..10d6905 100644 --- a/Vagrant/scripts/configure-ou.ps1 +++ b/Vagrant/scripts/configure-ou.ps1 @@ -12,26 +12,25 @@ ping /n 1 dc.windomain.local ping /n 1 windomain.local Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Creating Server and Workstation OUs..." -Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Creating Servers OU..." - -if (!([ADSI]::Exists("LDAP://OU=Servers,DC=windomain,DC=local"))) -{ +# Create the Servers OU if it doesn't exist +Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Creating Server OU" +try { + Get-ADOrganizationalUnit -Identity 'OU=Servers,DC=windomain,DC=local' | Out-Null + Write-Host "Servers OU already exists. Moving On." +} +catch [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException] { New-ADOrganizationalUnit -Name "Servers" -Server "dc.windomain.local" } -else -{ - Write-Host "Servers OU already exists. Moving On." -} +# Create the Workstations OU if it doesn't exist Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Creating Workstations OU" -if (!([ADSI]::Exists("LDAP://OU=Workstations,DC=windomain,DC=local"))) -{ - New-ADOrganizationalUnit -Name "Workstations" -Server "dc.windomain.local" -} -else -{ +try { + Get-ADOrganizationalUnit -Identity 'OU=Workstations,DC=windomain,DC=local' | Out-Null Write-Host "Workstations OU already exists. Moving On." } +catch [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException] { + New-ADOrganizationalUnit -Name "Workstations" -Server "dc.windomain.local" +} # Sysprep breaks auto-login. Let's restore it here: Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoAdminLogon -Value 1 diff --git a/Vagrant/scripts/provision.ps1 b/Vagrant/scripts/provision.ps1 index d1cd5a8..69f9bdf 100644 --- a/Vagrant/scripts/provision.ps1 +++ b/Vagrant/scripts/provision.ps1 @@ -9,6 +9,9 @@ c:\windows\system32\tzutil.exe /s "UTC" Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Disable IPv6 on all network adatpers..." Get-NetAdapterBinding -ComponentID ms_tcpip6 | ForEach-Object {Disable-NetAdapterBinding -Name $_.Name -ComponentID ms_tcpip6} +Get-NetAdapterBinding -ComponentID ms_tcpip6 +# https://support.microsoft.com/en-gb/help/929852/guidance-for-configuring-ipv6-in-windows-for-advanced-users +reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v DisabledComponents /t REG_DWORD /d 255 /f if ($env:COMPUTERNAME -imatch 'vagrant') {