By the end of this lab, you will be able to:
- Install and configure a standalone Splunk Enterprise instance
- Understand Splunk architecture and data pipeline
- Onboard data from Windows and Linux systems using Universal Forwarders
- Master SPL (Search Processing Language) fundamentals
- Create searches, filters, and basic visualizations
- Identify security events and investigate incidents using Splunk
- Configure indexes, sourcetypes, and data inputs
- Create dashboards and reports for SOC operations
Deploy Splunk Enterprise as a Security Information and Event Management (SIEM) platform, onboard multiple data sources, and master SPL queries for security monitoring and incident investigation.
You are a SOC Analyst at CyberSecure Inc., and management has approved the deployment of Splunk Enterprise as the organization's primary SIEM platform. Your responsibilities include:
- Deploying Splunk Enterprise in the lab environment
- Onboarding logs from Windows and Linux systems
- Creating searches to detect security events
- Building dashboards for the SOC team
- Demonstrating Splunk's capabilities for incident investigation
- Ubuntu Server VM (from Week 2 lab) or dedicated SIEM VM
- Windows VM (for log collection)
- Linux VM (for log collection)
- Minimum system requirements:
- CPU: 4 cores
- RAM: 8GB (12GB recommended)
- Storage: 100GB free space
- Basic understanding of log formats and security events
Approximately 5-6 hours
Splunk is a powerful platform for searching, monitoring, and analyzing machine-generated data through a web-style interface.
Key Capabilities:
- Data Collection: Ingest data from any source
- Indexing: Store and index data for fast retrieval
- Search: Query data using SPL (Search Processing Language)
- Visualization: Create dashboards, charts, and reports
- Alerting: Real-time alerts on specific conditions
- Correlation: Correlate events across multiple sources
Splunk Architecture:
┌─────────────────────────────────────────────────────────┐
│ Splunk Architecture │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Forwarder │────────▶│ Indexer │ │
│ │ (Windows) │ │ │ │
│ └──────────────┘ │ - Parsing │ │
│ │ - Indexing │ │
│ ┌──────────────┐ │ - Storage │ │
│ │ Forwarder │────────▶│ │ │
│ │ (Linux) │ └──────┬───────┘ │
│ └──────────────┘ │ │
│ │ │
│ ┌──────────────┐ │ │
│ │ Forwarder │────────────────┘ │
│ │ (Firewall) │ │
│ └──────────────┘ ┌──────────────┐ │
│ │ Search Head │ │
│ │ │ │
│ │ - Web UI │ │
│ │ - Searches │ │
│ │ - Dashboards│ │
│ └──────────────┘ │
└─────────────────────────────────────────────────────────┘
Splunk Editions:
- Splunk Free: 500MB/day limit, no alerting, no authentication
- Splunk Enterprise Trial: 60-day full-featured trial
- Splunk Enterprise: Full commercial version
- Splunk Cloud: SaaS offering
For this lab: We'll use Splunk Enterprise Trial (60 days, fully featured)
Understanding how data flows through Splunk:
- Input: Data enters Splunk (forwarders, files, APIs)
- Parsing: Data is broken into events
- Indexing: Events are stored in indexes
- Searching: Users query indexed data
- Visualization: Results displayed in dashboards/reports
- Go to: https://www.splunk.com/
- Click: Free Splunk → Free Trial
- Create account (required for download)
- Select: Splunk Enterprise (Linux .deb or .tgz)
- Download:
splunk-9.x.x-linux-2.6-amd64.deb
Or use wget (requires authentication):
# After logging in, get download link from website
wget -O splunk-9.1.2-linux-amd64.deb "https://download.splunk.com/..."Transfer installer to VM:
scp splunk-9.1.2-linux-amd64.deb socadmin@192.168.56.10:/tmp/SSH to Splunk server:
ssh socadmin@192.168.56.10Install Splunk:
cd /tmp
sudo dpkg -i splunk-9.1.2-linux-amd64.debSplunk installs to: /opt/splunk/
Start Splunk for first time:
cd /opt/splunk/bin
sudo ./splunk start --accept-licenseCreate admin credentials:
Administrator Username: admin
Password: [Choose strong password, min 8 characters]
Splunk will start and display:
Splunk> All batbelt. Yay!
Splunk has started successfully!
Web interface: http://your-server-ip:8000
Enable Splunk to start on boot:
sudo /opt/splunk/bin/splunk enable boot-start- Open browser on your host machine
- Navigate to:
http://192.168.56.10:8000 - Login:
- Username:
admin - Password: [your password]
- Username:
Welcome Screen:
- Take the tour (optional)
- Click Start Searching
Configure receiving port for forwarders:
- Settings → Forwarding and receiving
- Configure receiving
- New Receiving Port
- Port:
9997 - Save
Verify:
sudo /opt/splunk/bin/splunk list inputstatusDownload Windows Universal Forwarder:
- https://www.splunk.com/en_us/download/universal-forwarder.html
- Select: Windows 64-bit
- Download:
splunkforwarder-9.1.2-x64-release.msi
Install on Windows VM:
- Run installer
- Accept license
- Username:
admin - Password: [same as Splunk server]
- Deployment Server: [Leave blank]
- Receiving Indexer:
- Host:
192.168.56.10 - Port:
9997
- Host:
- Install
Verify installation:
cd "C:\Program Files\SplunkUniversalForwarder\bin"
.\splunk.exe statusEdit inputs.conf:
cd "C:\Program Files\SplunkUniversalForwarder\etc\system\local"
notepad inputs.confAdd:
[WinEventLog://Security]
disabled = 0
index = windows_security
[WinEventLog://System]
disabled = 0
index = windows_system
[WinEventLog://Application]
disabled = 0
index = windows_application
[WinEventLog://Microsoft-Windows-Sysmon/Operational]
disabled = 0
index = windows_sysmon
renderXml = trueRestart forwarder:
cd "C:\Program Files\SplunkUniversalForwarder\bin"
.\splunk.exe restartDownload Linux Universal Forwarder:
wget -O splunkforwarder-9.1.2-linux-amd64.deb https://download.splunk.com/products/universalforwarder/releases/9.1.2/linux/splunkforwarder-9.1.2-b1a7a4176146-linux-2.6-amd64.debInstall:
sudo dpkg -i splunkforwarder-9.1.2-linux-amd64.debStart and configure:
cd /opt/splunkforwarder/bin
sudo ./splunk start --accept-license
# Create admin credentials
sudo ./splunk add forward-server 192.168.56.10:9997
sudo ./splunk enable boot-startConfigure Linux log collection:
sudo ./splunk add monitor /var/log/syslog -index linux_logs
sudo ./splunk add monitor /var/log/auth.log -index linux_security
sudo ./splunk add monitor /var/log/apache2/access.log -index web_logs
sudo ./splunk restartIn Splunk Web:
- Settings → Indexes
- New Index
- Create indexes:
windows_securitywindows_systemwindows_applicationwindows_sysmonlinux_logslinux_securityweb_logs
For each index:
- Max Size: 500MB (for lab)
- Click Save
Search for Windows events:
index=windows_security
Search for Linux events:
index=linux_logs
If no results:
- Wait 1-2 minutes for data to index
- Check forwarder status
- Verify network connectivity
- Check Splunk receiving port
SPL (Search Processing Language) is Splunk's query language.
Basic search structure:
index=<index_name> <search_terms> | <commands>
Search all Windows Security events:
index=windows_security
Search with time range:
index=windows_security earliest=-1h
Time modifiers:
earliest=-15m(last 15 minutes)earliest=-1h(last hour)earliest=-24h(last 24 hours)earliest=-7d(last 7 days)
Search for specific Event ID:
index=windows_security EventCode=4625
Event ID 4625 = Failed login attempt
Search with multiple conditions:
index=windows_security EventCode=4625 Account_Name!=*$
Operators:
=equals!=not equalsANDlogical ANDORlogical ORNOTlogical NOT*wildcard
Search for failed logins from specific user:
index=windows_security EventCode=4625 Account_Name="administrator"
Count failed login attempts:
index=windows_security EventCode=4625
| stats count
Count by user:
index=windows_security EventCode=4625
| stats count by Account_Name
| sort -count
Count by source IP:
index=windows_security EventCode=4625
| stats count by Source_Network_Address
| where count > 10
| sort -count
Create table of failed logins:
index=windows_security EventCode=4625
| table _time, Account_Name, Source_Network_Address, Workstation_Name
| sort -_time
Rename fields:
index=windows_security EventCode=4625
| table _time, Account_Name, Source_Network_Address
| rename Account_Name as "Username", Source_Network_Address as "Source IP"
Search SSH logins:
index=linux_security "sshd" "Accepted"
Search failed SSH attempts:
index=linux_security "sshd" "Failed password"
Extract source IPs from SSH failures:
index=linux_security "sshd" "Failed password"
| rex field=_raw "from (?<src_ip>\d+\.\d+\.\d+\.\d+)"
| stats count by src_ip
| sort -count
Search sudo commands:
index=linux_security "sudo" "COMMAND"
| rex field=_raw "USER=(?<user>\w+).*COMMAND=(?<command>.*)"
| table _time, user, command
Timechart of failed logins:
index=windows_security EventCode=4625
| timechart count
Timechart by user:
index=windows_security EventCode=4625
| timechart count by Account_Name
Timechart with span:
index=windows_security EventCode=4625
| timechart span=1h count
Windows RDP brute force:
index=windows_security EventCode=4625 Logon_Type=10
| stats count by Source_Network_Address, Account_Name
| where count > 5
| sort -count
SSH brute force:
index=linux_security "sshd" "Failed password"
| rex field=_raw "from (?<src_ip>\d+\.\d+\.\d+\.\d+)"
| stats count by src_ip
| where count > 10
| sort -count
Identify compromised accounts:
index=windows_security (EventCode=4625 OR EventCode=4624)
| stats count(eval(EventCode=4625)) as failures, count(eval(EventCode=4624)) as successes by Account_Name
| where failures > 5 AND successes > 0
| sort -failures
Windows user creation (Event ID 4720):
index=windows_security EventCode=4720
| table _time, Account_Name, Creator_Subject_Account_Name
| rename Account_Name as "New User", Creator_Subject_Account_Name as "Created By"
Detect admin group additions (Event ID 4728):
index=windows_security EventCode=4728
| table _time, Group_Name, Member_Name, Subject_Account_Name
| rename Subject_Account_Name as "Added By"
Top requested URLs:
index=web_logs
| rex field=_raw "\"(?<method>\w+) (?<uri>[^\s]+)"
| stats count by uri
| sort -count
| head 20
Detect web attacks (SQL injection attempts):
index=web_logs ("union" OR "select" OR "drop" OR "insert" OR "'" OR "--")
| rex field=_raw "\"(?<method>\w+) (?<uri>[^\s]+)"
| table _time, clientip, method, uri
Detect directory traversal:
index=web_logs ("../" OR "..\\" OR "%2e%2e")
| table _time, clientip, uri, status
Create new dashboard:
- Dashboards → Create New Dashboard
- Title: "SOC Security Dashboard"
- Permissions: Shared in App
- Create Dashboard
Add panels:
Panel 1: Failed Login Attempts (Last 24h)
index=windows_security EventCode=4625 earliest=-24h
| stats count
- Visualization: Single Value
- Title: "Failed Login Attempts (24h)"
Panel 2: Top Failed Login Users
index=windows_security EventCode=4625 earliest=-24h
| stats count by Account_Name
| sort -count
| head 10
- Visualization: Bar Chart
- Title: "Top 10 Failed Login Users"
Panel 3: Failed Logins Over Time
index=windows_security EventCode=4625 earliest=-24h
| timechart span=1h count
- Visualization: Line Chart
- Title: "Failed Logins Timeline"
Panel 4: SSH Failed Attempts by IP
index=linux_security "sshd" "Failed password" earliest=-24h
| rex field=_raw "from (?<src_ip>\d+\.\d+\.\d+\.\d+)"
| stats count by src_ip
| sort -count
| head 10
- Visualization: Pie Chart
- Title: "SSH Brute Force Sources"
Create report for daily security summary:
- Search & Reporting
- Run search:
index=windows_security EventCode=4625 earliest=-24h
| stats count by Account_Name, Source_Network_Address
| sort -count
- Save As → Report
- Title: "Daily Failed Login Report"
- Schedule: Daily at 8:00 AM
- Email results (optional)
Submit the following:
- Splunk-Lab-Report.md - Comprehensive lab report
- Screenshots/ - Directory containing:
- Splunk installation completion
- Web interface dashboard
- Data ingestion verification
- SPL search results for all exercises
- Security dashboard
- Failed login analysis
- Brute force detection
- SPL-Queries.txt - All SPL queries used
- Dashboard-Export.xml - Exported dashboard (Settings → Export)
# Splunk Introduction Lab Report
**Analyst:** [Your Name]
**Date:** [Date]
**Splunk Version:** 9.1.2
---
## 1. Installation
### Splunk Server
- **OS:** Ubuntu 22.04
- **IP Address:** 192.168.56.10
- **Installation Path:** /opt/splunk
- **Web Interface:** http://192.168.56.10:8000
**Screenshot:**

---
## 2. Data Onboarding
### Forwarders Configured
- [x] Windows VM (192.168.56.20)
- [x] Linux VM (192.168.56.30)
### Indexes Created
- windows_security
- windows_system
- linux_logs
- linux_security
- web_logs
**Screenshot:**

---
## 3. SPL Queries and Results
### Exercise 1: Failed Login Attempts
**Query:**
```spl
index=windows_security EventCode=4625
| stats countResult: 234 failed login attempts
Query:
index=windows_security EventCode=4625
| stats count by Source_Network_Address
| where count > 10
Result: Detected 3 IPs with >10 failed attempts
- Source IP: 203.0.113.50
- Attempts: 145
- Target Account: administrator
- Recommendation: Block IP, enforce account lockout policy
Dashboard: SOC Security Dashboard
- 4 panels created
- Real-time monitoring enabled
- Scheduled refresh: Every 5 minutes
---
## Evaluation Criteria
- **Installation:** Successfully deployed Splunk Enterprise
- **Data Onboarding:** Configured forwarders and indexes
- **SPL Proficiency:** Executed all search exercises correctly
- **Security Analysis:** Identified security events accurately
- **Dashboard Creation:** Built functional SOC dashboard
- **Documentation:** Professional, complete report
---
## Additional Resources
- [Splunk Documentation](https://docs.splunk.com/)
- [SPL Reference](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/)
- [Splunk Security Essentials](https://splunkbase.splunk.com/app/3435/)
- [Splunk Boss of the SOC](https://www.splunk.com/en_us/blog/conf-splunklive/boss-of-the-soc-scoring-server-questions-and-answers-and-dataset-open-sourced-and-ready-for-download.html)
---
**Lab Completion Time:** [Record your time]
**Difficulty Level:** Intermediate

