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

Add support for splunk 7.2.4 to 'Splunk Custom App Remote Code Execution #11579

Merged
merged 42 commits into from
Mar 29, 2019
Merged

Add support for splunk 7.2.4 to 'Splunk Custom App Remote Code Execution #11579

merged 42 commits into from
Mar 29, 2019

Conversation

uf0o
Copy link
Contributor

@uf0o uf0o commented Mar 18, 2019

Hi
I have been working on integrating some changes to the 'Splunk Custom App Remote Code Execution' and including support for splunk 7.2.4 (it might even work on the whole 7 train up to 7.2.4)
Verification steps

  • Start msfconsole
  • use exploit/multi/http/splunk_upload_app_exec
  • set required variables (you will need admin credentials)
SET LHOST 192.168.1.2
SET RHOST 192.168.1.1
SET USERNAME admin
SET PASSWORD changeme
  • If targeting linux or macos, the payload will be set automatically to 'cmd/unix/reverse_python '

  • If targeting windows, the 'adduser' payload is automatically selected, since we do not have an available python reverse shell payload

  • 'run' or 'exploit' and you should expect reverse shell connection on port 4444 (or a new user added in case of windows)

It has been tested successfully on both linux,macos (windows does not support python reverse shell but all the other available commands are working as expected)

@uf0o
Copy link
Contributor Author

uf0o commented Mar 18, 2019

resubmitted from a unique branch

@uf0o
Copy link
Contributor Author

uf0o commented Mar 18, 2019

Can you also suggest how to set the default payload to "cmd/unix/reverse_python" on linux and osx targets? I have noticed that this one is a more stable payload.
thank you

@space-r7
Copy link
Contributor

You can set a default payload for each target in your module. An example of its usage can be found here.

@uf0o
Copy link
Contributor Author

uf0o commented Mar 18, 2019

thank you, I have added them now on each target

Copy link
Contributor

@h00die h00die left a comment

Choose a reason for hiding this comment

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

Docs are looking great, a few stylistic things but some great additions!

bcoles
bcoles previously requested changes Mar 19, 2019
Copy link
Contributor

@bcoles bcoles left a comment

Choose a reason for hiding this comment

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

Please run ./tools/dev/msftidy.rb modules/exploits/multi/http/splunk_upload_app_exec.rb on this module and resolve the following violations:

[*] Running msftidy.rb in ./.git/hooks/post-merge mode
--- Checking new and changed module syntax with tools/dev/msftidy.rb ---
modules/exploits/multi/http/splunk_upload_app_exec.rb - [INFO] No CVE references found. Please check before you land!
modules/exploits/multi/http/splunk_upload_app_exec.rb:127 - [WARNING] Spaces at EOL
modules/exploits/multi/http/splunk_upload_app_exec.rb:134 - [WARNING] Spaces at EOL
modules/exploits/multi/http/splunk_upload_app_exec.rb:139 - [WARNING] Spaces at EOL
modules/exploits/multi/http/splunk_upload_app_exec.rb:161 - [WARNING] Spaces at EOL
modules/exploits/multi/http/splunk_upload_app_exec.rb:348 - [WARNING] Spaces at EOL
modules/exploits/multi/http/splunk_upload_app_exec.rb:404 - [WARNING] Spaces at EOL
modules/exploits/multi/http/splunk_upload_app_exec.rb:414 - [WARNING] Spaces at EOL
------------------------------------------------------------------------

Edit If there's no CVE, that's fine. The warning can safely be ignored.

modules/exploits/multi/http/splunk_upload_app_exec.rb Outdated Show resolved Hide resolved
modules/exploits/multi/http/splunk_upload_app_exec.rb Outdated Show resolved Hide resolved
modules/exploits/multi/http/splunk_upload_app_exec.rb Outdated Show resolved Hide resolved
modules/exploits/multi/http/splunk_upload_app_exec.rb Outdated Show resolved Hide resolved
# log in to Splunk (if required)
do_login
# check if the target version is 7.2.4
if target.name.include? "7.2.4"
Copy link
Contributor

@bcoles bcoles Mar 19, 2019

Choose a reason for hiding this comment

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

It would be nice to know when the changes to Splunk which broke this module were introduced.

Were the changes introduced in version 7.2.4 ? Or >= 7.x ?

It may be worth starting to think about implementing different methods for each major version, ie exploit_5, exploit_6, exploit_7, etc (but better named).

This method is starting to become rather long, and the target version is repeatedly checked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally agree, but at the moment I am not able to test any early version of 7.x, so I would rather stick to the tested version, even though I suspect as well that changes have been introduced from 7.x

bcoles and others added 5 commits March 19, 2019 15:11
@bcoles bcoles dismissed their stale review March 19, 2019 15:11

msftidy violations have been resovled

@h00die
Copy link
Contributor

h00die commented Mar 19, 2019

Just wanted to say thanks for all the big doc updates, they look super good now (minus the one copy pasta i just posted). +1 for sticking hanging through all of the changes and additions!

@uf0o
Copy link
Contributor Author

uf0o commented Mar 29, 2019

Hi, is there any more I can contribute from my side?

@busterb busterb self-assigned this Mar 29, 2019
@busterb
Copy link
Member

busterb commented Mar 29, 2019

I didn't test Windows, but this seems alright with me. Let's ship it.

@busterb
Copy link
Member

busterb commented Mar 29, 2019

Release Notes

Expanded version support and documentation for the splunk_upload_app_exec module, including Splunk 5.x, 6.x, up to 7.2.4, has been added.

@tdoan-r7 tdoan-r7 added the rn-enhancement release notes enhancement label Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants