12.-Attacking-splunk
1. Create Splunk App Directory Structure
Create the necessary directory structure for the Splunk application:
2. Create PowerShell Reverse Shell (Windows)
Create a PowerShell script to establish a reverse shell connection:
File: splunk_shell/splunk_shell/bin/rev.ps1
3. Create a Batch File to Execute PowerShell (Windows)
File: splunk_shell/splunk_shell/bin/run.bat
4. Create Splunk App Configuration (Windows)
Configure Splunk to execute the batch file at regular intervals.
File: splunk_shell/splunk_shell/default/inputs.conf
5. Package the Splunk App
Create a compressed tar archive for easy deployment:
6. Set Up a Netcat Listener
Start a listener on port 443 to capture the reverse shell:
7. Upload the Splunk App
Navigate to "Apps" -> "Manage Apps" -> "Install app from file" in Splunk Web UI.
Upload
updater.tar.gz
.
8. Create Python Reverse Shell (Linux)
For Linux systems, create a Python-based reverse shell script.
File: splunk_shell/splunk_shell/bin/rev.py
9. Create Splunk App Configuration (Linux)
File: splunk_shell/splunk_shell/default/inputs.conf
10. Deploy the App to Splunk Deployment Server
Windows Deployment Server:
Copy updater.tar.gz
to the deployment apps directory:
Restart Splunk:
Linux Deployment Server:
Copy updater.tar.gz
to the deployment apps directory:
Restart Splunk:
11. Validate Shell Access
After gaining shell access, check the following:
Key Considerations
Ensure Netcat listener is active before running the scripts.
Modify the IP address and port in scripts based on your setup.
Use caution when testing on production systems.
Disable PowerShell execution policies if needed.
This guide provides a structured method for setting up a Splunk-based reverse shell for penetration testing and security research purposes.
Last updated