-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Fix rails_secret_deserialization popchain (ERB @lineno) #7304
Fix rails_secret_deserialization popchain (ERB @lineno) #7304
Conversation
ERB changed as per <ruby/ruby@e82f4195d4> which broke the popchain used for code execution.
Damn. Hit submit too early. My test notes: Pre-patch
* note: installing ruby 2.2.0 via RVM on Debian required patch as per rvm/rvm#3548 ** note: requires *** note: fails with:
**** note: fails with:
Post-patch
* note: installing ruby 2.2.0 via RVM on Debian required patch as per rvm/rvm#3548 ** note: requires |
Awesome, we were just looking at this yesterday. |
Hey- just a quick lookover on this; it looks like the failed checks are based on trailing whitespace characters on lines 205 and 216. (I don't even think that was your code, but changing that should fix the red 'x' on the PR testing). |
trailing whitespace
Heh. Indeed... Totally not my code... 😅 Thanks @bwatters-r7 |
Good job, @lsato-r7. |
Release NotesThe Rails secret deserialization exploit was broken due to ERB changes that were introduced with Ruby 2.2.0. This fix adds support for Ruby >=2.2.0 by fleshing out the Marshalled objects to include a |
ERB changed as per ruby/ruby@e82f4195d4 which broke the popchain used for code execution. This ERB landed in Ruby 2.2.0.
Fleshing out the Marshalled objects to include an
@lineno
attribute for the ERB object makes the ERB part of the popchain happy again on Ruby >= 2.2.0. It still works against Ruby < 2.2.0 in my testing.Verification
List the steps needed to make sure this thing works
msfconsole
use exploit/multi/http/rails_secret_deserialization
RHOST
,RPORT
,RAILSVERSION
,SSL
,SECRET
,COOKIE_NAME
,TARGETURI
, and a payload with optionsSample - Ruby 2.2.0, Rails 4.2.7.1
Release Notes
rails_secret_deserialization exploit was broken due to ERB changes that were introduced with Ruby 2.2.0. This fix adds support for Ruby >=2.2.0 by fleshing out the Marshalled objects to include a
@lineno
attribute.