Compromising Splunk
This page will discuss how to build a test environment to practice compromising splunk
Building the test environment
function Install-Splunk {
[cmdletbinding()]
param(
[Parameter(HelpMessage = "Enter Splunk MSI URL, defaults to downloading 7.1.1")]
[string]$SplunkUrl,
[Parameter(HelpMessage = "Enter splunk password: Defaults to changeme")]
[string]$SplunkPassword
)
if ($SplunkUrl) {
$SplunkMSI = Split-Path $SplunkUrl -Leaf
$SplunkPath = "C:\Windows\Temp\$SplunkMSI"
Write-Host -ForegroundColor Green "[+] Downloading splunk from $SplunkUrl and saving to $SplunkPath"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
(New-Object System.Net.WebClient).DownloadFile($SplunkUrl, $SplunkPath)
}
if (!($SplunkUrl)) {
$SplunkUrl = "https://download.splunk.com/products/splunk/releases/7.1.1/windows/splunk-7.1.1-8f0ead9ec3db-x64-release.msi"
$SplunkPath = "C:\windows\temp\splunk-7.1.1-8f0ead9ec3db-x64-release.msi"
Write-Host -ForegroundColor Green "[-] Defaulting to downloading Version 7.1.1"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
(New-Object System.Net.WebClient).DownloadFile($SplunkUrl, $SplunkPath)
}
if ($SplunkPassword) {
Write-Host -ForegroundColor Green "[+] Setting password to $SplunkPassword"
}
else {
Write-Host -ForegroundColor Green "[-] Defaulting password to changeme"
$SplunkPassword = "changeme"
}
Write-Host -ForegroundColor Green "[+] Installing Splunk"
Start-Process -Wait C:\Windows\System32\msiexec.exe -ArgumentList "/I $SplunkPath AGREETOLICENSE=Yes SPLUNKPASSWORD=$SplunkPassword /passive" -PassThru
Write-Host "Splunk installation complete!"Last updated