Familiarized myself with the vulnerability exploitation process of fastjson. The vulnerability principle of fastjson is not covered here. Although there are many explanations of the principle online, they are too basic and simple, so no one has written about it. I also had to explore it for a while.
Project Address#
GitHub - Lonely-night/fastjsonVul at 7f9d2d8ea1c27ae1f9c06076849ae76c25b6aff7
Exploitation Conditions#
- fastjson version: 1.2.76 <= fastjson < 1.2.83
- groovy dependency exists
Reproduction Steps#
- Compile the attack module into attack-1.jar package.
- Execute the HTTP service in the directory where attack-1.jar package is located.
python -m SimpleHTTPServer 8433
- Run the POC.
Reopen the project using IntelliJ IDEA, project path:
Switch JDK version to 1.8
Open the poc.java file, which is the payload for vulnerability verification.
Right-click and run.
Successfully run the payload.
The article is rough, please forgive me.
Image source: https://wallhaven.cc/