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

better check for VMware vCenter vScalation Priv Esc #18631

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

h00die
Copy link
Contributor

@h00die h00die commented Dec 20, 2023

When running against a non-vmware vcenter system, (like with local_exploit_suggester the check method would try to stat a file which didn't exist. This caused the output to look like:

/usr/lib/vmware-vmon/java-wrapper-vmon not owned by 'cis' group (owned by 'stat: cannot stat 'usr/lib/vmware-vmon/java-wrapper-vmon': no such file or directory'), or not writable

We now check if the file exists and is writable before running stat.

Verification

  • Start msfconsole
  • get a sesssion on a non-vcenter box
  • use vcenter_java_wrapper
  • set session #
  • check
  • Verify the output look sane and not like above

@jheysel-r7 jheysel-r7 added enhancement rn-enhancement release notes enhancement labels Dec 28, 2023
@jheysel-r7
Copy link
Contributor

Thanks for the improvement @h00die, seems quite logical and testing was just as expected:

Testing Before & After:

msf6 exploit(linux/local/vcenter_java_wrapper_vmon_priv_esc) > check
[*] The target is not exploitable. /usr/lib/vmware-vmon/java-wrapper-vmon not owned by 'cis' group (owned by 'stat: cannot statx '/usr/lib/vmware-vmon/java-wrapper-vmon': No such file or directory'), or not writable
msf6 exploit(linux/local/vcenter_java_wrapper_vmon_priv_esc) > reload
[*] Reloading module...
msf6 exploit(linux/local/vcenter_java_wrapper_vmon_priv_esc) > check
[*] The target is not exploitable. /usr/lib/vmware-vmon/java-wrapper-vmon not found on system

@jheysel-r7 jheysel-r7 merged commit 11d58ef into rapid7:master Dec 28, 2023
36 checks passed
@jheysel-r7 jheysel-r7 self-assigned this Dec 28, 2023
@jheysel-r7
Copy link
Contributor

Release Notes

This PR adds an improvement to the check method of the vcenter_java_wrapper_vmon_priv_esc module. Before the module would attempt to see if a file was writable before checking if the file existed on the system. This caused the check method to return an error message along with a the check code. This PR fixes that issue.

@h00die h00die deleted the vmon_check branch December 28, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement rn-enhancement release notes enhancement
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants