-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
guard Rex::Version.new against crashes on local modules #19813
base: master
Are you sure you want to change the base?
Conversation
All of the existing This code splits at the first Edit: modules/exploits/linux/local/vmwgfx_fd_priv_esc.rb does no prior parsing of The package parsing code does no prior parsing of the version before passing to |
The This is just want I was seeing in an engagement and wanted to fix some crashes that |
I'll be testing these changes on target to make sure its handling better, and get some more test data. |
return CheckCode::Vulnerable("IF host OS is Ubuntu, kernel version #{release} is vulnerable") | ||
begin | ||
release_short = Rex::Version.new(release.split('-').first) | ||
release_long = Rex::Version.new(release.split('-')[0..1].join('-')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we re-join with '-' (which works on ubuntu where I tested it), this will fail on amazon linux.
Fedora 31 target (vm) I'm getting the following:
This is caused by https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/core/post/linux/kernel.rb#L262 . Which looks like its checking on the LOCAL (metasploit) system, not the remote (exploited) system. Just wanted to confirm if that was right and if that was the expected behavior. |
That is definitely checking the local file which is definitely wrong. The |
@jvoisin any background on that change? |
fixes #19812
Fixes some bugs and potential bugs where
Rex::Version.new
is fed data which may cause a crash. Guard these to prevent crashes on Amazon 2 Linux, and other systems (tomcat one should break on non dpkg based systems like fedora)