🖥️splunk

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the splunk command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███████╗██████╗ ██╗     ██╗   ██╗███╗   ██╗██╗  ██╗
#                ██╔════╝██╔══██╗██║     ██║   ██║████╗  ██║██║ ██╔╝
#                ███████╗██████╔╝██║     ██║   ██║██╔██╗ ██║█████╔╝ 
#                ╚════██║██╔═══╝ ██║     ██║   ██║██║╚██╗██║██╔═██╗ 
#                ███████║██║     ███████╗╚██████╔╝██║ ╚████║██║  ██╗
#                ╚══════╝╚═╝     ╚══════╝ ╚═════╝ ╚═╝  ╚═══╝╚═╝  ╚═╝
                                                                   
                                                                  
# indexes we have
index="network_dhcp" dest_ip=10.16.238.62
index="security_symantec" Security risk found
index="network_proxy_cisco" src_ip=XX.xx
index="network_proxy_cisco" 192.168.0.0
index="network_firewall_cisco" 195.....
index="network_wlc_cisco" 195.....

#network_api_user
9kg9y-EtaZBcqHti_ykz

#Zur Verwendung ist hier eine Beschreibung:
https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/RESTUM/RESTusing

#Zuerst musst du dir einen Session-Key holen der temporär für eine Stunde gültig ist:
curl -k https://splunk.lxu.io:8089/services/auth/login --data-urlencode username=network_api_user --data-urlencode password=

#Folgende Befehle können dann mit eingbunden Session-Key im Header ausgeführt werden:
curl -k -H "Authorization: Splunk <session-key>" ...

#Eine wird wie folgt ausgeführt:
curl -k -H "Authorization: Splunk <session_key>" https://splunk.lxu.io:8089/services/search/jobs/export -d search="search index=network_dhcp earliest=-5m | stats count"

Sessionkey = curl -k https://splunk.lxu.io:8089/services/auth/login --data-urlencode username=network_api_user --data-urlencode password=5xgOy-EtaZTcqHti_ZkY

curl -k -H "Authorization: Splunk $SESSIONKEY" https://splunk.lxu.io:8089/services/search/jobs/export -d search="search index=network_dhcp earliest=-5m | stats count"

curl -k -H "Authorization: Splunk $SESSIONKEY" https://splunk.lxu.io:8089/services/search/jobs/export -d search="search index=network_proxy_cisco earliest=-5m | top dest limit=50" 

#==============================##==============================#
# CMD SPLUNK						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░