Module: Msf::Exploit::Remote::HTTP::Splunk::Search
- Included in:
- Msf::Exploit::Remote::HTTP::Splunk
- Defined in:
- lib/msf/core/exploit/remote/http/splunk/search.rb
Overview
This module provides a way of interacting with Splunk search
Instance Method Summary collapse
-
#search(namespace, query, cookie) ⇒ Rex::Proto::Http::Response
Executes a Splunk search in the specified namespace.
Instance Method Details
#search(namespace, query, cookie) ⇒ Rex::Proto::Http::Response
Executes a Splunk search in the specified namespace
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/msf/core/exploit/remote/http/splunk/search.rb', line 11 def search(namespace, query, ) csrf = extract_csrf_token() res = send_request_cgi( 'uri' => splunk_search_api_url(namespace), 'method' => 'POST', 'cookie' => , 'headers' => { 'X-Splunk-Form-Key' => csrf, 'X-Requested-With': 'XMLHttpRequest' }, 'vars_post' => { search: query } ) unless res&.code == 201 fail_with(Msf::Module::Failure::UnexpectedReply, "#{peer} Server did not respond with the expected HTTP 201") end res end |